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 121554 - it's not possible to change coloring options for CSS, Javascript, bat File
Summary: it's not possible to change coloring options for CSS, Javascript, bat File
Status: VERIFIED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Options (show other bugs)
Version: 6.x
Hardware: Sun All
: P1 blocker (vote)
Assignee: Vitezslav Stejskal
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-11-09 10:57 UTC by Jindrich Sedek
Modified: 2007-12-18 04:22 UTC (History)
7 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
messages.log (783.65 KB, text/plain)
2007-11-09 10:57 UTC, Jindrich Sedek
Details
The patch for release60 branch (3.62 KB, text/plain)
2007-11-11 13:21 UTC, Vitezslav Stejskal
Details
Updated patch according to jjancura's suggestion (3.55 KB, text/plain)
2007-11-12 09:42 UTC, Vitezslav Stejskal
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jindrich Sedek 2007-11-09 10:57:01 UTC
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
Comment 1 Jindrich Sedek 2007-11-09 10:57:33 UTC
Created attachment 52785 [details]
messages.log
Comment 2 Miloslav Metelka 2007-11-09 15:21:12 UTC
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.
Comment 3 Miloslav Metelka 2007-11-09 15:31:55 UTC
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 :(
Comment 4 Miloslav Metelka 2007-11-09 15:47:13 UTC
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?
Comment 5 Vitezslav Stejskal 2007-11-10 09:11:43 UTC
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.
Comment 6 Vitezslav Stejskal 2007-11-11 13:21:39 UTC
Created attachment 52847 [details]
The patch for release60 branch
Comment 7 Vitezslav Stejskal 2007-11-11 13:31:32 UTC
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.
Comment 8 Miloslav Metelka 2007-11-12 09:06:20 UTC
I approve the fix.
Comment 9 Jan Jancura 2007-11-12 09:22:47 UTC
I would prefer replacing assert by some if, but I approve fix anyway.
Comment 10 Max Sauer 2007-11-12 09:23:09 UTC
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)
Comment 11 Vitezslav Stejskal 2007-11-12 09:30:20 UTC
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.
Comment 12 Max Sauer 2007-11-12 09:40:27 UTC
Hmm, I cannot reproduce it anymore. I'll file a new P3 RANDOM issue against languages.
Comment 13 Vitezslav Stejskal 2007-11-12 09:42:39 UTC
Created attachment 52865 [details]
Updated patch according to jjancura's suggestion
Comment 14 Vitezslav Stejskal 2007-11-12 09:44:58 UTC
Ok, using 'if' is probably safer, I changed the patch and replaced the 'assert' with 'if'. Could you please have another
look? Thanks
Comment 15 Jan Jancura 2007-11-12 09:55:22 UTC
Great! Thanks!
Comment 16 Max Sauer 2007-11-12 10:51:09 UTC
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
Comment 17 Vitezslav Stejskal 2007-11-12 15:00:44 UTC
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
Comment 18 Jiri Prox 2007-11-13 12:23:02 UTC
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)
Comment 19 Masaki Katakai 2007-12-10 04:33:15 UTC
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.
Comment 20 Masaki Katakai 2007-12-18 04:22:53 UTC
I filed new issue of bug 124176 for java.util.ConcurrentModificationException.