Deal with builds that have no artifacts (anymore)
diff --git a/org.eclipse.emf.cdo.releng.promotion/src/promoter/BuildCopier.java b/org.eclipse.emf.cdo.releng.promotion/src/promoter/BuildCopier.java
index a515df2..26bc9cf 100644
--- a/org.eclipse.emf.cdo.releng.promotion/src/promoter/BuildCopier.java
+++ b/org.eclipse.emf.cdo.releng.promotion/src/promoter/BuildCopier.java
@@ -15,6 +15,8 @@
import org.xml.sax.helpers.DefaultHandler;
import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
import java.io.PrintStream;
import java.net.MalformedURLException;
import java.net.URL;
@@ -111,22 +113,15 @@
buildInfos.add(buildInfo);
}
}
- catch (Exception ex)
+ catch (FileNotFoundException ex)
{
- ex.printStackTrace();
+ System.out.println("Build " + buildNumber + " is missing build infos");
continue;
- // if (ex.getCause() instanceof FileNotFoundException)
- // {
- // System.out.println("Build " + buildNumber + " has no artifacts");
- // continue;
- // }
- //
- // throw ex;
}
- // catch (MalformedURLException ex)
- // {
- // throw new RuntimeException(ex);
- // }
+ catch (IOException ex)
+ {
+ throw new RuntimeException(ex);
+ }
}
else if ("FAILURE".equalsIgnoreCase(buildResult))
{
diff --git a/org.eclipse.emf.cdo.releng.promotion/src/promoter/BuildInfo.java b/org.eclipse.emf.cdo.releng.promotion/src/promoter/BuildInfo.java
index 999fa96..23715e4 100644
--- a/org.eclipse.emf.cdo.releng.promotion/src/promoter/BuildInfo.java
+++ b/org.eclipse.emf.cdo.releng.promotion/src/promoter/BuildInfo.java
@@ -15,6 +15,7 @@
import org.xml.sax.helpers.DefaultHandler;
import java.io.File;
+import java.io.IOException;
import java.net.URL;
import java.util.function.Predicate;
@@ -315,7 +316,7 @@
this.type = type;
}
- public static BuildInfo read(File file)
+ public static BuildInfo read(File file) throws IOException
{
Location location = null;
if (file.getAbsolutePath().startsWith(PromoterConfig.INSTANCE.getDownloadsArea().getAbsolutePath()))
@@ -364,7 +365,7 @@
return result;
}
- public static BuildInfo read(URL url)
+ public static BuildInfo read(URL url) throws IOException
{
final BuildInfo result = new BuildInfo(Location.HUDSON);
XML.parseXML(url, new DefaultHandler()
diff --git a/org.eclipse.emf.cdo.releng.promotion/src/promoter/util/XML.java b/org.eclipse.emf.cdo.releng.promotion/src/promoter/util/XML.java
index 58312e0..f52f496 100644
--- a/org.eclipse.emf.cdo.releng.promotion/src/promoter/util/XML.java
+++ b/org.eclipse.emf.cdo.releng.promotion/src/promoter/util/XML.java
@@ -34,7 +34,7 @@
{
}
- public static void parseXML(File file, DefaultHandler handler)
+ public static void parseXML(File file, DefaultHandler handler) throws IOException
{
InputStream in = null;
@@ -43,7 +43,7 @@
in = new FileInputStream(file);
parseXML(in, handler);
}
- catch (Exception ex)
+ catch (ParserConfigurationException | SAXException ex)
{
throw wrapException(ex);
}
@@ -53,7 +53,7 @@
}
}
- public static void parseXML(URL url, DefaultHandler handler)
+ public static void parseXML(URL url, DefaultHandler handler) throws IOException
{
InputStream in = null;
@@ -62,7 +62,7 @@
in = url.openStream();
parseXML(in, handler);
}
- catch (Exception ex)
+ catch (ParserConfigurationException | SAXException ex)
{
throw wrapException(ex);
}
@@ -72,7 +72,7 @@
}
}
- public static void parseXML(InputStream in, DefaultHandler handler) throws ParserConfigurationException, SAXException, IOException
+ public static void parseXML(InputStream in, DefaultHandler handler) throws IOException, ParserConfigurationException, SAXException
{
if (parserFactory == null)
{