Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Herrmann2010-04-23 13:45:58 +0000
committerStephan Herrmann2010-04-23 13:45:58 +0000
commit7b84a8b928bc5576712b7d678bc2ec10bc322cdd (patch)
treee97b3ed1608bf32fa2b6fca45d3171a2824d6c2d
parent55b1d4977fa28eb2e0e6d40df5f88e3bba451a45 (diff)
downloadorg.eclipse.objectteams-7b84a8b928bc5576712b7d678bc2ec10bc322cdd.tar.gz
org.eclipse.objectteams-7b84a8b928bc5576712b7d678bc2ec10bc322cdd.tar.xz
org.eclipse.objectteams-7b84a8b928bc5576712b7d678bc2ec10bc322cdd.zip
Add retrying to reading generated class files: self-building seemed to have timing issues on build.eclipse.org.
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/model/TypeModel.java20
1 files changed, 18 insertions, 2 deletions
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/model/TypeModel.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/model/TypeModel.java
index b6fc6ebbf..e5593697e 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/model/TypeModel.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/model/TypeModel.java
@@ -20,6 +20,7 @@
**********************************************************************/
package org.eclipse.objectteams.otdt.internal.core.compiler.model;
+import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.HashSet;
import java.util.LinkedList;
@@ -467,8 +468,23 @@ public class TypeModel extends ModelElement {
}
public ClassFileReader read () throws IOException, ClassFormatException
{
- if (this._classFilePath != null)
- return ClassFileReader.read(this._classFilePath); // not recording attributes
+ if (this._classFilePath != null) {
+ FileNotFoundException fileNotFoundException = null;
+ for (int i=0; i<5; i++) { // make <= 5 attempts thus waiting <= 500 ms
+ try {
+ return ClassFileReader.read(this._classFilePath); // not recording attributes
+ } catch (FileNotFoundException ex) {
+ fileNotFoundException = ex;
+ try {
+ Thread.sleep(100);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ if (fileNotFoundException != null)
+ throw fileNotFoundException;
+ }
return null;
}
/**

Back to the top