Java.extend throws java.lang.ClassFormatError

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P4
    • None
    • Affects Version/s: None
    • Component/s: 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.

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

              Created:
              Updated:
              Resolved: