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 270298 - IllegalStateException: INCONSISTENCY in token hierarchy occurred
Summary: IllegalStateException: INCONSISTENCY in token hierarchy occurred
Status: RESOLVED DUPLICATE of bug 269731
Alias: None
Product: cnd
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.2
Hardware: All All
: P3 normal (vote)
Assignee: Vladimir Voskresensky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-04 16:46 UTC by Vladimir Voskresensky
Modified: 2017-04-05 20:34 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter: 228669


Attachments
stacktrace (4.31 KB, text/plain)
2017-04-04 16:46 UTC, Vladimir Voskresensky
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Voskresensky 2017-04-04 16:46:28 UTC
Build: NetBeans IDE 8.2 (Build 20170403-27016069f105)
VM: Java HotSpot(TM) 64-Bit Server VM, 25.112-b15, Java(TM) SE Runtime Environment, 1.8.0_112-b15
OS: SunOS

User Comments:
vv159170: # 1 // asdf \| pressed Enter




Stacktrace: 
java.lang.IllegalStateException: INCONSISTENCY in token hierarchy occurred
   at org.netbeans.lib.lexer.inc.TokenHierarchyUpdate.update(TokenHierarchyUpdate.java:148)
   at org.netbeans.lib.lexer.TokenHierarchyOperation.textModified(TokenHierarchyOperation.java:605)
   at org.netbeans.spi.lexer.TokenHierarchyControl.textModified(TokenHierarchyControl.java:96)
   at org.netbeans.lib.lexer.inc.DocumentInput.textModified(DocumentInput.java:152)
   at org.netbeans.lib.lexer.inc.DocumentInput.removeUpdate(DocumentInput.java:145)
   at org.netbeans.lib.editor.util.swing.PriorityDocumentListenerList.removeUpdate(PriorityDocumentListenerList.java:116)
Comment 1 Vladimir Voskresensky 2017-04-04 16:46:29 UTC
Created attachment 164027 [details]
stacktrace
Comment 2 Miloslav Metelka 2017-04-05 08:23:59 UTC
Reproduced. Unfortunately there was one glitch that I've fixed yesterday (should be in today's trunk) in terms of issue #267354 - if there was e.g. an AssertionError in the document's modification processing (e.g. in a lexer's processing) then BaseDocument.breakAtomicLock() was called (to undo document modifications done so far within atomic transaction) and if this failed with an exception (it would likely fail since token hierarchy updating did not finish so the token hierarachy would be inconsistent) then the thrown exception has hidden the original AssertionError exception.
It was a bit tricky to discover that but it should be fixed in today's trunk and it should hopefully reveal the real problem in issue #267354.
I've reproduced your scenario and there's an AssertionError in CndLexer - if you could check that.

<<<<<<<<<<<<<<<<<< LEXER CHANGE START ------------------
TEXT INSERTED at 12 len=1 "\\"
java.lang.AssertionError: there must be \
org.netbeans.modules.cnd.lexer.CndLexer.nextToken(CndLexer.java:141)
org.netbeans.lib.lexer.LexerInputOperation.nextToken(LexerInputOperation.java:216)
org.netbeans.lib.lexer.inc.TokenListUpdater.relex(TokenListUpdater.java:627)
Comment 3 Vladimir Voskresensky 2017-04-05 11:33:44 UTC
(In reply to Miloslav Metelka from comment #2)
> Reproduced. Unfortunately there was one glitch that I've fixed yesterday
> (should be in today's trunk) in terms of issue #267354 - if there was e.g.
> an AssertionError in the document's modification processing (e.g. in a
> lexer's processing) then BaseDocument.breakAtomicLock() was called (to undo
> document modifications done so far within atomic transaction) and if this
> failed with an exception (it would likely fail since token hierarchy
> updating did not finish so the token hierarachy would be inconsistent) then
> the thrown exception has hidden the original AssertionError exception.
> It was a bit tricky to discover that but it should be fixed in today's trunk
> and it should hopefully reveal the real problem in issue #267354.
> I've reproduced your scenario and there's an AssertionError in CndLexer - if
> you could check that.
> 
> <<<<<<<<<<<<<<<<<< LEXER CHANGE START ------------------
> TEXT INSERTED at 12 len=1 "\\"
> java.lang.AssertionError: there must be \
> org.netbeans.modules.cnd.lexer.CndLexer.nextToken(CndLexer.java:141)
> org.netbeans.lib.lexer.LexerInputOperation.nextToken(LexerInputOperation.
> java:216)
> org.netbeans.lib.lexer.inc.TokenListUpdater.relex(TokenListUpdater.java:627)
Thanks, Mila,
This is how I got here myself: by working on https://netbeans.org/bugzilla/show_bug.cgi?id=269731 (AssertionError: there must be \)
So, I think, I can close this as duplicate of 269731, right?
Nothing bad in netbeans Lexer module, right?
Comment 4 Vladimir Voskresensky 2017-04-05 15:03:53 UTC

*** This bug has been marked as a duplicate of bug 269731 ***