Skip to content

Commit

Permalink
Clean up unusual initialization of StartupException in Start.java.
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1676100 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
adrian-crum committed Apr 26, 2015
1 parent 9d8a36a commit 7c3b5e7
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions framework/start/src/org/ofbiz/base/start/Start.java
Original file line number Diff line number Diff line change
Expand Up @@ -185,21 +185,21 @@ void init(String[] args, boolean fullInit) throws StartupException {
stream = new FileInputStream(globalSystemPropsFileName);
System.getProperties().load(stream);
} catch (IOException e) {
throw (StartupException) new StartupException("Couldn't load global system props").initCause(e);
throw new StartupException("Couldn't load global system props", e);
} finally {
if (stream != null) {
try {
stream.close();
} catch (IOException e) {
throw (StartupException) new StartupException("Couldn't close stream").initCause(e);
throw new StartupException("Couldn't close stream", e);
}
}
}
}
try {
this.config = new Config(args);
} catch (IOException e) {
throw (StartupException) new StartupException("Couldn't not fetch config instance").initCause(e);
throw new StartupException("Couldn't fetch config instance", e);
}
// parse the startup arguments
if (args.length > 1) {
Expand Down Expand Up @@ -245,7 +245,7 @@ private void initStartLoaders() throws StartupException {
try {
this.config.initClasspath(classPath, libraryPath);
} catch (Exception e) {
throw (StartupException) new StartupException("Couldn't initialized classpath").initCause(e);
throw new StartupException("Couldn't initialize classpath", e);
}
ClassLoader classloader = classPath.getClassLoader();
Thread.currentThread().setContextClassLoader(classloader);
Expand All @@ -262,11 +262,11 @@ private void initStartLoaders() throws StartupException {
loader.load(config, loaderArgs.toArray(new String[loaderArgs.size()]));
loaders.add(loader);
} catch (ClassNotFoundException e) {
throw (StartupException) new StartupException(e.getMessage()).initCause(e);
throw new StartupException(e.getMessage(), e);
} catch (InstantiationException e) {
throw (StartupException) new StartupException(e.getMessage()).initCause(e);
throw new StartupException(e.getMessage(), e);
} catch (IllegalAccessException e) {
throw (StartupException) new StartupException(e.getMessage()).initCause(e);
throw new StartupException(e.getMessage(), e);
}
}
this.loaders.trimToSize();
Expand Down Expand Up @@ -391,7 +391,7 @@ private class AdminPortThread extends Thread {
try {
this.serverSocket = new ServerSocket(config.adminPort, 1, config.adminAddress);
} catch (IOException e) {
throw (StartupException) new StartupException("Couldn't create server socket(" + config.adminAddress + ":" + config.adminPort + ")").initCause(e);
throw new StartupException("Couldn't create server socket(" + config.adminAddress + ":" + config.adminPort + ")", e);
}
setDaemon(false);
}
Expand Down

0 comments on commit 7c3b5e7

Please sign in to comment.