Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8168921

Inconsistent Annotation.toString()

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 9
    • None
    • core-libs

      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.

            igerasim Ivan Gerasimov
            igerasim Ivan Gerasimov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: