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 239206

Summary: javax.swing.text.BadLocationException: Modification not allowed
Product: editor Reporter: Petr Cyhelsky <cyhelsky>
Component: -- Other --Assignee: Milutin Kristofic <mkristofic>
Status: NEW ---    
Severity: normal CC: GastonMF, mahmuddinnf, ovrabec, Sunil.Ghorpade, terje7601
Priority: P3    
Version: 8.0   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter: 203621
Attachments: stacktrace

Description Petr Cyhelsky 2013-12-06 15:57:53 UTC
Build: NetBeans IDE Dev (Build 201312030002)
VM: Java HotSpot(TM) 64-Bit Server VM, 24.45-b08, Java(TM) SE Runtime Environment, 1.7.0_45-b33
OS: Linux

User Comments:
cyhelsky: reverting change in file

GUEST: clicking on netbeans from another app




Stacktrace: 
javax.swing.text.BadLocationException: Modification not allowed
   at org.openide.text.CloneableEditorSupport$DocFilter.modificationNotAllowed(CloneableEditorSupport.java:2385)
   at org.openide.text.CloneableEditorSupport$DocFilter.checkModificationAllowed(CloneableEditorSupport.java:2379)
   at org.openide.text.CloneableEditorSupport$DocFilter.replace(CloneableEditorSupport.java:2355)
   at org.netbeans.editor.BaseDocument.replace(BaseDocument.java:1042)
   at org.netbeans.modules.versioning.ui.diff.DiffSidebar.onRollback(DiffSidebar.java:338)
   at org.netbeans.modules.versioning.ui.diff.DiffTooltipActionsPanel.actionPerformed(DiffTooltipActionsPanel.java:136)
Comment 1 Petr Cyhelsky 2013-12-06 15:57:54 UTC
Created attachment 142918 [details]
stacktrace
Comment 2 Ondrej Vrabec 2014-01-06 09:53:57 UTC
Reassigning back. Looking at org.netbeans.editor.BaseDocument.replace(BaseDocument.java:1042), at this point it is already after a call to "checkModifiable(offset);" so it looks as if BaseDocument allows editing but further org.openide.text.CloneableEditorSupport$DocFilter disallows it. Lack of inconsistency? Or please advise on what should be the correct way to determine if a document is editable: http://hg.netbeans.org/core-main/file/4005d84fa44d/versioning.ui/src/org/netbeans/modules/versioning/ui/diff/DiffSidebar.java#l373
Comment 3 Exceptions Reporter 2014-10-06 15:53:48 UTC
This bug already has 5 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=203621