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 240201

Summary: BadLocationException thrown in a read-only Java source
Product: editor Reporter: Jiri Sedlacek <jis>
Component: -- Other --Assignee: Milutin Kristofic <mkristofic>
Status: RESOLVED FIXED    
Severity: normal CC: akobberup
Priority: P2    
Version: 8.0   
Hardware: PC   
OS: Windows 7   
Issue Type: DEFECT Exception Reporter:

Description Jiri Sedlacek 2014-01-10 10:36:38 UTC
Product Version: NetBeans IDE Dev (Build 20140109-7f792743fbef)
Java: 1.7.0_45; Java HotSpot(TM) 64-Bit Server VM 24.45-b08
Runtime: Java(TM) SE Runtime Environment 1.7.0_45-b18
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)


Steps:

  1/ Open source for java.lang.Object
  2/ Press Tab key in the editor


javax.swing.text.BadLocationException: Modification not allowed
	at org.openide.text.CloneableEditorSupport$DocFilter.modificationNotAllowed(CloneableEditorSupport.java:2394)
	at org.openide.text.CloneableEditorSupport$DocFilter.checkModificationAllowed(CloneableEditorSupport.java:2388)
	at org.openide.text.CloneableEditorSupport$DocFilter.remove(CloneableEditorSupport.java:2344)
	at org.netbeans.editor.BaseDocument.remove(BaseDocument.java:937)
	at org.netbeans.editor.BaseKit$2.run(BaseKit.java:3313)
	at org.netbeans.editor.GuardedDocument.runAtomic(GuardedDocument.java:321)
	at org.netbeans.editor.BaseKit.insertTabString(BaseKit.java:3289)
[catch] at org.netbeans.editor.BaseKit$InsertTabAction$1.run(BaseKit.java:1592)
	at org.netbeans.editor.GuardedDocument.runAtomicAsUser(GuardedDocument.java:351)
	at org.netbeans.editor.BaseKit$InsertTabAction.actionPerformed(BaseKit.java:1542)
	at org.netbeans.editor.BaseAction.actionPerformed(BaseAction.java:339)
	at javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1664)
	at javax.swing.JComponent.processKeyBinding(JComponent.java:2878)
	at javax.swing.JComponent.processKeyBindings(JComponent.java:2925)
	at javax.swing.JComponent.processKeyEvent(JComponent.java:2841)
	...
Comment 1 Milutin Kristofic 2014-01-10 14:03:28 UTC
After this changeset is applied to dev build, editor will make just sound to inform it cannot write tab, as it does when you try insert or delete characters in guarded document. 

http://hg.netbeans.org/jet-main/rev/4aebee12020e
Comment 2 Quality Engineering 2014-01-13 02:15:56 UTC
Integrated into 'main-silver', will be available in build *201401130002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/4aebee12020e
User: Milutin Kristofic <mkristofic@netbeans.org>
Log: #240201 - BadLocationException thrown in a read-only Java source
Comment 3 Milutin Kristofic 2014-01-14 15:23:32 UTC
*** Bug 237298 has been marked as a duplicate of this bug. ***