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 208553 - [regression] checked in file is imediately checked out by IDE
Summary: [regression] checked in file is imediately checked out by IDE
Status: VERIFIED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 7.1
Hardware: All All
: P1 normal (vote)
Assignee: Miloslav Metelka
URL:
Keywords: REGRESSION
: 206858 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-02-17 11:00 UTC by Vladimir Voskresensky
Modified: 2012-04-06 17:33 UTC (History)
5 users (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 Vladimir Voskresensky 2012-02-17 11:00:51 UTC
ClearCase 7.1 users complains
-------
Hi

The netbeans 7.1, I've noticed that when I do a clearase checkin outside of netbeans then quite often netbeans will re-checkout the file. This is quite annoying, as I usually don't want files that I've just checked in to be checked out, and I have to go and manually diff and uncheckout the files.

Any suggestions as to what I could do?

A+
Paul

-------
Comment 1 Vladimir Voskresensky 2012-02-17 11:01:49 UTC
I have tried the same in trunk in ADE and immediately after checkin I see

INFO [org.netbeans.modules.ade]: Checkout called
java.lang.Exception
	at org.netbeans.modules.ade.client.CheckoutCommand.<init>(CheckoutCommand.java:50)
	at org.netbeans.modules.ade.util.ADEUtils.ensureMutable(ADEUtils.java:440)
	at org.netbeans.modules.ade.ADEInterceptor.beforeEdit(ADEInterceptor.java:200)
	at org.netbeans.modules.versioning.core.filesystems.VCSFilesystemInterceptor$DelegatingInterceptor.beforeEdit(VCSFilesystemInterceptor.java:695)
	at org.netbeans.modules.versioning.core.filesystems.VCSFilesystemInterceptor.fileLocked(VCSFilesystemInterceptor.java:382)
	at org.netbeans.modules.remotefs.versioning.spi.FilesystemInterceptorProviderImpl$FilesystemInterceptorImpl.fileLocked(FilesystemInterceptorProviderImpl.java:251)
	at org.netbeans.modules.remote.impl.fs.RemotePlainFile.lockImpl(RemotePlainFile.java:202)
	at org.netbeans.modules.remote.impl.fs.RemoteLinkBase.lockImpl(RemoteLinkBase.java:170)
	at org.netbeans.modules.remote.impl.fs.RemoteFileObjectBase.lock(RemoteFileObjectBase.java:513)
	at org.netbeans.modules.remote.impl.fs.RemoteFileObject.lock(RemoteFileObject.java:297)
	at org.openide.loaders.MultiDataObject$Entry.takeLock(MultiDataObject.java:1352)
	at org.openide.loaders.DefaultES$Environment.takeLock(DefaultES.java:175)
	at org.openide.text.DataEditorSupport$Env.markModified(DataEditorSupport.java:951)
	at org.openide.text.CloneableEditorSupport.notifyModified(CloneableEditorSupport.java:2001)
	at org.openide.loaders.DefaultES.notifyModified(DefaultES.java:96)
	at org.openide.text.CloneableEditorSupport.callNotifyModified(CloneableEditorSupport.java:1974)
	at org.openide.text.CloneableEditorSupport$Listener.vetoableChange(CloneableEditorSupport.java:2836)
	at org.netbeans.editor.BaseDocument.atomicLockImpl(BaseDocument.java:1633)
	at org.netbeans.editor.GuardedDocument.runAtomic(GuardedDocument.java:313)
	at org.openide.text.UndoRedoManager$DocLockedRun.<init>(UndoRedoManager.java:593)
	at org.openide.text.UndoRedoManager$DocLockedRun.<init>(UndoRedoManager.java:585)
	at org.openide.text.UndoRedoManager$DocLockedRun.<init>(UndoRedoManager.java:581)
	at org.openide.text.UndoRedoManager.discardAllEdits(UndoRedoManager.java:435)
	at org.openide.text.CloneableEditorSupport$6$2.run(CloneableEditorSupport.java:1850)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:641)
	at java.awt.EventQueue.access$000(EventQueue.java:84)
	at java.awt.EventQueue$1.run(EventQueue.java:602)
	at java.awt.EventQueue$1.run(EventQueue.java:600)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:611)
	at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:162)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Comment 2 Vladimir Voskresensky 2012-02-17 12:09:03 UTC
Mila, it is the same root cause we've seen already in issue #206134.

it's again BaseDocument.atomicLockImpl which invokes callNotifyModified and it is definitely incorrect.
Comment 3 Vladimir Voskresensky 2012-02-17 12:59:56 UTC
it's a regression introduced in 7.1 comparing to 7.0
Comment 4 Tomas Stupka 2012-02-17 13:07:06 UTC
i guess its the same as in issue #206858

*** This bug has been marked as a duplicate of bug 206858 ***
Comment 5 Vladimir Voskresensky 2012-02-17 13:09:54 UTC
So, it's not true. Problem with callstack in trunk see below in comment 1
Comment 6 Vladimir Voskresensky 2012-02-22 09:10:34 UTC
Mila, can you evaluate this bug? It blocks use of ADE plugin.
Comment 7 Miloslav Metelka 2012-02-23 11:05:30 UTC
For discarding all edits I don't see a reason to write-lock the document. Readlock should suffice. I'll fix that.
Comment 9 Quality Engineering 2012-02-24 09:31:36 UTC
Integrated into 'main-golden', will be available in build *201202240400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/6fbb29e4ed0c
User: Miloslav Metelka <mmetelka@netbeans.org>
Log: #208553 - [regression] checked in file is imediately checked out by IDE.
Comment 10 Vladimir Voskresensky 2012-03-01 11:43:47 UTC
*** Bug 206858 has been marked as a duplicate of this bug. ***
Comment 11 Vladimir Voskresensky 2012-03-01 11:44:39 UTC
nominate it for 7.1.2 as users complain (see issue #206858)
Comment 12 jyeary 2012-03-01 14:33:59 UTC
I have just installed 7.1.1 and the IDE still checks out the files automatically on opening them without any modifications being done.

This is a show stopper and has prevented my internal development team from upgrading from 7.0.1.
Comment 13 MarkFlacy 2012-03-02 03:39:07 UTC
I had been suffering with this problem under 7.1 since 7.1 came out.

I upgraded from 7.1 to 7.1.1 at work today and this problem went away.
Comment 14 jyeary 2012-03-02 04:04:17 UTC
The bug is a little more sinister. I checked again, and here is what I discovered. 

If I open a .java file, the file does not get checked out unless I edit the file. This is what I expect for the behavior.

If I undo my changes, and ask the system un-check out the file, it does the operation and then re-checks it out again even though the file is unmodified.

If I close the file in the editor, and uncheck out the file from the project folder, it stays unchecked out.

If I have a web project, and I open an .xhtml, or .jsp page, it checks out immediately without any modification on my part. If I check it in, the file checks in and back out immediately.

If I close the file from the editor window, I can uncheck out the file and it stays unchecked out.
Comment 15 Vladimir Voskresensky 2012-03-02 09:21:38 UTC
jyeary, you are absolutely right.
Both problems are fixed in trunk, but the first problem (open file cause checkout) as was pushed into 7.1.1 in time while the second one (checkin of file opened in editor is checkout back) was not pushed into 7.1.1 => I nominated it for 7.1.2. As workaround in 7.1.1 try to use item from popup menu in Project/Files/Favorites views and not editor's tab action
Comment 16 Vladimir Voskresensky 2012-03-02 09:22:02 UTC
I mark it as fixed in 7.2
Comment 17 Vladimir Voskresensky 2012-03-02 12:18:19 UTC
(In reply to comment #14)
> If I have a web project, and I open an .xhtml, or .jsp page, it checks out
> immediately without any modification on my part. If I check it in, the file
> checks in and back out immediately.
I've filed issue #209098 about this issue
Comment 18 Marian Mirilovic 2012-04-02 14:51:16 UTC
Vladimir, 
please verify ... otherwise it will not get into NB 7.1.2 . Thanks in advance.
Comment 19 Alexander Simon 2012-04-02 15:41:04 UTC
verified on ADE plugin
Comment 20 Miloslav Metelka 2012-04-03 10:26:13 UTC
In release71_fixes:
10517c521304 transplanted to 80b0a68e1855
6fbb29e4ed0c transplanted to 6858e98581fb
Increased openide.text module version:
http://hg.netbeans.org/releases/rev/19979ce917f6
Comment 21 Quality Engineering 2012-04-04 01:00:08 UTC
Integrated into 'releases', will be available in build *201204032205* or newer. Wait for official and publicly available build.
Changeset: http://hg.netbeans.org/releases/rev/80b0a68e1855
User: Miloslav Metelka <mmetelka@netbeans.org>
Log: #208553 - [regression] checked in file is imediately checked out by IDE - fixed a test.
(transplanted from 10517c5213049be7eeebd86f8da6fa4602a3f307)
Comment 22 Jiri Prox 2012-04-06 08:37:46 UTC
Vladimir, 

can you please verify this one more time, this time in 7.1.2, thanks
Comment 23 Vladimir Voskresensky 2012-04-06 17:33:49 UTC
We should ask jyeary, because we don't have ADE working on 7.1.2 code line (it is trunk based), so if jyeary can help with clear case scenario where it was reproducible, it will help