-
Notifications
You must be signed in to change notification settings - Fork 729
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
Method.invoke presents different exception messages when invoking multiple times a method with wrong argument type #1835
Comments
Interesting bug. Given this occurs at the 17 invocation mark, it may be related to bytecode generation for reflect methods. |
Happened to
It appears a |
Does the problem manifest with -Xint? |
Does it still occur with Java 10 or 11? |
It still occurs with
|
@felipepontes-research please report this and similar issues to the OpenJDK project, it is not an OpenJ9 problem. |
The following program presents a null exception message after invoking 17 times a method with wrong argument type.
import java.lang.reflect.Method;
public class A {
public static void main(String[] args) throws NoSuchMethodException {
A a = new A();
for (int i = 0; i < 17; i++) {
Method method = A.class.getMethod("wait", long.class);
try {
method.invoke(a, "0");
} catch (Exception e) {
System.out.println(e.getMessage());
}
}
}
}
Affected versions:
openjdk version "1.8.0_162"
OpenJDK Runtime Environment (build 1.8.0_162-b12)
Eclipse OpenJ9 VM (build openj9-0.8.0, JRE 1.8.0 Linux amd64-64 Compressed References 20180315_120 (JIT enabled, AOT enabled)
OpenJ9 - e24e8aa
OMR - 3e8296b
JCL - ee1e77df1d based on jdk8u162-b12)
Steps to reproduce:
Current result:
argument type mismatch (x16)
null
Expected result:
Always print "argument type mismatch" message.
The text was updated successfully, but these errors were encountered: