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

Functional Interface case from lambda spec crashes javac

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 8
    • tools
    • generic
    • generic

      During the course of writing tests for JDK-8007574, the following functional interface test case from the in-progress lambda specification caused javac to crash:

      @ExpectedIsFunInt(false) // Foo3 is _not_ functional: different signatures for m
      interface Foo3<T, N extends Number> {
        void m(T arg);
        void m(N arg);
      }
      @ExpectedIsFunInt(false) // Bar3 is _not_ functional: different signatures for m
      interface Bar3 extends Foo3<String, Integer> {}
      @ExpectedIsFunInt(true) // Baz3 is functional: same signature for m
      interface Baz3 extends Foo3<Integer, Integer> {}

      An annotation processor threw an uncaught exception.
      Consult the following stack trace for details.
      java.lang.NullPointerException
          at com.sun.tools.javac.code.Types$DescriptorFilter.accepts(Types.java:606)
          at com.sun.tools.javac.code.Types$DescriptorFilter.accepts(Types.java:593)
          at com.sun.tools.javac.code.Scope$2$1.skipToNextMatchingEntry(Scope.java:405)
          at com.sun.tools.javac.code.Scope$2$1.update(Scope.java:396)
          at com.sun.tools.javac.code.Scope$2$1.<init>(Scope.java:375)
          at com.sun.tools.javac.code.Scope$2.iterator(Scope.java:371)
          at com.sun.tools.javac.code.Scope$CompoundScope$1$1.nextIterator(Scope.java:653)
          at com.sun.tools.javac.code.Scope$CompoundScope$CompoundScopeIterator.update(Scope.java:703)
          at com.sun.tools.javac.code.Scope$CompoundScope$CompoundScopeIterator.<init>(Scope.java:680)
          at com.sun.tools.javac.code.Scope$CompoundScope$1$1.<init>(Scope.java:651)
          at com.sun.tools.javac.code.Scope$CompoundScope$1.iterator(Scope.java:651)
          at com.sun.tools.javac.code.Scope$CompoundScope$1$1.nextIterator(Scope.java:653)
          at com.sun.tools.javac.code.Scope$CompoundScope$CompoundScopeIterator.update(Scope.java:703)
          at com.sun.tools.javac.code.Scope$CompoundScope$CompoundScopeIterator.<init>(Scope.java:680)
          at com.sun.tools.javac.code.Scope$CompoundScope$1$1.<init>(Scope.java:651)
          at com.sun.tools.javac.code.Scope$CompoundScope$1.iterator(Scope.java:651)
          at com.sun.tools.javac.code.Types$DescriptorCache.findDescriptorInternal(Types.java:423)
          at com.sun.tools.javac.code.Types$DescriptorCache.get(Types.java:404)
          at com.sun.tools.javac.code.Types.findDescriptorSymbol(Types.java:556)
          at com.sun.tools.javac.code.Types.isFunctionalInterface(Types.java:572)
          at com.sun.tools.javac.model.JavacElements.isFunctionalInterface(JavacElements.java:769)
          at TestIsFunctionalInterface.process(TestIsFunctionalInterface.java:57)
          at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:777)
          at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:706)
          at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$1800(JavacProcessingEnvironment.java:93)
          at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1018)
          at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1152)
          at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1178)
          at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:864)
          at com.sun.tools.javac.main.Main.compile(Main.java:506)
          at com.sun.tools.javac.main.Main.compile(Main.java:365)
          at com.sun.tools.javac.main.Main.compile(Main.java:354)
          at com.sun.tools.javac.main.Main.compile(Main.java:345)
          at com.sun.tools.javac.Main.compile(Main.java:94)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:487)
          at com.sun.javatest.regtest.RegressionCompileCommand.run(RegressionCompileCommand.java:247)
          at com.sun.javatest.regtest.CompileAction.runCompile(CompileAction.java:556)
          at com.sun.javatest.regtest.Agent$Server.doCompile(Agent.java:508)
          at com.sun.javatest.regtest.Agent$Server.run(Agent.java:478)
          at com.sun.javatest.regtest.Agent.main(Agent.java:84)

            mcimadamore Maurizio Cimadamore
            darcy Joe Darcy
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: