-
Enhancement
-
Resolution: Fixed
-
P4
-
None
-
None
-
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.
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.