From 15f4c4af976c56c76be7f45d306618f56157461c Mon Sep 17 00:00:00 2001
From: kenneth_suter <kenneth_suter@localhost>
Date: Wed, 06 Jun 2007 20:06:24 +0000
Subject: [PATCH] The commit insures that in all cases instantiation of ApplicationException is done with a localized message since this the message contained in this exception is exposed to end users.
---
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/Application.java | 18 +++++++++++-------
1 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/Application.java b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/Application.java
index ced1372..eda03c8 100644
--- a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/Application.java
+++ b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/Application.java
@@ -72,11 +72,11 @@
* denoted by the System property
* <code>org.opends.quicksetup.Application.class</code>.
* @return Application object that was newly instantiated
- * @throws org.opends.quicksetup.ApplicationException if there was a problem
+ * @throws RuntimeException if there was a problem
* creating the new Application object
*/
static public GuiApplication create()
- throws ApplicationException {
+ throws RuntimeException {
GuiApplication app;
String appClassName =
System.getProperty("org.opends.quicksetup.Application.class");
@@ -88,25 +88,25 @@
} catch (ClassNotFoundException e) {
LOG.log(Level.INFO, "error creating quicksetup application", e);
String msg = "Application class " + appClass + " not found";
- throw new ApplicationException(ApplicationException.Type.BUG, msg, e);
+ throw new RuntimeException(msg, e);
} catch (IllegalAccessException e) {
LOG.log(Level.INFO, "error creating quicksetup application", e);
String msg = "Could not access class " + appClass;
- throw new ApplicationException(ApplicationException.Type.BUG, msg, e);
+ throw new RuntimeException(msg, e);
} catch (InstantiationException e) {
LOG.log(Level.INFO, "error creating quicksetup application", e);
String msg = "Error instantiating class " + appClass;
- throw new ApplicationException(ApplicationException.Type.BUG, msg, e);
+ throw new RuntimeException(msg, e);
} catch (ClassCastException e) {
String msg = "The class indicated by the system property " +
"'org.opends.quicksetup.Application.class' must " +
" must be of type Application";
- throw new ApplicationException(ApplicationException.Type.BUG, msg, e);
+ throw new RuntimeException(msg, e);
}
} else {
String msg = "System property 'org.opends.quicksetup.Application.class'" +
" must specify class quicksetup application";
- throw new ApplicationException(ApplicationException.Type.BUG, msg, null);
+ throw new RuntimeException(msg);
}
return app;
}
@@ -567,6 +567,10 @@
return ui;
}
+ static private String getMessage(String key, String... args) {
+ return ResourceProvider.getInstance().getMsg(key, args);
+ }
+
/**
* This class is used to notify the ProgressUpdateListeners of events
* that are written to the standard error. It is used in WebStartInstaller
--
Gitblit v1.10.0