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 101159 - IllegalStateException: finish() already called at .HTMLCompletionQuery$HTMLResultItem.replaceText():552
Summary: IllegalStateException: finish() already called at .HTMLCompletionQuery$HTMLRe...
Status: RESOLVED FIXED
Alias: None
Product: obsolete
Classification: Unclassified
Component: languages (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jan Jancura
URL:
Keywords: RANDOM
Depends on:
Blocks:
 
Reported: 2007-04-16 15:00 UTC by Martin Schovanek
Modified: 2007-04-18 08:59 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
IllegalStateException (2.94 KB, text/plain)
2007-04-16 15:00 UTC, Martin Schovanek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Schovanek 2007-04-16 15:00:18 UTC
[#200704151800, jdk1.5.0]

to reproduce:
-------------
1) type in a .html file
<html> |
2) invoke CC, press [Back], invoke CC again
ERROR: IDE throws:
Comment 1 Martin Schovanek 2007-04-16 15:00:55 UTC
Created attachment 40968 [details]
IllegalStateException
Comment 2 Marek Fukala 2007-04-17 15:32:02 UTC
This looks like Schliemann's problem with late ParserManagerListener remove. 

CompletionProviderImpl:219:
...
parserManager.addListener (new ParserManagerListener () {
   public void parsed (State state, ASTNode ast) {
      //S ystem.out.println("CodeCompletion: parsed " + state);
      addParserTags (ast, resultSet);
      resultSet.finish ();
      parserManager.removeListener (this);
   }
});
...

It looks like after first CC invocation the ParserManagerListener is added, then
after the parser finishes, the parsed() method is called, but during
addParserTags() processing the document changes again since the parserManager
listener hasn't been removed yet the code is called twice and causes the
resultSet.finish() to throw te ISE.
...
parserManager.addListener (new ParserManagerListener () {
   public void parsed (State state, ASTNode ast) {
      parserManager.removeListener (this);
      addParserTags (ast, resultSet);
      resultSet.finish ();
   }
});

should fix that
Comment 3 Jan Jancura 2007-04-18 08:59:26 UTC
fixed in trunk:
IDE:-------------------------------------------------
IDE: [4/18/07 9:58 AM] Committing "CompletionProviderImpl.java" started
Checking in CompletionProviderImpl.java;
/cvs/languages/engine/src/org/netbeans/modules/languages/features/CompletionProviderImpl.java,v
 <--  CompletionProviderImpl.java
new revision: 1.15; previous revision: 1.14
done
IDE: [4/18/07 9:58 AM] Committing "CompletionProviderImpl.java" finished