-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[1.8] Improve support for outdated JDK versions
The JDT compiler is unable to calculate the argument names of a method binding when a JDK 8 is used and simply returns an empty array. This then leads to an out-of-bounds exception, as the number of parameter types no longer matches the number of parameter names. Note that this issue only happens with a proper JDK 8, but not an e.g. JDK 17 with compiler compliance set to Java 8. The parameter names themselves only seem to be relevant for cosmetic reason, so they are now simply ignored (together with a warning), rather than causing the editor to crash. From a technical perspective, the problem can be isolated to one of the internal classes of the JDT compiler: org.eclipse.jdt.internal.compiler.classfmt.MethodInfo -> getArgumentNames() -> readCodeAttribute() -> decodeCodeAttribute() The offset that is supposed to point to the "LocalVariableTable" is instead pointing to the "LineNumberTable" and as a result, the compiler is unable to extract the attribute names.
- Loading branch information
Showing
3 changed files
with
29 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters