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

Java.extend throws java.lang.ClassFormatError

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:
      None

      Description

      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.

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: