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.
Summary: | AssertionError: Document was locked before starting the MDR transaction. | ||
---|---|---|---|
Product: | platform | Reporter: | cezariusz <cezariusz> |
Component: | Text | Assignee: | Jaroslav Tulach <jtulach> |
Status: | CLOSED FIXED | ||
Severity: | blocker | CC: | apireviews, mgrebac, pfiala |
Priority: | P1 | Keywords: | API_REVIEW_FAST, T9Y |
Version: | 4.x | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: |
messages.log
Proposed changes to fix the problem Exception said to happen after applying the previous patch Added fix for runAtomic & saveDocument Another stacktrace of firing events under a document lock leading to this AssertionError. New stack trace - created several beans, tried second rename on local interface of session bean |
Description
cezariusz
2004-11-26 15:04:28 UTC
Created attachment 19055 [details]
messages.log
Honzo, please evaluate. Thanks. According to the attached stacktrace EditorSupport.EntryEnv.removeSaveCookie manipulates cookies of data object still under a document lock which is wrong IMO. Reassigning to openide/editor ... I'll handle this together with issue 52493 Adding Document.putProperty contract between openide/text and NetBeans aware editors. Mila, I will need you to implement this in your editor. Created attachment 19530 [details]
Proposed changes to fix the problem
Yardo, I've found a problem which I did not realize when we've talked about solution for this issue. If the document is first locked with atomic-lock and then the actual modifications are made i.e. atomic-lock-start insert/remove ... atomic-lock-end then we will still get the assertion because at the time when I notify the beforeModificationListener the document will already be locked :( So actually I would have to notify the listener before the atomic-lock-start will take effect as well (possibly with different property e.g. "locked"). However I don't know what should be done in such case on the listener side. IMHO we should not actually call notifyModified() as the document was in fact not modified yet and it could just happen: atomic-lock-start atomic-lock-end without any modification. Or we would have to call notifyModified() and call notifyUnmodified() after atomic-lock-end. But this is IMHO sort of ugly. Do you have any ideas regarding this? The only possible fix I can imagine is to call notifyModified and then notifyUnmodified. Otherwise there is no way to make the call to notifyModified outside of document's lock, I am affraid. I nobody objects, we will implement the fix this way. OK, I agree. *** Issue 54222 has been marked as a duplicate of this issue. *** Created attachment 20329 [details]
Exception said to happen after applying the previous patch
Created attachment 20332 [details]
Added fix for runAtomic & saveDocument
Mila, now you should: 1. review my patch 2. make changes in your document to emulate the behaviour of NbLikeEditorKit 3. reuse the test NotifyModifiedOnNbEditorLikeKitTest in editor so we know that behaviour of your editor is correct. After that we can integrate. I'll stop by to help with #3. *** Issue 54739 has been marked as a duplicate of this issue. *** I'm working on the fix since tomorrow. I hope to have it ready today COB. Since yesterday, sorry ;) The bug I closed as a duplicate was P2. This is very visible and annoying exception while working with WS. Unfortunately further complications appeared that prevent us from integration of the fix. I need to enhance the openide's tests to do runAtomic() during UndoManager.canUndo() because in that case the notifyModified() will be followed by notifyUnmodified() as there are no actual modifications during the runAtomic() section. I'll start a branch and cooperate with Yarda on the final fix. Unfortunately I'm currently unable to say whether we will be able to integrate the fix into Beta1 but hopefully yes. Starting the branch assert_51872 on openide and editor based on tag assert_51872_050221. The branch should now be satisfying the requirements. The tests are passing so I'm going to commit the branch into the main trunk: Checking in editor/libsrc/org/netbeans/editor/BaseDocument.java; /cvs/editor/libsrc/org/netbeans/editor/BaseDocument.java,v <-- BaseDocument.java new revision: 1.111; previous revision: 1.110 done Processing log script arguments... More commits to come... Checking in editor/nbproject/project.properties; /cvs/editor/nbproject/project.properties,v <-- project.properties new revision: 1.6; previous revision: 1.5 done Processing log script arguments... More commits to come... Checking in editor/test/build-unit.xml; /cvs/editor/test/build-unit.xml,v <-- build-unit.xml new revision: 1.10; previous revision: 1.9 done Checking in editor/test/cfg-unit.xml; /cvs/editor/test/cfg-unit.xml,v <-- cfg-unit.xml new revision: 1.7; previous revision: 1.6 done Processing log script arguments... More commits to come... Checking in editor/test/unit/src/org/netbeans/modules/editor/openide/InheritedNotifyModifiedTest.java; /cvs/editor/test/unit/src/org/netbeans/modules/editor/openide/InheritedNotifyModifiedTest.java,v <-- InheritedNotifyModifiedTest.java new revision: 1.2; previous revision: 1.1 done Checking in editor/test/unit/src/org/netbeans/modules/editor/openide/InheritedUndoRedoTest.java; /cvs/editor/test/unit/src/org/netbeans/modules/editor/openide/InheritedUndoRedoTest.java,v <-- InheritedUndoRedoTest.java new revision: 1.2; previous revision: 1.1 done cvs diff: InheritedNotifyModifiedTest.java is a new entry, no comparison available cvs diff: InheritedUndoRedoTest.java is a new entry, no comparison available Processing log script arguments... More commits to come... Checking in openide/arch/arch-openide-editor.xml; /cvs/openide/arch/arch-openide-editor.xml,v <-- arch-openide-editor.xml new revision: 1.19; previous revision: 1.18 done Processing log script arguments... More commits to come... Checking in openide/src/org/openide/text/CloneableEditorSupport.java; /cvs/openide/src/org/openide/text/CloneableEditorSupport.java,v <-- CloneableEditorSupport.java new revision: 1.142; previous revision: 1.141 done Processing log script arguments... More commits to come... Checking in openide/test/unit/src/org/openide/text/NbLikeEditorKit.java; /cvs/openide/test/unit/src/org/openide/text/NbLikeEditorKit.java,v <-- NbLikeEditorKit.java new revision: 1.2; previous revision: 1.1 done Checking in openide/test/unit/src/org/openide/text/NotifyModifiedOnNbEditorLikeKitTest.java; /cvs/openide/test/unit/src/org/openide/text/NotifyModifiedOnNbEditorLikeKitTest.java,v <-- NotifyModifiedOnNbEditorLikeKitTest.java new revision: 1.2; previous revision: 1.1 done Checking in openide/test/unit/src/org/openide/text/NotifyModifiedTest.java; /cvs/openide/test/unit/src/org/openide/text/NotifyModifiedTest.java,v <-- NotifyModifiedTest.java new revision: 1.2; previous revision: 1.1 done Checking in openide/test/unit/src/org/openide/text/UndoRedoCooperationTest.java; /cvs/openide/test/unit/src/org/openide/text/UndoRedoCooperationTest.java,v <-- UndoRedoCooperationTest.java new revision: 1.6; previous revision: 1.5 done cvs diff: NotifyModifiedOnNbEditorLikeKitTest.java is a new entry, no comparison available Processing log script arguments... Unfortunately this seems to cause regressions: issue 55848 and probably issue 55818 as well. Yardo, I will probably roll back the change until we verify that it's not causing any regressions. I've rolled back this integration. We will continue to work and test in assert_51872 branch. *** Issue 54587 has been marked as a duplicate of this issue. *** Created attachment 20674 [details]
Another stacktrace of firing events under a document lock leading to this AssertionError.
Reassigning to Yarda. Well, after rollback of the patch, I'm still getting sometimes symptoms of 54587 - e.g. after second or third refactoring rename on Session bean local interface I get the 'document modified externally' message. So I'm not sure if it's just a plain duplicate. Anyway, this is pretty visible and annoying behaviour, mainly in j2ee part of the IDE. There's no workaround so that you don't see this every other time trying to do something. It's also blocking our work on tests (j2ee/refactoring e.g.) as they fail always but on random places. Please consider this as a priority. Thanks. Created attachment 20687 [details]
New stack trace - created several beans, tried second rename on local interface of session bean
> Unfortunately this seems to cause regressions:
> issue 55848 and
> probably issue 55818 as well.
I managed to simulate issue 55818 without changes made as part of this issue.
That is why I believe it is independent and not caused by fix of this issue.
> Unfortunately this seems to cause regressions:
> issue 55848 and
> probably issue 55818 as well.
I managed to simulate issue 55818 without changes made as part of this issue.
That is why I believe it is independent and not caused by fix of this issue.
*** Issue 56181 has been marked as a duplicate of this issue. *** New version is in the branch and it does not seem to suffer from the problem described in issue 55848 *** Issue 56366 has been marked as a duplicate of this issue. *** "#51872: documentListener property to talk between org.openide.text and NetBeans editor" Checking in openide/arch/arch-openide-editor.xml; /cvs/openide/arch/arch-openide-editor.xml,v <-- arch-openide-editor.xml new revision: 1.21; previous revision: 1.20 done Checking in openide/src/org/openide/text/CloneableEditorSupport.java; /cvs/openide/src/org/openide/text/CloneableEditorSupport.java,v <-- CloneableEditorSupport.java new revision: 1.145; previous revision: 1.144 done Checking in openide/test/unit/src/org/openide/text/NbLikeEditorKit.java; /cvs/openide/test/unit/src/org/openide/text/NbLikeEditorKit.java,v <-- NbLikeEditorKit.java new revision: 1.4; previous revision: 1.3 done Checking in openide/test/unit/src/org/openide/text/NotifyModifiedOnNbEditorLikeKitTest.java; /cvs/openide/test/unit/src/org/openide/text/NotifyModifiedOnNbEditorLikeKitTest.java,v <-- NotifyModifiedOnNbEditorLikeKitTest.java new revision: 1.4; previous revision: 1.3 done Checking in openide/test/unit/src/org/openide/text/NotifyModifiedTest.java; /cvs/openide/test/unit/src/org/openide/text/NotifyModifiedTest.java,v <-- NotifyModifiedTest.java new revision: 1.4; previous revision: 1.3 done Checking in openide/test/unit/src/org/openide/text/UndoRedoCooperationTest.java; /cvs/openide/test/unit/src/org/openide/text/UndoRedoCooperationTest.java,v <-- UndoRedoCooperationTest.java new revision: 1.8; previous revision: 1.7 done Checking in editor/libsrc/org/netbeans/editor/BaseDocument.java; /cvs/editor/libsrc/org/netbeans/editor/BaseDocument.java,v <-- BaseDocument.java new revision: 1.115; previous revision: 1.114 done Checking in editor/nbproject/project.properties; /cvs/editor/nbproject/project.properties,v <-- project.properties new revision: 1.9; previous revision: 1.8 done Checking in editor/test/build-unit.xml; /cvs/editor/test/build-unit.xml,v <-- build-unit.xml new revision: 1.12; previous revision: 1.11 done Checking in editor/test/cfg-unit.xml; /cvs/editor/test/cfg-unit.xml,v <-- cfg-unit.xml new revision: 1.11; previous revision: 1.10 done Checking in editor/test/unit/src/org/netbeans/modules/editor/openide/InheritedNotifyModifiedTest.java; /cvs/editor/test/unit/src/org/netbeans/modules/editor/openide/InheritedNotifyModifiedTest.java,v <-- InheritedNotifyModifiedTest.java new revision: 1.4; previous revision: 1.3 done Checking in editor/test/unit/src/org/netbeans/modules/editor/openide/InheritedUndoRedoTest.java; /cvs/editor/test/unit/src/org/netbeans/modules/editor/openide/InheritedUndoRedoTest.java,v <-- InheritedUndoRedoTest.java new revision: 1.4; previous revision: 1.3 Ver. 200504101930. |