Community
Participate
Working Groups
I got an IO exception while adding natures to a project: Caused by: org.eclipse.core.internal.resources.ResourceException: File not found: Foo/.project. at org.eclipse.core.internal.localstore.FileSystemResourceManager.read(FileSystemResourceManager.java:834) at org.eclipse.core.internal.resources.File.getContents(File.java:275) at org.eclipse.core.internal.localstore.FileSystemResourceManager.descriptionChanged(FileSystemResourceManager.java:382) at org.eclipse.core.internal.localstore.FileSystemResourceManager.internalWrite(FileSystemResourceManager.java:651) at org.eclipse.core.internal.resources.Project.writeDescription(Project.java:1383) at org.eclipse.core.internal.resources.Project.setDescription(Project.java:1275) at org.eclipse.core.internal.resources.Project.setDescription(Project.java:1298) Apparently the static isWriting, isReading flags in the ProjectDescription are responsible to note on whether any thread reads or writes a project description at the moment. protected static boolean isReading = false; //flags to indicate when we are in the middle of reading or writing a // workspace description //these can be static because only one description can be read at once. protected static boolean isWriting = false; However, since the fields are not marked volatile, written changes to the the fields may not be propagated to others threads, so that two threads can write concurrently nontheless. But even then it seems that two or more threads may write descriptions concurrently, since no checks or waiting-loop exists in Project.writeDescription before starting writing.
I have no code at hand right now, but I wonder if the writer is supposed to run with a workspace lock? But static global variables is a nonsense anyway in multiple ways. Is the exception you get reproducible, and can you attach the code snippet causing it?