blackdrag commented on PR #2019:
URL: https://github.com/apache/groovy/pull/2019#issuecomment-1876956061

   > The changes all look fine except the `IllegalArgumentException` bit. Can 
you change the name of the parameter to indicate fail on asm parsing or 
whatever you'd call the purpose of the `try` block?
   
   sure
   
   > Are you saying that if ASM and our ASM-plugins can't work out what the 
class file says, it throws `IllegalArgumentException`? Is there a test or two 
that cause this to happen?
   
   This is the code from ClassReader:
   ```
     @SuppressWarnings("PMD.ConstructorCallsOverridableMethod")
     ClassReader(
         final byte[] classFileBuffer, final int classFileOffset, final boolean 
checkClassVersion) {
       this.classFileBuffer = classFileBuffer;
       this.b = classFileBuffer;
       // Check the class' major_version. This field is after the magic and 
minor_version fields, which
       // use 4 and 2 bytes respectively.
       if (checkClassVersion && readShort(classFileOffset + 6) > Opcodes.V22) {
         throw new IllegalArgumentException(
             "Unsupported class file major version " + 
readShort(classFileOffset + 6));
       }
   ```
   So it is not if the library fails to read the class version, but if the read 
class version is for above Java 22. Of course this changes with the next asm 
releases.


-- 
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: notifications-unsubscr...@groovy.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to