[294887] - EOF in Validation Framework
diff --git a/plugins/org.eclipse.wst.validation/vf2/org/eclipse/wst/validation/internal/DependencyIndex.java b/plugins/org.eclipse.wst.validation/vf2/org/eclipse/wst/validation/internal/DependencyIndex.java
index 40c0b64..fe1db15 100644
--- a/plugins/org.eclipse.wst.validation/vf2/org/eclipse/wst/validation/internal/DependencyIndex.java
+++ b/plugins/org.eclipse.wst.validation/vf2/org/eclipse/wst/validation/internal/DependencyIndex.java
@@ -12,6 +12,7 @@
import java.io.DataInputStream;
import java.io.DataOutputStream;
+import java.io.EOFException;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
@@ -155,6 +156,9 @@
}
}
}
+ catch (EOFException e){
+ Tracing.log("Unable to read the dependency index file because of EOF exception");
+ }
catch (IOException e){
error = true;
ValidationPlugin.getPlugin().handleException(e);
@@ -246,10 +250,11 @@
public synchronized void saving(ISaveContext context) throws CoreException {
if (!_dirty)return;
_dirty = false;
-
+ boolean error = false;
DataOutputStream out = null;
+ File f = null;
try {
- File f = getIndexLocation();
+ f = getIndexLocation();
out = new DataOutputStream(new FileOutputStream(f));
out.writeInt(CurrentVersion);
Map<String, Set<DependsResolved>> map = compress(_dependsOn);
@@ -268,10 +273,12 @@
}
}
catch (IOException e){
+ error = true;
ValidationPlugin.getPlugin().handleException(e);
}
- finally {
+ finally {
Misc.close(out);
+ if (error)f.delete();
}
}