Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 334279 - Error Logged when Resource out of sync with file system
Summary: Error Logged when Resource out of sync with file system
Status: CLOSED WONTFIX
Alias: None
Product: PDE
Classification: Eclipse Project
Component: API Tools (show other bugs)
Version: 3.7   Edit
Hardware: PC Linux-GTK
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: PDE API Tools Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-13 11:35 EST by James Blackburn CLA
Modified: 2019-09-14 12:10 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description James Blackburn CLA 2011-01-13 11:35:38 EST
Using 3.7M4 I see Resource exceptions logged when Resources are out of sync with filesystem.

It would be good if this could be handled more gracefully.

java.io.FileNotFoundException: Resource is out of sync with the file system: '/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugUITools.java'.
	at org.eclipse.pde.api.tools.internal.CompilationUnit.getInputStream(CompilationUnit.java:73)
	at org.eclipse.pde.api.tools.internal.provisional.scanner.TagScanner.scan(TagScanner.java:521)
	at org.eclipse.pde.api.tools.internal.provisional.scanner.TagScanner.scan(TagScanner.java:498)
	at org.eclipse.pde.api.tools.internal.ProjectApiDescription$TypeNode.refresh(ProjectApiDescription.java:251)
	at org.eclipse.pde.api.tools.internal.ApiDescription.findNode(ApiDescription.java:423)
	at org.eclipse.pde.api.tools.internal.ApiDescription.resolveAnnotations(ApiDescription.java:443)
	at org.eclipse.pde.api.tools.internal.builder.IncrementalApiBuilder$ResourceDeltaVisitor.visit(IncrementalApiBuilder.java:154)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:68)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:79)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:79)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:79)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:79)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:79)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:79)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:48)
	at org.eclipse.pde.api.tools.internal.builder.IncrementalApiBuilder.build(IncrementalApiBuilder.java:227)
	at org.eclipse.pde.api.tools.internal.builder.ApiAnalysisBuilder.build(ApiAnalysisBuilder.java:357)
	at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:713)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:188)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:225)
	at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:278)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281)
	at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:337)
	at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:360)
	at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:143)
	at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:241)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Comment 1 James Blackburn CLA 2011-01-14 05:33:48 EST
I just did a CVS update and another 3 of these errors logged...

What's worth noting is that I'm not editing files outside of Eclipse. I'm doing all my Plugin developement within the IDE using the built-in CVS synchronize tools.
Comment 2 Curtis Windatt CLA 2011-01-19 17:48:01 EST
I'm not sure how we can handle this much better.  We are trying to use a workspace resource, but it is out of synch.  The workspace won't let us open an input stream in that case.
Comment 3 James Blackburn CLA 2011-01-20 04:26:50 EST
(In reply to comment #2)
> I'm not sure how we can handle this much better.  We are trying to use a
> workspace resource, but it is out of synch.  The workspace won't let us open an
> input stream in that case.

IFile#getContents(true) is probably what you're looking for -- this ignores the sync state.

Fundamentally you builder needs to be resilient against resources changing concurrently underneath Eclipse.  Throwing CoreException is part of the API and clients are expected to deal with the exception appropriately. In this case perhaps using different API. 

CoreException also happens if the file no longer exists on disk, the builder should handle this too by moving on to the next file. Logging the error isn't appropriate as it's an expected checked exception...
Comment 4 Eclipse Genie CLA 2019-09-14 12:10:55 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.