Bug 35338 - Cannot save file, "Save failed:null" error message received
Summary: Cannot save file, "Save failed:null" error message received
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1   Edit
Hardware: PC Linux-GTK
: P3 normal (vote)
Target Milestone: 2.1.1   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-03-20 04:03 EST by Adrian FILIP CLA
Modified: 2003-06-10 10:22 EDT (History)
0 users

See Also:


Attachments
Patch for Scanner (2.68 KB, patch)
2003-03-20 08:43 EST, Philipe Mulet CLA
no flags Details | Diff
Patch for the Public scanner class (2.70 KB, patch)
2003-03-21 10:46 EST, Olivier Thomann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Adrian FILIP CLA 2003-03-20 04:03:05 EST
When I'm trying to save a file sometimes I receive this error "Save failed:null".
I'm using Eclipse 2.1 RC2 GTK version on Redhat Linux 8.0.
This is a snippet from .log in .metadata folder:

!SESSION Mar 14, 2003 10:58:13.595 ---------------------------------------------
java.version=1.4.0_02
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_US
Command-line arguments: -os linux -ws gtk -arch x86 -install
file:/home/adi/apps/eclipse-RC2/
!ENTRY org.eclipse.ui 4 4 Mar 14, 2003 10:58:13.597
!MESSAGE Save Failed
!ENTRY org.eclipse.ui 2 0 Mar 14, 2003 10:58:13.599
!MESSAGE Save Failed
!STACK 0
java.lang.NegativeArraySizeException
        at
org.eclipse.jdt.internal.compiler.parser.Scanner.checkTaskTag(Scanner.java:284)
        at
org.eclipse.jdt.internal.compiler.parser.Parser.checkAndReportBracketAnomalies(Parser.java:869)
        at
org.eclipse.jdt.internal.compiler.parser.Parser.reportSyntaxError(Parser.java:7482)
        at
org.eclipse.jdt.internal.compiler.SourceElementParser.reportSyntaxError(SourceElementParser.java:1254)
        at org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:6850)
        at org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:7116)
        at
org.eclipse.jdt.internal.compiler.SourceElementParser.parseCompilationUnit(SourceElementParser.java:1051)
        at
org.eclipse.jdt.internal.core.CompilationUnit.generateInfos(CompilationUnit.java:313)
        at
org.eclipse.jdt.internal.core.CompilationUnit.buildStructure(CompilationUnit.java:77)
        at
org.eclipse.jdt.internal.core.CompilationUnit.makeConsistent(CompilationUnit.java:636)
        at
org.eclipse.jdt.internal.core.WorkingCopy.makeConsistent(WorkingCopy.java:340)
        at
org.eclipse.jdt.internal.core.ReconcileWorkingCopyOperation.executeOperation(ReconcileWorkingCopyOperation.java:48)
        at
org.eclipse.jdt.internal.core.JavaModelOperation.execute(JavaModelOperation.java:365)
        at
org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:681)
        at
org.eclipse.jdt.internal.core.JavaElement.runOperation(JavaElement.java:540)
        at org.eclipse.jdt.internal.core.WorkingCopy.reconcile(WorkingCopy.java:438)
        at org.eclipse.jdt.internal.core.WorkingCopy.reconcile(WorkingCopy.java:429)
        at
org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitDocumentProvider.doSaveDocument(CompilationUnitDocumentProvider.java:906)
        at
org.eclipse.ui.texteditor.AbstractDocumentProvider.saveDocument(AbstractDocumentProvider.java:455)
        at
org.eclipse.ui.texteditor.AbstractTextEditor$11.execute(AbstractTextEditor.java:2906)
        at
org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(WorkspaceModifyOperation.java:65)
        at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1591)
        at
org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:79)
        at
org.eclipse.ui.texteditor.AbstractTextEditor.performSaveOperation(AbstractTextEditor.java:2926)
        at
org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor.performSaveOperation(CompilationUnitEditor.java:742)
        at
org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor.doSave(CompilationUnitEditor.java:806)
        at org.eclipse.ui.internal.EditorManager$11.run(EditorManager.java:1083)
        at org.eclipse.ui.internal.EditorManager$8.run(EditorManager.java:954)
        at
org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:296)
        at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:246)
        at
org.eclipse.jface.window.ApplicationWindow$1.run(ApplicationWindow.java:431)
        at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:65)
        at
org.eclipse.jface.window.ApplicationWindow.run(ApplicationWindow.java:428)
        at org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow.java:1385)
        at
org.eclipse.ui.internal.EditorManager.runProgressMonitorOperation(EditorManager.java:960)
        at org.eclipse.ui.internal.EditorManager.savePart(EditorManager.java:1088)
        at org.eclipse.ui.internal.WorkbenchPage.savePart(WorkbenchPage.java:2350)
        at org.eclipse.ui.internal.WorkbenchPage.saveEditor(WorkbenchPage.java:2362)
        at org.eclipse.ui.internal.SaveAction.run(SaveAction.java:57)
        at org.eclipse.jface.action.Action.runWithEvent(Action.java:842)
        at
org.eclipse.ui.internal.WWinKeyBindingService.pressed(WWinKeyBindingService.java:214)
        at
org.eclipse.ui.internal.WWinKeyBindingService$5.widgetSelected(WWinKeyBindingService.java:328)
        at
org.eclipse.ui.internal.AcceleratorMenu$2.handleEvent(AcceleratorMenu.java:55)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:77)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:902)
        at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1590)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1383)
        at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1400)
        at org.eclipse.ui.internal.Workbench.run(Workbench.java:1383)
        at
org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:845)
        at org.eclipse.core.boot.BootLoader.run(BootLoader.java:461)
        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.        
at org.eclipse.core.launcher.Main.basicRun(Main.java:247)
        at org.eclipse.core.launcher.Main.run(Main.java:703)
        at org.eclipse.core.launcher.Main.main(Main.java:539)
java:324)
Comment 1 Philipe Mulet CLA 2003-03-20 04:53:40 EST
Could you attach the source of the unit which fails to save ?
The bug seems located in the scanner, when attempting to discover some TODO 
tasks.
Comment 2 Philipe Mulet CLA 2003-03-20 06:03:31 EST
Actually, was able to reproduce on last TODO task (immediately followed by a 
EOF)

public class X {	
}//TODO
Comment 3 Philipe Mulet CLA 2003-03-20 08:43:35 EST
Created attachment 4259 [details]
Patch for Scanner

would also need to be applied to public scanner class
Comment 4 Philipe Mulet CLA 2003-03-20 12:58:18 EST
Fix is available and is quite simple.
Comment 5 Philipe Mulet CLA 2003-03-21 09:40:46 EST
Not really critical.
Comment 6 Olivier Thomann CLA 2003-03-21 10:46:06 EST
Created attachment 4286 [details]
Patch for the Public scanner class

Identical patch for the public scanner class.
Comment 7 Philipe Mulet CLA 2003-03-24 05:26:19 EST
Adrian - do you confirm my testcase is what you also had ?
Comment 8 Adrian FILIP CLA 2003-03-24 11:24:25 EST
I guess so. Is it fix in the latest version of eclipse(RC3b)?
Comment 9 Olivier Thomann CLA 2003-03-24 11:34:12 EST
No, the patch is not included in the latest integration build.
Comment 10 Philipe Mulet CLA 2003-03-24 13:18:09 EST
Given we are really close to the 2.1 release, this fix will not make it into 
this release, unless it would be a stop ship issue (which it doesn't qualify 
for). It is likely going to be released just after 2.1, and should be part of 
any patch past it.
Comment 11 Philipe Mulet CLA 2003-03-27 05:06:40 EST
Defer
Comment 12 Philipe Mulet CLA 2003-04-01 05:02:47 EST
Reopening
Comment 13 Philipe Mulet CLA 2003-04-01 05:03:21 EST
Fixed
Comment 14 Philipe Mulet CLA 2003-04-08 07:29:05 EDT
Backported to 2.1 maintenance stream.
Comment 15 Jerome Lanneluc CLA 2003-04-15 10:45:32 EDT
Fixed in 2.2 stream as well.
Comment 16 David Audel CLA 2003-06-02 06:54:39 EDT
Verified.
Comment 17 David Audel CLA 2003-06-10 10:22:20 EDT
Verified. for 3.0M1.