You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by jd...@apache.org on 2006/07/21 06:48:37 UTC

svn commit: r424176 - /geronimo/sandbox/svkmerge/m2migration/modules/system/src/java/org/apache/geronimo/system/serverinfo/ServerConstants.java

Author: jdillon
Date: Thu Jul 20 21:48:37 2006
New Revision: 424176

URL: http://svn.apache.org/viewvc?rev=424176&view=rev
Log:
Throw error if geronimo-version.properties resource is not found (null)
Throw Error for all problems

Modified:
    geronimo/sandbox/svkmerge/m2migration/modules/system/src/java/org/apache/geronimo/system/serverinfo/ServerConstants.java

Modified: geronimo/sandbox/svkmerge/m2migration/modules/system/src/java/org/apache/geronimo/system/serverinfo/ServerConstants.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/svkmerge/m2migration/modules/system/src/java/org/apache/geronimo/system/serverinfo/ServerConstants.java?rev=424176&r1=424175&r2=424176&view=diff
==============================================================================
--- geronimo/sandbox/svkmerge/m2migration/modules/system/src/java/org/apache/geronimo/system/serverinfo/ServerConstants.java (original)
+++ geronimo/sandbox/svkmerge/m2migration/modules/system/src/java/org/apache/geronimo/system/serverinfo/ServerConstants.java Thu Jul 20 21:48:37 2006
@@ -68,28 +68,35 @@
     static {
         Properties versionInfo = new Properties();
         try {
-            versionInfo.load(ServerConstants.class.getClassLoader().getResourceAsStream("org/apache/geronimo/system/serverinfo/geronimo-version.properties"));
-        } catch (java.io.IOException e) {
-            throw new ExceptionInInitializerError(new Exception("Could not load geronimo-version.properties", e));
+            java.io.InputStream input = ServerConstants.class.getClassLoader().getResourceAsStream("org/apache/geronimo/system/serverinfo/geronimo-version.properties");
+            if (input == null) {
+                throw new Error("Missing geronimo-version.properties");
+            }
+            
+            versionInfo.load(input);
         }
+        catch (java.io.IOException e) {
+            throw new Error("Could not load geronimo-version.properties", e);
+        }
+        
         VERSION = versionInfo.getProperty("version");
         if (VERSION == null || VERSION.length() == 0) {
-            throw new ExceptionInInitializerError("geronimo-version.properties does not contain a 'version' property");
+            throw new Error("geronimo-version.properties does not contain a 'version' property");
         }
 
         BUILD_DATE = versionInfo.getProperty("build.date");
         if (BUILD_DATE == null || BUILD_DATE.length() == 0) {
-            throw new ExceptionInInitializerError("geronimo-version.properties does not contain a 'build.date' property");
+            throw new Error("geronimo-version.properties does not contain a 'build.date' property");
         }
 
         BUILD_TIME = versionInfo.getProperty("build.time");
         if (BUILD_TIME == null || BUILD_TIME.length() == 0) {
-            throw new ExceptionInInitializerError("geronimo-version.properties does not contain a 'build.time' property");
+            throw new Error("geronimo-version.properties does not contain a 'build.time' property");
         }
 
         COPYRIGHT = versionInfo.getProperty("copyright");
         if (COPYRIGHT == null || COPYRIGHT.length() == 0) {
-            throw new ExceptionInInitializerError("geronimo-version.properties does not contain a 'copyright' property");
+            throw new Error("geronimo-version.properties does not contain a 'copyright' property");
         }
     }
 }