Skip to content
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

@ExtensionMethod fails on Eclipse Oxygen if there is more than 1 parameter #1441

Closed
Kilrath opened this issue Jul 14, 2017 · 3 comments · Fixed by #2376
Closed

@ExtensionMethod fails on Eclipse Oxygen if there is more than 1 parameter #1441

Kilrath opened this issue Jul 14, 2017 · 3 comments · Fixed by #2376

Comments

@Kilrath
Copy link

Kilrath commented Jul 14, 2017

Following simple example fails with an ArrayIndexOutOfBoundsException due to compiling with Eclipse Oxygen (jdk 1.8+):

public class A {
public static Object test(Object object, Object returnThis) {
return returnThis;
}
}

@ExtensionMethod(A.class)
class B {
public Object testExtensionMethod(Object object) {
return object.test(new Object());
}
}

Exception
Internal compiler error:
java.lang.ArrayIndexOutOfBoundsException

In Eclipse Neon it works!

@datomesan
Copy link

I have the same problem and Eclipse show that error
Internal compiler error: java.lang.ArrayIndexOutOfBoundsException: 1 at org.eclipse.jdt.internal.compiler.ast.MessageSend.analyseCode(MessageSend.java:182)

@janaroj
Copy link

janaroj commented Feb 1, 2018

Having the same issue with Eclipse Oxygen:
java.lang.ArrayIndexOutOfBoundsException: 1
at org.eclipse.jdt.internal.compiler.ast.MessageSend.analyseCode(MessageSend.java:182)

@mad-pojo
Copy link

mad-pojo commented Apr 17, 2018

I make a correction: @ExtensionMethod fails if there are exactly 2 parameters.
Workaround: in the preferences "Java / Compiler / Errors/Warnings" switch the options "Unlikely argument type for collection methods using 'Object'" and "Unlikely argument type for method equals()" to "Ignore".
This feature will be ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants