mbien commented on code in PR #8810:
URL: https://github.com/apache/netbeans/pull/8810#discussion_r2383375154
##########
extide/gradle/netbeans-gradle-tooling/src/main/java/org/netbeans/modules/gradle/tooling/NbProjectInfoBuilder.java:
##########
@@ -367,11 +367,19 @@ private String dependenciesAsString(Task t,
TaskDependency td) {
}
private void detectConfigurationArtifacts(NbProjectInfoModel model) {
+ // JDK-8301046: Don't use Configuration::getName as a method
reference. The bug, when
+ // compiling `Configuration::getName` against Gradle >= 8.4, causes
javac to pick the
+ // wrong receiver target (invokeinterface on Named::getName) in the
lambda bootstrap
+ // method params rather than the (correct per JLS) invokevirtual on
the callsite's
+ // erasure type (Configuration). This will break at runtime when
calling Gradle <8.4,
+ // as in earlier versions the Configuration class does not implement
Named, and throws
+ // a BootstrapMethodError wrapping a LambdaConversionException. The
lambda form:
+ // `c -> c.getName()` bootstraps correctly but costs an extra method
def/indirection.
Review Comment:
this reminded me on this old PR https://github.com/apache/netbeans/pull/4864
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists