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 258205

Summary: Compiler throws NPEs and Assertions on malformed annotations
Product: java Reporter: Svata Dedic <sdedic>
Component: CompilerAssignee: Dusan Balek <dbalek>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 8.2   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:
Attachments: dump file

Description Svata Dedic 2016-03-01 16:34:14 UTC
Created attachment 158699 [details]
dump file

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package javaapplication3;

import javax.persistence.JoinTable;

public class Test { 
   
     @JoinTable(name = "submission_compile_info",
            inverseJoinColumns = JoinC olumn("compile_info"))
    final int number;
    
    public Test(final Integer number) {
        this.number = requireNonNull(number);
    }
                            
}


Then try to remove the space in "JoinC olumn"; an Assertion error will be trown from ClassWriter:

java.lang.AssertionError: <error>
	at com.sun.tools.javac.jvm.ClassWriter$AttributeWriter.visitError(ClassWriter.java:902)
	at com.sun.tools.javac.code.Attribute$Error.accept(Attribute.java:387)
	at com.sun.tools.javac.jvm.ClassWriter$AttributeWriter.visitArray(ClassWriter.java:908)
	at com.sun.tools.javac.code.Attribute$Array.accept(Attribute.java:327)
	at com.sun.tools.javac.jvm.ClassWriter.writeCompoundAttribute(ClassWriter.java:925)
	at com.sun.tools.javac.jvm.ClassWriter.writeJavaAnnotations(ClassWriter.java:760)
	at com.sun.tools.javac.jvm.ClassWriter.writeMemberAttrs(ClassWriter.java:620)
	at com.sun.tools.javac.jvm.ClassWriter.writeField(ClassWriter.java:1120)
	at com.sun.tools.javac.jvm.ClassWriter.writeFields(ClassWriter.java:1629)
	at com.sun.tools.javac.jvm.ClassWriter.writeClassFile(ClassWriter.java:1732)
	at com.sun.tools.javac.jvm.ClassWriter.writeClass(ClassWriter.java:1659)
	at com.sun.tools.javac.main.JavaCompiler.genCode(JavaCompiler.java:740)
	at com.sun.tools.javac.main.JavaCompiler.generate(JavaCompiler.java:1607)
	at com.sun.tools.javac.api.JavacTaskImpl$6.process(JavacTaskImpl.java:539)
	at com.sun.tools.javac.api.JavacTaskImpl$Filter.run(JavacTaskImpl.java:607)
	at com.sun.tools.javac.api.JavacTaskImpl.generate(JavacTaskImpl.java:542)
[catch] at org.netbeans.modules.java.source.indexing.MultiPassCompileWorker.compile(MultiPassCompileWorker.java:304)
	at org.netbeans.modules.java.source.indexing.JavaCustomIndexer.index(JavaCustomIndexer.java:251)
	at org.netbeans.modules.parsing.spi.indexing.Indexable$MyAccessor$2.run(Indexable.java:161)
	at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater.runIndexer(RepositoryUpdater.java:296)
	at org.netbeans.modules.parsing.spi.indexing.Indexable$MyAccessor.index(Indexable.java:159)