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

WriteableScope.dupUnshared misbehaves on shared Scopes

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 9
    • 9
    • tools
    • b40
    • Verified

        When a ScopeImpl that is already shared is dupUnshared, the result is a ScopeImpl that partly contains and partly does not contain any Symbols added in the child Scopes. Moreover "remove" crashes with a NPE:
        java.lang.NullPointerException
        at com.sun.tools.javac.code.Scope$ScopeImpl.remove(Scope.java:406)
        at DupUnsharedTest.run(DupUnsharedTest.java:72)
        at DupUnsharedTest.main(DupUnsharedTest.java:37)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at com.sun.javatest.regtest.MainWrapper$MainThread.run(MainWrapper.java:94)
        at java.lang.Thread.run(Thread.java:745)

        Test case is attached.

              jlahoda Jan Lahoda
              jlahoda Jan Lahoda
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: