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 85809 - Bizarre completion of 'for' followed by exception and broken caret
Summary: Bizarre completion of 'for' followed by exception and broken caret
Status: RESOLVED WORKSFORME
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks: 87136
  Show dependency tree
 
Reported: 2006-09-26 17:58 UTC by Petr Hrebejk
Modified: 2007-01-17 10:09 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Hrebejk 2006-09-26 17:58:32 UTC
nvoked code completion for 'for' and got mangled code, then an exception. After
the exception below the caret was broken again - could type into the document
but the blinking caret did not move and the document never became saveable - may
be a clue about what causes that.

After this, any invocation of actions that would modify the document caused the
exception below. I'm guessing some thread leaves the document permanently locked?

public void addNotify() {
if (fld == null) {
List kids = sfld.getChildren();
Collections.sort (kids, this);
setKeys (kids);
} else {
if (sfld.isEmpty()) {
List keys = new ArrayList (Arrays.asList(fld.getChildren()));
List kids = new ArrayList (keys.size());
for (Iterator it = kids.iterator(); it.hasNext();) {
Object object = it.next();

}for (Iterator it = kids.iterator(); it.hasNext();) {
Object object = it.next();

}for (Iterator it = kids.iterator(); it.hasNext();) {
Object object = it.next();

}for (Iterator it = kids.iterator(); it.hasNext();) {
Object object = it.next();

}
Collections.sort (keys);
setKeys (keys);
} else {
List a = Arrays.asList (fld.getChildren());
List b = sfld.getChildren();
Set combined = new HashSet (a.size() + b.size());
combined.addAll (a);
combined.addAll (b);
List keys = new ArrayList (combined);
Collections.sort (keys, this);
setKeys (keys);
}
}

}

followed by

java.lang.AssertionError: JavaSource.runCompileControlTask called under Document
write lock.
at org.netbeans.api.java.source.JavaSource.runUserActionTask(JavaSource.java:292)
at org.netbeans.api.java.source.JavaSource.getCompilationInfo(JavaSource.java:909)
at org.netbeans.api.java.source.WorkingCopy.(WorkingCopy.java:55)
at org.netbeans.api.java.source.JavaSource.getWorkingCopy(JavaSource.java:431)
at
org.netbeans.modules.editor.java.JavaCodeTemplateProcessor.release(JavaCodeTemplateProcessor.java:111)
at
org.netbeans.lib.editor.codetemplates.CodeTemplateInsertHandler.release(CodeTemplateInsertHandler.java:622)
at
org.netbeans.lib.editor.codetemplates.CodeTemplateInsertHandler.keyPressed(CodeTemplateInsertHandler.java:482)
at java.awt.AWTEventMulticaster.keyPressed(AWTEventMulticaster.java:192)
at java.awt.Component.processKeyEvent(Component.java:5928)
at javax.swing.JComponent.processKeyEvent(JComponent.java:2818)
at java.awt.Component.processEvent(Component.java:5747)
at java.awt.Container.processEvent(Container.java:1984)
at java.awt.Component.dispatchEventImpl(Component.java:4378)
at java.awt.Container.dispatchEventImpl(Container.java:2042)
at java.awt.Component.dispatchEvent(Component.java:4208)
at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1828)
at
java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:693)
at
java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:952)
at
java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:824)
at
java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:657)
at java.awt.Component.dispatchEventImpl(Component.java:4250)
at java.awt.Container.dispatchEventImpl(Container.java:2042)
at java.awt.Window.dispatchEventImpl(Window.java:2299)
at java.awt.Component.dispatchEvent(Component.java:4208)
[catch] at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
Comment 1 Jiri Prox 2006-10-09 16:48:54 UTC
cannot reproduce, feel free to reopen if it happens again