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.
steps: Start NB with new userdir use Tools/Options select Fonts&Colors pane select CSS language NPE is thrown no preview is shown and it's not possible to do any changes
Created attachment 52785 [details] messages.log
Unfortunately I'm unable to reproduce but the situation is that TokenHierarchy.tokenSequence() returns null - this may happen because a language for the document is not known yet. Hypothesis: I remember that Hanz was fixing a deadlock between his an our language managers so I'm not sure whether he does not return null language until his initializations are finished. That could lead to this problem. Anyway I will fix lexer's side by returning empty list of token sequences in such case.
Looks like Vita was faster than me :) BTW I'll double-check the places where token sequence is obtained and try to do some sort of handling for (TH.tokenSequence() == null). The list is however rather huge >200 occurrences :(
This should be fixed by Vita's today's commit. Since this is a potential stopper, we should think about propagating into release60. Vito is the backport of the complete fix necessary or just the part in TH would suffice?
The culprit was in Schliemann's and Lexer's language providers that were not able to handle 'testXXX_<mime-type>' mime types that we use in Tools-Options for encoding a test profile name into a mime type. It cropped up on many places that use TH.tokenSequence() and I first thought that the problem was in lexer. Hence the fixes in TH.embeddedSequences(), SyntaxHighlighting, etc. The fixes are correct, but didn't solve the real problem - the use of 'testXXX_' prefix in mime types. The real fix was in: languages/engine/src/org/netbeans/modules/languages/ParserManagerImpl.java languages/engine/src/org/netbeans/modules/languages/LanguagesManager.java lexer/src/org/netbeans/lib/lexer/LanguageManager.java So, to minimize changes for release60, I'll redo the fix in the branch and attach new diff here.
Created attachment 52847 [details] The patch for release60 branch
The issue is fixed in trunk and the attached patch backports the fix to release60 branch. I'm marking the issue according to the high resistance rules - P1, 60_HR_FIX, FIXED, TM = Dev. Since this involves both Lexer and Schliemann I'm kindly asking both Mila (mmetelka) and Hanz (jjancura) for their review. I'm also asking QA to re-test the patch in release60 branch and verify that the issue is really fixed. When this is done I'll send a request for approval to reviewers@netbeans.org. Thanks a lot.
I approve the fix.
I would prefer replacing assert by some if, but I approve fix anyway.
I cannot approve this fix. Preview is displayed, but following exception is thrown upon moiuse-click inside preview.. java.util.ConcurrentModificationException at java.util.AbstractList$Itr.checkForComodification(AbstractList.java:449) at java.util.AbstractList$Itr.next(AbstractList.java:420) at org.netbeans.modules.languages.features.SemanticHighlightsLayer.update(SemanticHighlightsLayer.java:96) at org.netbeans.modules.languages.features.UsagesASTEvaluator.afterEvaluation(UsagesASTEvaluator.java:150) at org.netbeans.modules.languages.ParserManagerImpl.fire2(ParserManagerImpl.java:258) at org.netbeans.modules.languages.ParserManagerImpl.access$200(ParserManagerImpl.java:84) at org.netbeans.modules.languages.ParserManagerImpl$2.run(ParserManagerImpl.java:207) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:561) [catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:986)
Umm, that's wierd, I can't reproduce the exception. What exactly did you do? I tried in pretty much all the languages in Tools-Options and both choosing a category from the list and clicking in a preview example. All worked fine without any exception.
Hmm, I cannot reproduce it anymore. I'll file a new P3 RANDOM issue against languages.
Created attachment 52865 [details] Updated patch according to jjancura's suggestion
Ok, using 'if' is probably safer, I changed the patch and replaced the 'assert' with 'if'. Could you please have another look? Thanks
Great! Thanks!
Fix OK from QA point of view, thanks. --- Product Version: NetBeans IDE 6.0 RC1 (Build 071110) Java: 1.5.0_14; Java HotSpot(TM) Client VM 1.5.0_14-b03 System: Linux version 2.6.20-16-generic running on i386; UTF-8; en_US (nb) Userdir: /tmp/t2
Integrated to release60. Checking in languages/engine/src/org/netbeans/modules/languages/ParserManagerImpl.java; /cvs/languages/engine/src/org/netbeans/modules/languages/ParserManagerImpl.java,v <-- ParserManagerImpl.java new revision: 1.51.2.1; previous revision: 1.51 done Checking in languages/engine/src/org/netbeans/modules/languages/LanguagesManager.java; /cvs/languages/engine/src/org/netbeans/modules/languages/LanguagesManager.java,v <-- LanguagesManager.java new revision: 1.35.2.1; previous revision: 1.35 done Checking in lexer/src/org/netbeans/lib/lexer/LanguageManager.java; /cvs/lexer/src/org/netbeans/lib/lexer/LanguageManager.java,v <-- LanguageManager.java new revision: 1.14.2.1; previous revision: 1.14 done
verified in RC1 Product Version: NetBeans IDE 6.0 RC1 (Build 200711130000) Java: 1.6.0_05-ea; Java HotSpot(TM) Client VM 1.6.0_05-ea-b06 System: Linux version 2.6.5-1.358 running on i386; UTF-8; en_US (nb)
Hi msauer, > Hmm, I cannot reproduce it anymore. I'll file a new P3 RANDOM issue against languages. Have you already filed this issue? I got the same error report from Japanese community member. So I want to know which bug id if you already filed. Please let me know.
I filed new issue of bug 124176 for java.util.ConcurrentModificationException.