JDK-8168921 : Inconsistent Annotation.toString()
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang:reflect
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2016-10-30
  • Updated: 2016-11-14
  • Resolved: 2016-11-03
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9 b144Fixed
Related Reports
Relates :  
Description
Suppose an annotation is of form 

    @interface MyAnnotation {
        long value();
    }

Get the annotation object with sun.reflect.annotation.AnnotationParser.annotationForMap(MyAnnotation.class, Map.of("value", some_value)).

toString() method will produce a string containing that 'some_value' with the optional 'L' suffix appended.

Normally, the suffix is not appended for values that can be represented with int, and is appended otherwise.
However, the logic does not hold for values Long.MIN_VALUE and Integer.MIN_VALUE: for the former the suffix is not appended and for the later the suffix L is appended.