Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 282084 - ResourceTextFileBuffer should not attempt to revert modification stamp to UNKNOWN_MODIFICATION_STAMP
Summary: ResourceTextFileBuffer should not attempt to revert modification stamp to UNK...
Status: RESOLVED DUPLICATE of bug 192969
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.5   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-30 18:49 EDT by Greg Watson CLA
Modified: 2009-07-07 03:09 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Greg Watson CLA 2009-06-30 18:49:44 EDT
I repeatedly hit undo back to the last save point, then hit undo again. 

java.lang.IllegalArgumentException: Illegal value: -1
	at org.eclipse.core.internal.resources.Resource.revertModificationStamp(Resource.java:1559)
	at org.eclipse.core.internal.filebuffers.ResourceTextFileBuffer.commitFileBufferContent(ResourceTextFileBuffer.java:400)
	at org.eclipse.core.internal.filebuffers.ResourceFileBuffer.commit(ResourceFileBuffer.java:325)
	at org.eclipse.jdt.internal.ui.javaeditor.DocumentAdapter.save(DocumentAdapter.java:463)
	at org.eclipse.jdt.internal.core.CommitWorkingCopyOperation.executeOperation(CommitWorkingCopyOperation.java:123)
	at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:728)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1800)
	at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:793)
	at org.eclipse.jdt.internal.core.CompilationUnit.commitWorkingCopy(CompilationUnit.java:389)
	at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitDocumentProvider.commitWorkingCopy(CompilationUnitDocumentProvider.java:1330)
	at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitDocumentProvider$4.execute(CompilationUnitDocumentProvider.java:1401)
	at org.eclipse.ui.editors.text.TextFileDocumentProvider$DocumentProviderOperation.run(TextFileDocumentProvider.java:132)
	at org.eclipse.ui.actions.WorkspaceModifyDelegatingOperation.execute(WorkspaceModifyDelegatingOperation.java:69)
	at org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(WorkspaceModifyOperation.java:106)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1800)
	at org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:118)
	at org.eclipse.ui.internal.editors.text.WorkspaceOperationRunner.run(WorkspaceOperationRunner.java:75)
	at org.eclipse.ui.internal.editors.text.WorkspaceOperationRunner.run(WorkspaceOperationRunner.java:65)
	at org.eclipse.ui.editors.text.TextFileDocumentProvider.executeOperation(TextFileDocumentProvider.java:456)
	at org.eclipse.ui.editors.text.TextFileDocumentProvider.saveDocument(TextFileDocumentProvider.java:772)
	at org.eclipse.ui.texteditor.AbstractTextEditor.performSave(AbstractTextEditor.java:4945)
	at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor.performSave(CompilationUnitEditor.java:1230)
	at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor.doSave(CompilationUnitEditor.java:1283)
	at org.eclipse.ui.texteditor.AbstractTextEditor$TextEditorSavable.doSave(AbstractTextEditor.java:7066)
	at org.eclipse.ui.Saveable.doSave(Saveable.java:214)
	at org.eclipse.ui.internal.SaveableHelper.doSaveModel(SaveableHelper.java:346)
	at org.eclipse.ui.internal.SaveableHelper$3.run(SaveableHelper.java:193)
	at org.eclipse.ui.internal.SaveableHelper$5.run(SaveableHelper.java:274)
	at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:464)
	at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:372)
	at org.eclipse.jface.window.ApplicationWindow$1.run(ApplicationWindow.java:759)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.jface.window.ApplicationWindow.run(ApplicationWindow.java:756)
	at org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow.java:2578)
	at org.eclipse.ui.internal.SaveableHelper.runProgressMonitorOperation(SaveableHelper.java:282)
	at org.eclipse.ui.internal.SaveableHelper.runProgressMonitorOperation(SaveableHelper.java:261)
	at org.eclipse.ui.internal.SaveableHelper.saveModels(SaveableHelper.java:204)
	at org.eclipse.ui.internal.SaveableHelper.savePart(SaveableHelper.java:144)
	at org.eclipse.ui.internal.EditorManager.savePart(EditorManager.java:1357)
	at org.eclipse.ui.internal.WorkbenchPage.savePart(WorkbenchPage.java:3328)
	at org.eclipse.ui.internal.WorkbenchPage.saveEditor(WorkbenchPage.java:3341)
	at org.eclipse.ui.internal.SaveAction.run(SaveAction.java:76)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
	at org.eclipse.ui.commands.ActionHandler.execute(ActionHandler.java:185)
	at org.eclipse.ui.internal.handlers.LegacyHandlerWrapper.execute(LegacyHandlerWrapper.java:109)
	at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476)
	at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
	at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:470)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.java:824)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java:880)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings(WorkbenchKeyboard.java:569)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(WorkbenchKeyboard.java:510)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter.handleEvent(WorkbenchKeyboard.java:125)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.filterEvent(Display.java:965)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:3541)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1247)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1270)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1255)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1284)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1280)
	at org.eclipse.swt.widgets.Canvas.sendKeyEvent(Canvas.java:428)
	at org.eclipse.swt.widgets.Control.doCommandBySelector(Control.java:906)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4740)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method)
	at org.eclipse.swt.internal.cocoa.NSResponder.interpretKeyEvents(NSResponder.java:56)
	at org.eclipse.swt.widgets.Composite.keyDown(Composite.java:516)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4654)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
	at org.eclipse.swt.widgets.Widget.callSuper(Widget.java:202)
	at org.eclipse.swt.widgets.Widget.windowSendEvent(Widget.java:1750)
	at org.eclipse.swt.widgets.Shell.windowSendEvent(Shell.java:1821)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4712)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
	at org.eclipse.swt.widgets.Display.applicationSendEvent(Display.java:4284)
	at org.eclipse.swt.widgets.Display.applicationProc(Display.java:4351)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method)
	at org.eclipse.swt.internal.cocoa.NSApplication.sendEvent(NSApplication.java:101)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3096)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2405)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:493)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
Comment 1 Remy Suen CLA 2009-06-30 19:07:20 EDT
(In reply to comment #0)
>         at org.eclipse.ui.internal.SaveAction.run(SaveAction.java:76)

Is this consistently reproducible? If yes, do you have more concrete steps? The trace seems to indicate that the error was caused from a save rather than from an undo.
Comment 2 Greg Watson CLA 2009-07-01 08:48:20 EDT
No, it's only happened once so far, which probably points to a race of some kind. Given the frequency of Eclipse crashing, I've gotten into the habit of saving frequently. I may have done several undo's followed immediately by a save.
Comment 3 Susan McCourt CLA 2009-07-06 16:43:24 EDT
The problem appears to be in ResourceTextFileBuffer.commitFileBufferContent.  At line 398...

if (fDocument instanceof IDocumentExtension4) {
				fSynchronizationStamp= ((IDocumentExtension4)fDocument).getModificationStamp();
				fFile.revertModificationStamp(fSynchronizationStamp);
			} 

IDocumentExtension4 can answer UNKNOWN_MODIFICATION_STAMP (-1) as the modification stamp, yet this value is not expected by Resource.revertModificationStamp.

Moving to platform text.

Comment 4 Dani Megert CLA 2009-07-07 03:09:02 EDT
>IDocumentExtension4 can answer UNKNOWN_MODIFICATION_STAMP (-1) as the
>modification stamp, yet this value is not expected by
>Resource.revertModificationStamp.
Right, but this should not happen.

*** This bug has been marked as a duplicate of bug 192969 ***