This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 250685 - java.lang.AssertionError: Could not determine position of tree
Summary: java.lang.AssertionError: Could not determine position of tree
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Compiler (show other bugs)
Version: 8.0.2
Hardware: PC Other
: P2 normal (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-25 11:06 UTC by pjdm
Modified: 2015-03-03 04:18 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Source to reproduce (776 bytes, application/x-zip-compressed)
2015-02-25 11:06 UTC, pjdm
Details

Note You need to log in before you can comment on or make changes to this bug.
Description pjdm 2015-02-25 11:06:09 UTC
Created attachment 152203 [details]
Source to reproduce

Attempting to use an annotation on an anonymous class results in an unexpected exception. (Java 1.8.0_20-b2)

Caused: java.lang.AssertionError: Could not determine position of tree new @MyAnnotation(text = "abc") MyInterface(){
    
    () {
        super();
    }
    
    @Override()
    void myMethod() {
        System.out.printf("My method\n");
    }
}
	at com.sun.tools.javac.util.Assert.error(Assert.java:133)
	at com.sun.tools.javac.code.TypeAnnotations$TypeAnnotationPositions.visitNewClass(TypeAnnotations.java:1260)
	at com.sun.tools.javac.tree.JCTree$JCNewClass.accept(JCTree.java:1522)
	at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
	at com.sun.tools.javac.code.TypeAnnotations$TypeAnnotationPositions.scan(TypeAnnotations.java:279)
	at com.sun.tools.javac.code.TypeAnnotations$TypeAnnotationPositions.visitVarDef(TypeAnnotations.java:1202)
	at com.sun.tools.javac.tree.JCTree$JCVariableDecl.accept(JCTree.java:858)
	at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
	at com.sun.tools.javac.code.TypeAnnotations$TypeAnnotationPositions.scan(TypeAnnotations.java:279)
	at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:57)
	at com.sun.tools.javac.code.TypeAnnotations$TypeAnnotationPositions.visitBlock(TypeAnnotations.java:1212)
	at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:915)
	at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
	at com.sun.tools.javac.code.TypeAnnotations$TypeAnnotationPositions.scan(TypeAnnotations.java:279)
	at com.sun.tools.javac.code.TypeAnnotations$TypeAnnotationPositions.visitMethodDef(TypeAnnotations.java:1113)
	at com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:784)
	at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
	at com.sun.tools.javac.code.TypeAnnotations$TypeAnnotationPositions.scan(TypeAnnotations.java:279)
	at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:57)
	at com.sun.tools.javac.code.TypeAnnotations$TypeAnnotationPositions.visitClassDef(TypeAnnotations.java:1046)
	at com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:698)
	at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
	at com.sun.tools.javac.code.TypeAnnotations$TypeAnnotationPositions.scan(TypeAnnotations.java:279)
	at com.sun.tools.javac.code.TypeAnnotations.organizeTypeAnnotationsBodies(TypeAnnotations.java:155)
	at com.sun.tools.javac.comp.Attr.attribClassBody(Attr.java:4606)
	at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:4474)
	at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:4402)
	at com.sun.tools.javac.comp.Attr.attrib(Attr.java:4377)
	at com.sun.tools.javac.main.JavaCompiler.attribute(JavaCompiler.java:1311)
	at com.sun.tools.javac.main.JavaCompiler.attribute(JavaCompiler.java:1284)
	at com.sun.tools.javac.api.JavacTaskImpl.analyze(JavacTaskImpl.java:469)
	at com.sun.tools.javac.api.JavacTaskImpl.analyze(JavacTaskImpl.java:448)
	at org.netbeans.modules.java.source.parsing.JavacParser.moveToPhase(JavacParser.java:664)
	at org.netbeans.modules.java.source.parsing.JavacParser.getResult(JavacParser.java:519)
	at org.netbeans.modules.java.source.parsing.JavacParser.getResult(JavacParser.java:174)
	at org.netbeans.modules.parsing.impl.TaskProcessor.callGetResult(TaskProcessor.java:620)
	at org.netbeans.modules.parsing.impl.SourceCache.getResult(SourceCache.java:256)
[catch] at org.netbeans.modules.parsing.impl.TaskProcessor$CompilationJob.run(TaskProcessor.java:733)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1423)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033)
Comment 1 Svata Dedic 2015-02-27 09:52:29 UTC
Reproduced on dev build, too:

import java.util.concurrent.Callable;

public class Bug  {
    public void bleh() {
        Callable i = new @Deprecated Callable() {
            
        };
    }
}
Comment 3 Quality Engineering 2015-03-03 04:18:43 UTC
Integrated into 'main-silver', will be available in build *201503030001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/ba19583f37aa
User: Dusan Balek <dbalek@netbeans.org>
Log: Issues #242108, #250685, and #250701 - fixed.