-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AIOOBE in ReferenceExpression.sIsMoreSpecific when saving incomplete statement #1330
Comments
ShahzaibIbrahim
added a commit
to ShahzaibIbrahim/eclipse.jdt.core
that referenced
this issue
Sep 22, 2023
…statement eclipse-jdt#1330 While searching for the correct method binding, the method ReferenceExpression::sIsMoreSpecific() is executed with type bindings for the two accept methods of FileNameFilter and FileFilter. Fix: Added a check before iterating over the arguments for both message to avoid AIOOBE. eclipse-jdt#1330
3 tasks
ShahzaibIbrahim
added a commit
to ShahzaibIbrahim/eclipse.jdt.core
that referenced
this issue
Sep 25, 2023
statement eclipse-jdt#1330 As per findings, JLS 20 removed this iteration as compared to JLS 20, that why removing this specific code block which checks the parameter for choosing the most specific functions (see reference §15.13.1) eclipse-jdt#1330
ShahzaibIbrahim
added a commit
to ShahzaibIbrahim/eclipse.jdt.core
that referenced
this issue
Sep 27, 2023
statement eclipse-jdt#1330 Adding Compatibility Check for JDK 1.8 eclipse-jdt#1330
jukzi
pushed a commit
to ShahzaibIbrahim/eclipse.jdt.core
that referenced
this issue
Feb 1, 2024
…statement eclipse-jdt#1330 While searching for the correct method binding, the method ReferenceExpression::sIsMoreSpecific() is executed with type bindings for the two accept methods of FileNameFilter and FileFilter. Fix: Added a check before iterating over the arguments for both message to avoid AIOOBE. eclipse-jdt#1330
jukzi
pushed a commit
to ShahzaibIbrahim/eclipse.jdt.core
that referenced
this issue
Feb 1, 2024
statement eclipse-jdt#1330 As per findings, JLS 20 removed this iteration as compared to JLS 20, that why removing this specific code block which checks the parameter for choosing the most specific functions (see reference §15.13.1) eclipse-jdt#1330
jukzi
pushed a commit
to ShahzaibIbrahim/eclipse.jdt.core
that referenced
this issue
Feb 1, 2024
statement eclipse-jdt#1330 Adding Compatibility Check for JDK 1.8 eclipse-jdt#1330
jjohnstn
added a commit
to jjohnstn/www.eclipse.org-eclipse
that referenced
this issue
Apr 26, 2024
akurtakov
pushed a commit
to eclipse-platform/www.eclipse.org-eclipse
that referenced
this issue
Apr 26, 2024
HeikoKlare
added a commit
to HeikoKlare/eclipse.jdt.core
that referenced
this issue
Jan 4, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Issue
Saving/compiling a Java file with the following content leads to an
ArrayIndexOutOfBoundsException
:Note that the statement is incomplete, as the semicolon is missing.
Initial Analysis
File::listFiles()
is polymorphic and has two 1-argument implementations that accept either aFilenameFilter
or aFileFilter
.These interfaces look as follows:
While searching for the correct method binding (which in this case is the method accepting a
FileFilter
), the methodReferenceExpression::sIsMoreSpecific()
is executed with type bindings for the twoaccept
methods ofFileNameFilter
andFileFilter
. It compares the parameter lists of bothaccept
methods and fails with an AIOOBE due to different sizes of the parameter lists, although the code should only be reached in case the parameter lists have equal length:eclipse.jdt.core/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ReferenceExpression.java
Lines 1302 to 1306 in 816bc73
The stack when the exception occurs looks as follows:
I can have a look at this issue and provide a PR, but it will take some time until I can address it. So if someone knows that code well and can easily fix this or if you consider this to be more urgent, feel free to take over.
The text was updated successfully, but these errors were encountered: