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

Polymorhic signature method check crashes javac

    Details

    • Subcomponent:
    • Resolved In Build:
      b143
    • Verification:
      Verified

      Backports

        Description

        If javac encounters a native method with no arguments in either MethodHandle or VarHandle, an NPE will occur:

        //Test.java
        package java.lang.invoke;

        class MethodHandle {
           native Object m();
        }

        javac -source 8 Test.java

        warning: [options] bootstrap class path not set in conjunction with -source 1.8
        1 warning
        An exception has occurred in the compiler (9-internal). Please file a bug against the Java compiler via the Java bug reporting page (http://bugreport.java.com) after checking the Bug Database (http://bugs.java.com) for duplicates. Include your program and the following diagnostic in your report. Thank you.
        java.lang.NullPointerException
        at com.sun.tools.javac.code.Types.isSignaturePolymorphic(jdk.compiler@9-internal/Types.java:1079)
        at com.sun.tools.javac.comp.MemberEnter.visitMethodDef(jdk.compiler@9-internal/MemberEnter.java:199)
        at com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(jdk.compiler@9-internal/JCTree.java:852)
        at com.sun.tools.javac.comp.MemberEnter.memberEnter(jdk.compiler@9-internal/MemberEnter.java:161)
        at com.sun.tools.javac.comp.MemberEnter.memberEnter(jdk.compiler@9-internal/MemberEnter.java:173)
        at com.sun.tools.javac.comp.TypeEnter$MembersPhase.finishClass(jdk.compiler@9-internal/TypeEnter.java:956)
        at com.sun.tools.javac.comp.TypeEnter$MembersPhase.runPhase(jdk.compiler@9-internal/TypeEnter.java:941)
        at com.sun.tools.javac.comp.TypeEnter$Phase.doCompleteEnvs(jdk.compiler@9-internal/TypeEnter.java:273)
        at com.sun.tools.javac.comp.TypeEnter$MembersPhase.doCompleteEnvs(jdk.compiler@9-internal/TypeEnter.java:876)
        at com.sun.tools.javac.comp.TypeEnter$Phase.completeEnvs(jdk.compiler@9-internal/TypeEnter.java:248)
        at com.sun.tools.javac.comp.TypeEnter$Phase.completeEnvs(jdk.compiler@9-internal/TypeEnter.java:257)
        at com.sun.tools.javac.comp.TypeEnter$Phase.completeEnvs(jdk.compiler@9-internal/TypeEnter.java:257)
        at com.sun.tools.javac.comp.TypeEnter$Phase.completeEnvs(jdk.compiler@9-internal/TypeEnter.java:257)
        at com.sun.tools.javac.comp.TypeEnter.complete(jdk.compiler@9-internal/TypeEnter.java:198)
        at com.sun.tools.javac.code.Symbol.complete(jdk.compiler@9-internal/Symbol.java:623)
        at com.sun.tools.javac.code.Symbol$ClassSymbol.complete(jdk.compiler@9-internal/Symbol.java:1236)
        at com.sun.tools.javac.comp.Enter.complete(jdk.compiler@9-internal/Enter.java:549)
        at com.sun.tools.javac.comp.Enter.main(jdk.compiler@9-internal/Enter.java:526)
        at com.sun.tools.javac.main.JavaCompiler.enterTrees(jdk.compiler@9-internal/JavaCompiler.java:1069)
        at com.sun.tools.javac.main.JavaCompiler.compile(jdk.compiler@9-internal/JavaCompiler.java:940)
        at com.sun.tools.javac.main.Main.compile(jdk.compiler@9-internal/Main.java:304)
        at com.sun.tools.javac.main.Main.compile(jdk.compiler@9-internal/Main.java:160)
        at com.sun.tools.javac.Main.compile(jdk.compiler@9-internal/Main.java:55)
        at com.sun.tools.javac.Main.main(jdk.compiler@9-internal/Main.java:41)

          Issue Links

            Activity

            Hide
            hgupdate HG Updates added a comment -
            URL: http://hg.openjdk.java.net/jdk9/dev/langtools/rev/6a79477df95d
            User: mcimadamore
            Date: 2016-10-26 14:45:04 +0000
            Show
            hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/dev/langtools/rev/6a79477df95d User: mcimadamore Date: 2016-10-26 14:45:04 +0000
            Hide
            hgupdate HG Updates added a comment -
            URL: http://hg.openjdk.java.net/jdk9/jdk9/langtools/rev/6a79477df95d
            User: lana
            Date: 2016-11-03 02:17:53 +0000
            Show
            hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/jdk9/langtools/rev/6a79477df95d User: lana Date: 2016-11-03 02:17:53 +0000
            Hide
            ostuart Owen Stuart added a comment -
            BPR no longer needed - fix is shipping in Update
            Show
            ostuart Owen Stuart added a comment - BPR no longer needed - fix is shipping in Update
            Hide
            andrew Andrew Hughes added a comment -
            Add change where issue was introduced (argtypes.length() == 1 is replaced with argtypes.tail.tail == null, which can cause NPE)
            Show
            andrew Andrew Hughes added a comment - Add change where issue was introduced (argtypes.length() == 1 is replaced with argtypes.tail.tail == null, which can cause NPE)

              People

              • Assignee:
                mcimadamore Maurizio Cimadamore
                Reporter:
                mcimadamore Maurizio Cimadamore
              • Votes:
                0 Vote for this issue
                Watchers:
                9 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: