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 Dev (Build 201307012300) VM: Java HotSpot(TM) 64-Bit Server VM, 23.21-b01, Java(TM) SE Runtime Environment, 1.7.0_21-b11 OS: Windows 7 User Comments: stefan79: .. Stacktrace: java.lang.NullPointerException at org.netbeans.editor.MarkBlockChain.compareBlock(MarkBlockChain.java:112) at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker.isInGuarded(HintsInvoker.java:771) at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker$ScannerImpl.runAndAdd(HintsInvoker.java:638) at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker$ScannerImpl.scan(HintsInvoker.java:672) at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker$ScannerImpl.scan(HintsInvoker.java:610) at com.sun.source.util.TreeScanner.visitMemberSelect(TreeScanner.java:342)
Created attachment 136664 [details] stacktrace
I have synchronized the access to the MarkBlockChain.currentBlock - lets see how that will work. Alternatives I see would be to either require write lock to access the MarkBlockChain (which would prevent the hints from using it altogether, as background tasks cannot take document write locks), using ThreadLocal for the currentBlock (second best option, IMO if the current one will cause problems), or rewriting the hints to iterate over the chain itself. http://hg.netbeans.org/jet-main/rev/3e6229cab112
Integrated into 'main-silver', will be available in build *201307192300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/3e6229cab112 User: Jan Lahoda <jlahoda@netbeans.org> Log: #232210: synchronizing the access to the currentBlock field, as the MarkBlockChain can be access from multiple threads (otherwise would required a write/exclusive lock from the caller, but that is impossible for some callers).