-
Bug
-
Resolution: Not an Issue
-
P3
-
None
-
8
-
linux
FULL PRODUCT VERSION :
Java(TM) SE Runtime Environment (build 1.8.0-ea-b117)
ADDITIONAL OS VERSION INFORMATION :
My test is running on the public CI-Server Travis: https://travis-ci.org/stefanbirkner/oraclejdk8-method-getannotations-bug/jobs/14898742
A DESCRIPTION OF THE PROBLEM :
I have two classes Super and Sub in the package foobar.
class Super {
@org.junit.Test
public void methodOfSuper() {
}
}
public class Sub extends Super {
}
It is important that the Super has package visibility. The call Sub.class.getMethod("methodOfSuper").getAnnotations() returns different values in JDK 7 and JDK 8. On JDK 7 it has no annotations while on JDK 8 it has one annotation (@Test).
(This bug has been found to be the cause of a JUnit bug: https://github.com/junit-team/junit /issues/749 )
REGRESSION. Last worked in version 7u45
ADDITIONAL REGRESSION INFORMATION:
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Clone the project https://github.com/stefanbirkner/oraclejdk8-method-getannotations-bug and run mvn test.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
mvn test should be successful.
ACTUAL -
mvn test fails.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
https://github.com/stefanbirkner/oraclejdk8-method-getannotations-bug
---------- END SOURCE ----------
Java(TM) SE Runtime Environment (build 1.8.0-ea-b117)
ADDITIONAL OS VERSION INFORMATION :
My test is running on the public CI-Server Travis: https://travis-ci.org/stefanbirkner/oraclejdk8-method-getannotations-bug/jobs/14898742
A DESCRIPTION OF THE PROBLEM :
I have two classes Super and Sub in the package foobar.
class Super {
@org.junit.Test
public void methodOfSuper() {
}
}
public class Sub extends Super {
}
It is important that the Super has package visibility. The call Sub.class.getMethod("methodOfSuper").getAnnotations() returns different values in JDK 7 and JDK 8. On JDK 7 it has no annotations while on JDK 8 it has one annotation (@Test).
(This bug has been found to be the cause of a JUnit bug: https://github.com/junit-team/junit /issues/749 )
REGRESSION. Last worked in version 7u45
ADDITIONAL REGRESSION INFORMATION:
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Clone the project https://github.com/stefanbirkner/oraclejdk8-method-getannotations-bug and run mvn test.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
mvn test should be successful.
ACTUAL -
mvn test fails.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
https://github.com/stefanbirkner/oraclejdk8-method-getannotations-bug
---------- END SOURCE ----------
- duplicates
-
JDK-8078571 java.lang.reflect.method.isAnnotationPresent backward compatible at jdk-7u80
-
- Closed
-
-
JDK-8098840 Method annotation added in abstract super method
-
- Closed
-
- relates to
-
JDK-6695379 Copy method annotations and parameter annotations to synthetic bridge methods
-
- Closed
-