XN137 commented on PR #6221:
URL: https://github.com/apache/iceberg/pull/6221#issuecomment-1337298037

   additional context:
   the failing check can only be performed when the compiled bytecode contains 
parameter name information for methods:
   
   
https://github.com/palantir/gradle-baseline/blob/fd7759a9a37112db69f6875966e869a078a00319/baseline-error-prone/src/main/java/com/palantir/baseline/errorprone/ConsistentOverrides.java#L151-L164
   
   so it depends on whether the jdk classes were compiled with the 
`-parameters` flag for `javac` or not:
   ```
     -parameters
           Generate metadata for reflection on method parameters
   ```
   
   on jdk 8 this flag is commonly not used:
   ```
   ~/.sdkman/candidates/java/8.0.352-zulu/bin$ ./javap -version && ./javap -l 
java.io.InputStream | egrep "public.*read|off"
   1.8.0_352
     public abstract int read() throws java.io.IOException;
     public int read(byte[]) throws java.io.IOException;
     public int read(byte[], int, int) throws java.io.IOException;
   ```
   
   on jdk 11 it is commonly used:
   ```
   ~/.sdkman/candidates/java/11.0.17-zulu/bin$ ./javap -version && ./javap -l 
java.io.InputStream | egrep "public.*read|off"
   11.0.17
     public abstract int read() throws java.io.IOException;
     public int read(byte[]) throws java.io.IOException;
     public int read(byte[], int, int) throws java.io.IOException;
             0      81     2   off   I
     public byte[] readAllBytes() throws java.io.IOException;
     public byte[] readNBytes(int) throws java.io.IOException;
           200      74     7 offset   I
     public int readNBytes(byte[], int, int) throws java.io.IOException;
             0      53     2   off   I
   ```
   
   but there are some jdk vendors (i.e. on centos7) that also enable this flag 
on jdk8, thus this check might fail depending on the jdk distribution used.
   so targeting jdk11 is just a way to always trigger the check violation.
   
   long story short, this PR should get merged to fix the check on all kind of 
jdks :sweat_drops: 


-- 
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]

Reply via email to