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.
When typing javadoc commnents for a method, the '@' tags become sometimes improperly highlighted, the number of characters emphasized by blue changes along with the code I type in the line above the tag. See attached screenshot. This issue is random, but happens to me often. Typical steps to reproduce: --------------------------- 1) Have a java class, define a non-void method, w/o javadoc 2) Invoke Javadoc hint, to supply javadoc skeleton => javadoc with '@return' is created 3) On the line above '@return', type some text 4) '@return' becomes highlighted with grey color, along with the typed comment --- NetBeans IDE Dev (Build 070328) 1.6.0_01; Java HotSpot(TM) Server VM 1.6.0_01-b04 Linux version 2.6.12-1.1390_FC4smp running on i386 en_US (nb); UTF-8
Created attachment 40081 [details] propoesed screenshot
Reproducible. I am not sure what is wrong, it's probably related to the latest changes in lexer (incremental lexing of embedded tokens), but the problem clould be in the coloring layer itself. I'll investigate it.
I've done some investigation and it looks like the problem is either in the lexer infrastructure or in JavadocLexer. Here is what I've done: 1. First, I changed the SyntaxHighlighting to *always* fire changes for the whole document ignoring the text change ranges reported by lexer. This had no effect. 2. Then I dumped the whole TokenSequence after each change, which revealed that some of the javadoc tokens are not parsed correctly. It might be a problem in the lexer infrastructure, because when the document is fully relexed it all works fine. It's only when the incremental lexing is done for javadoc text that some of the tokens are not lexed properly and (that's the most suspicios thing) some of the characters are listed in more than just one token. I'm attaching the TokenSequence dumps and the java source file I used for testing. The dump file contains four snapshots of tokens in the hierarchy. The first one was taken right after opening the file and then the three others after typing ' dd' right at the beginning of the second javadoc comment in the java source file (typed right after '/**'). Milo could you please try reproducing the problem and possibly explain what is going on? Thanks a lot.
Created attachment 40287 [details] Snapshots of the TokenHierarchy
Created attachment 40288 [details] Java source used for testing
The token sequence dumping can be turned on in trunk by: -Dtryme.args="-J-Dorg.netbeans.modules.editor.lib2.highlighting.SyntaxHighlighting.level=300"
Created attachment 40291 [details] This occasionally happens when editing javadoc
*** Issue 99765 has been marked as a duplicate of this issue. ***
*** Issue 99778 has been marked as a duplicate of this issue. ***
*** Issue 100487 has been marked as a duplicate of this issue. ***
The problem should now be fixed. I wasn't able to reproduce a problematic javadoc case but if you still find any incorrect embedded highlighting please reopen the issue. Checking in token/AbstractToken.java; /cvs/lexer/src/org/netbeans/lib/lexer/token/AbstractToken.java,v <-- AbstractToken.java new revision: 1.7; previous revision: 1.6 done Checking in LexerUtilsConstants.java; /cvs/lexer/src/org/netbeans/lib/lexer/LexerUtilsConstants.java,v <-- LexerUtilsConstants.java new revision: 1.11; previous revision: 1.10 done Checking in TokenHierarchyOperation.java; /cvs/lexer/src/org/netbeans/lib/lexer/TokenHierarchyOperation.java,v <-- TokenHierarchyOperation.java new revision: 1.11; previous revision: 1.10 done Checking in EmbeddedTokenList.java; /cvs/lexer/src/org/netbeans/lib/lexer/EmbeddedTokenList.java,v <-- EmbeddedTokenList.java new revision: 1.7; previous revision: 1.6 done Checking in inc/TokenListChange.java; /cvs/lexer/src/org/netbeans/lib/lexer/inc/TokenListChange.java,v <-- TokenListChange.java new revision: 1.8; previous revision: 1.7
*** Issue 99332 has been marked as a duplicate of this issue. ***
I checked the javadoc and it's looking good now. Thanks Mila.
*** Issue 100222 has been marked as a duplicate of this issue. ***
I'm not able to reproduce anymore. Marking as VERIFIED. --- NetBeans IDE Dev (Build 200704111800) 1.6.0; Java HotSpot(TM) Client VM 1.6.0-b105 SunOS version 5.10 running on sparc en (nb); ISO646-US
*** Issue 101029 has been marked as a duplicate of this issue. ***