Re: BCEL: Can't load Object.class using LDC

2022-02-04 Thread Stefan Reich
Hi Gary, well I'm kinda done here, things work fine for me. I did create an issue though: https://issues.apache.org/jira/browse/BCEL-360 On Fri, 4 Feb 2022 at 16:54, Gary Gregory wrote: > Stefan, > > Would you please create a Jira ticket? This will give your issue more > visibility and one loca

RE: BCEL: Can't load Object.class using LDC

2022-02-04 Thread Mark Roberts
I would suggest defaulting to the system property "java.version", that is what the Daikon tool set does. Mark -Original Message- From: Gary Gregory [mailto:garydgreg...@gmail.com] Sent: Friday, February 4, 2022 7:54 AM To: Commons Developers List Subject: Re: BCEL:

Re: BCEL: Can't load Object.class using LDC

2022-02-04 Thread Gary Gregory
Stefan, Would you please create a Jira ticket? This will give your issue more visibility and one location with ALL the information needed in the future. Gary On Fri, Feb 4, 2022, 09:49 Stefan Reich wrote: > Will you look at that. BCEL's verifier actually checks for this > (Pass3aVerifier.java

Re: BCEL: Can't load Object.class using LDC

2022-02-04 Thread Stefan Reich
Will you look at that. BCEL's verifier actually checks for this (Pass3aVerifier.java): public void visitLDC(final LDC ldc) { indexValid(ldc, ldc.getIndex()); final Constant c = constantPoolGen.getConstant(ldc.getIndex()); if (c instanceof ConstantClass) { addMessage("Operand of L

Re: BCEL: Can't load Object.class using LDC

2022-02-04 Thread Stefan Reich
Update: They changed it in Java 5. ClassGen.setMajor(49) + ClassGen.setMinor(0) works. On Fri, 4 Feb 2022 at 15:26, Stefan Reich < stefan.reich.maker.of@googlemail.com> wrote: > Mystery solved, ladies and gentlemen... > > It was... > > the byte code version. BCEL outputs version 45.3 by defau

Re: BCEL: Can't load Object.class using LDC

2022-02-04 Thread Stefan Reich
Mystery solved, ladies and gentlemen... It was... the byte code version. BCEL outputs version 45.3 by default (JDK 1.1). There were multiple changes to the class file format spec since then. Specifically, they must have allowed ldc to load .class objects directly at some point after JDK 1.1. In

Re: BCEL: Can't load Object.class using LDC

2022-02-02 Thread Romain Manni-Bucau
Hi, Maybe a bit ot of topic but did you check with asm (using classreader for ex) if it is readable for it? Javap in verbose mode is hard to read humanly (and not verbosel does not mean much) so an issue can still be hidden. Romain Manni-Bucau @rmannibucau | Blo

Re: BCEL: Can't load Object.class using LDC

2022-02-02 Thread Stefan Reich
I'm mainly curious how it's possible that everything looks completely normal in javap (checked a dozen times), but the class verifier complains anyway? Something has to be different. Is there a way to dig deeper into a class file? Greetings On Wed, 2 Feb 2022 at 23:14, Stefan Reich < stefan.reich

Re: BCEL: Can't load Object.class using LDC

2022-02-02 Thread Stefan Reich
Hmm, no change with latest version. I did "git clone https://github.com/apache/commons-bcel.git"; and "mvn package". stefan@lenovo-ThinkPad-X220:~/dev/classreftest$ javac -cp bcel-6.6.0-SNAPSHOT.jar MakeBadClassFile.java stefan@lenovo-ThinkPad-X220:~/dev/classreftest$ java -cp bcel-6.6.0-SNAPSHOT

Re: BCEL: Can't load Object.class using LDC

2022-02-02 Thread Gary Gregory
You should try the latest from git master. Gary On Wed, Feb 2, 2022, 15:41 Stefan Reich wrote: > Hi again, > > actual problem this time... > > I think I am doing everything right... Decompilation in javap -v looks > just like it should. But I get a VerifyError... I'm using JDK 17. Full > progra