[ 
https://issues.apache.org/jira/browse/BCEL-377?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18028092#comment-18028092
 ] 

Andrey Loskutov commented on BCEL-377:
--------------------------------------

I believe org.apache.bcel.generic.INVOKEDYNAMIC is not properly implemented.
I don't see anywhere references to "BootstrapMethods"
https://stackoverflow.com/questions/30733557/what-is-a-bootstrap-method

ASM does this:

https://gitlab.ow2.org/asm/asm/-/blob/master/asm/src/main/java/org/objectweb/asm/MethodWriter.java?ref_type=heads#L1066-1092

Note symbolTable.addConstantInvokeDynamic(name, descriptor, 
bootstrapMethodHandle, bootstrapMethodArguments);

This calls  addBootstrapMethod
https://gitlab.ow2.org/asm/asm/-/blob/master/asm/src/main/java/org/objectweb/asm/SymbolTable.java?ref_type=heads#L946-L954

I don't see anything comparable coming in BCEL. 

I would expect code below doing something like adding bootstrap method handles 
but I don't see it:
* org.apache.bcel.util.BCELifier.visitJavaClass(JavaClass)
* or org.apache.bcel.generic.ClassGen
* or org.apache.bcel.generic.InstructionFactory.createInvoke(String, String, 
Type, Type[], short, boolean)

I don't think I have time to implement lambda generation support for BCEL, and 
on the other side I believe **reading** Java 25 bytecode shouldn't be affected 
by the uncovered problem.

With that, and assuming the problem was *always* there since introduction of 
INVOKEDYNAMIC and just uncovered by the new javap implementation in Java 22+, 
should we "mute" or ignore the test failures, releaser 6.11 & add a ticket to 
properly support *writing* lambda code?

> Fix Java 24 and 25 tests and release
> ------------------------------------
>
>                 Key: BCEL-377
>                 URL: https://issues.apache.org/jira/browse/BCEL-377
>             Project: Commons BCEL
>          Issue Type: New Feature
>    Affects Versions: 6.10.0
>            Reporter: Dejan Stojadinović
>            Priority: Major
>              Labels: Java25, patch, patch-upgrade
>         Attachments: BCELifierTest.java, pom.xml, test_BAD_mvn_java25.txt, 
> test_OK_mvn_java21.txt
>
>
> *Prologue:* [https://github.com/spotbugs/spotbugs/issues/3569] SpotBugs: 
> Update to BCEL stable 6.11 release
> *Note:* it really doesn't have to be a full-blown 6.11.0 release; patch 
> 6.10.1 would do:
>  * version 6.10.0: 
> [https://github.com/apache/commons-bcel/releases/tag/rel%2Fcommons-bcel-6.10.0]
>  and
>  * commit: 
> [https://github.com/apache/commons-bcel/commit/70562832ce2cc8925787bacf53911615e6fbb2b7]
> FYI [~ggregory] 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to