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.
Build: NetBeans IDE 6.7 (Build 200906241340) VM: Java HotSpot(TM) Client VM, 1.5.0_22-b03, Java(TM) 2 Runtime Environment, Standard Edition, 1.5.0_22-b03 OS: Linux, 2.6.18-164.6.1.el5, i386 User Comments: proxity: I've removing a jar from a library. After that the IDE was rescanning the projects. Stacktrace: java.lang.NullPointerException at com.sun.tools.javac.jvm.Code.emitop0(Code.java:525) at com.sun.tools.javac.jvm.Items$SelfItem.load(Items.java:360) at com.sun.tools.javac.jvm.Gen.visitIdent(Gen.java:2103) at com.sun.tools.javac.tree.JCTree$JCIdent.accept(JCTree.java:1683) at com.sun.tools.javac.jvm.Gen.genExpr(Gen.java:835) at com.sun.tools.javac.jvm.Gen.visitApply(Gen.java:1677)
Created attachment 92279 [details] stacktrace
*** Bug 188881 has been marked as a duplicate of this bug. ***
Created attachment 113742 [details] stacktrace
Created attachment 115308 [details] stacktrace on opening of apisupport project
This bug already has 20 duplicates see http://statistics.netbeans.org/exceptions/detail.do?id=163470
Created attachment 116129 [details] stacktrace Scanning NetBeans sources...
Created attachment 116225 [details] stacktrace first start for ide with parsing for imperted projects (settings was imported from 7.1)
Created attachment 116338 [details] stacktrace
Created attachment 116463 [details] stacktrace
Created attachment 116695 [details] stacktrace
Hard to fix without a reproducible test case. Are you able to reproduce the issue? If so, could you please create a simple test case and attach it to the issue? Thanks.
Created attachment 120831 [details] stacktrace Opened diff pane while scanning is in progress.
Created attachment 129055 [details] stacktrace
Created attachment 130493 [details] stacktrace
Created attachment 132707 [details] stacktrace I had this error during background scanning of projects (in this case it was the repository of NetBeans).
Created attachment 132905 [details] stacktrace
Created attachment 136836 [details] stacktrace opening maven projects after installing dev 201307072319
Created attachment 139577 [details] stacktrace during unit test
Created attachment 140762 [details] stacktrace external build
Created attachment 146221 [details] stacktrace open file
46 reports => P2
This bug already has 50 duplicates see http://statistics.netbeans.org/exceptions/detail.do?id=163470
I've reproduced a NPE in emitop1 and I believe the reason is the same. Steps for reproduction from a clean userdir * Use NB 8.0 or 8.0.1 * checkout NB-7.3 sources * open a NB-7.3 projects java.editor and java.source with dependencies. * wait for the indexing to complete The offending construction is in o.n.api.java.source.TypeMirrorHandle, method resolve(). One switch case branch uses a variable, which is declared in another case branch. If the projects are opened so that nb-javac sources are not available, the IDE will complain that symbols like com.sun.tools.javac.code.Type are not available. The JavaCompiler.desugar() uses Repair translator to 'repair' damaged source: in this particular case, the variable declaration will be replaced by throw exception statement. The variable declarator will therefore cease to exist; the VariableDecl will not be visited to create a proper local and allocate index in the code generator. The symbol, however already contains an index from the definitive assignment analysis. The attached patch changes the code so that the variable decl is removed only if it is NOT used from the following switch branches. As leaving the variable declaration is complex (one must create code to properly initialize the variable, according to its type), if the variable is used from other switch branches, the entire switch is thrown away.
Created attachment 148529 [details] Proposed changes to javac impl
*** Bug 226005 has been marked as a duplicate of this bug. ***
The patch seems good to me. It removes the whole switch tree when an erroneous variable is used in successive case trees. Thanks Svato!
Fixed as nb-javac#bddee634c3fc and jet-main#10ac784c2438
Svato, please backport to release801.
Backported as releases#f30edf532987
Integrated into 'main-silver', will be available in build *201408070001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/10ac784c2438 User: Svata Dedic <sdedic@netbeans.org> Log: #178299: repair removes entire switch if variable decl is used form multiple cases; see commit nb-javac#bddee634c3fc
Integrated into 'releases/release801', will be available in build *201408071314* or newer. Wait for official and publicly available build. Changeset: http://hg.netbeans.org/releases/rev/f30edf532987 User: Svata Dedic <sdedic@netbeans.org> Log: #178299: repair removes entire switch if variable decl is used form multiple cases; see commit nb-javac#bddee634c3fc