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

Java.extend throws java.lang.ClassFormatError

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • None
    • None
    • core-libs
    • None

      jjs>var c = Java.type("java.lang.Comparable")
      jjs>Java.extend(c, c)
      Exception in thread "main" java.lang.ClassFormatError: Duplicate interface name "java/lang/Comparable" in class file org/openjdk/nashorn/javaadapters/java_lang_Comparable$$Comparable

      while this behavior is correct, it's still throwing a java.lang.Error; it'd be preferable to sanitize input to Java.extend and throw a JavaScript TypeError if a class or interface is specified multiple times.

            attila Attila Szegedi
            attila Attila Szegedi
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: