[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Pki-devel] [PATCH] 541 Removed unnecessary EBaseException constructor.



One of the constructors in EBaseException has been removed
because it's only used once and can be substituted with another
constructor. All subclasses of EBaseException have been updated
accordingly.

https://fedorahosted.org/pki/ticket/915

--
Endi S. Dewata
From 0aac83eb5c13d1fe631e941fccc514967dc68fdc Mon Sep 17 00:00:00 2001
From: "Endi S. Dewata" <edewata redhat com>
Date: Tue, 20 Jan 2015 09:25:32 -0500
Subject: [PATCH] Removed unnecessary EBaseException constructor.

One of the constructors in EBaseException has been removed
because it's only used once and can be substituted with another
constructor. All subclasses of EBaseException have been updated
accordingly.

https://fedorahosted.org/pki/ticket/915
---
 .../certsrv/authentication/EAuthException.java         | 11 -----------
 .../certsrv/authorization/EAuthzException.java         | 11 -----------
 .../netscape/certsrv/base/BadRequestDataException.java |  5 -----
 .../src/com/netscape/certsrv/base/EBaseException.java  | 18 ------------------
 .../src/com/netscape/certsrv/ca/ECAException.java      | 11 -----------
 .../src/com/netscape/certsrv/dbs/EDBException.java     | 11 -----------
 .../certsrv/extensions/EExtensionsException.java       |  4 ----
 .../src/com/netscape/certsrv/jobs/EJobsException.java  |  8 --------
 .../src/com/netscape/certsrv/kra/EKRAException.java    | 11 -----------
 .../src/com/netscape/certsrv/ldap/ELdapException.java  | 12 ------------
 .../certsrv/listeners/EListenersException.java         | 11 -----------
 .../certsrv/notification/ENotificationException.java   |  8 --------
 .../certsrv/password/EPasswordCheckException.java      | 11 -----------
 .../com/netscape/certsrv/usrgrp/EUsrGrpException.java  | 11 -----------
 base/ocsp/src/com/netscape/ocsp/EOCSPException.java    |  8 --------
 .../src/com/netscape/cms/authentication/DNPattern.java |  2 +-
 .../netscape/cms/servlet/common/ECMSGWException.java   |  8 --------
 17 files changed, 1 insertion(+), 160 deletions(-)

diff --git a/base/common/src/com/netscape/certsrv/authentication/EAuthException.java b/base/common/src/com/netscape/certsrv/authentication/EAuthException.java
index 94240fdccd9ebc1b2f4d160ca032d3935a278c47..18743c5e70bd8bcf256ab1295cec4d997f6a9323 100644
--- a/base/common/src/com/netscape/certsrv/authentication/EAuthException.java
+++ b/base/common/src/com/netscape/certsrv/authentication/EAuthException.java
@@ -47,17 +47,6 @@ public class EAuthException extends EBaseException {
     }
 
     /**
-     * Constructs an authentication exception with a parameter.
-     * <p>
-     *
-     * @param msgFormat exception details in message string format
-     * @param param message string parameter
-     */
-    public EAuthException(String msgFormat, String param) {
-        super(msgFormat, param);
-    }
-
-    /**
      * Constructs a auth exception with a exception parameter.
      * <P>
      *
diff --git a/base/common/src/com/netscape/certsrv/authorization/EAuthzException.java b/base/common/src/com/netscape/certsrv/authorization/EAuthzException.java
index ccb81f24487a08f24264873219261d89fb7a6002..3674c8e00aa73ed254805a937a25ac36de08ea72 100644
--- a/base/common/src/com/netscape/certsrv/authorization/EAuthzException.java
+++ b/base/common/src/com/netscape/certsrv/authorization/EAuthzException.java
@@ -47,17 +47,6 @@ public class EAuthzException extends EBaseException {
     }
 
     /**
-     * Constructs a authz exception with a parameter.
-     * <p>
-     *
-     * @param msgFormat exception details in message string format
-     * @param param message string parameter
-     */
-    public EAuthzException(String msgFormat, String param) {
-        super(msgFormat, param);
-    }
-
-    /**
      * Constructs a authz exception with a exception parameter.
      * <P>
      *
diff --git a/base/common/src/com/netscape/certsrv/base/BadRequestDataException.java b/base/common/src/com/netscape/certsrv/base/BadRequestDataException.java
index 268221eae726ed93b37d08e3ae721ace3340a43d..d029cd4a78f35bb3dd8b13e28ea61591060cdd62 100644
--- a/base/common/src/com/netscape/certsrv/base/BadRequestDataException.java
+++ b/base/common/src/com/netscape/certsrv/base/BadRequestDataException.java
@@ -16,9 +16,4 @@ public class BadRequestDataException extends EBaseException {
     public BadRequestDataException(String msgFormat, Object[] params) {
         super(msgFormat, params);
     }
-
-    public BadRequestDataException(String msgFormat, String param) {
-        super(msgFormat, param);
-    }
-
 }
diff --git a/base/common/src/com/netscape/certsrv/base/EBaseException.java b/base/common/src/com/netscape/certsrv/base/EBaseException.java
index 0ce8fdc3d37f5226cc144107d31dbc60a9e2103e..140a6acbcfc71b291ff059b09c8ec7eb3c6199fb 100644
--- a/base/common/src/com/netscape/certsrv/base/EBaseException.java
+++ b/base/common/src/com/netscape/certsrv/base/EBaseException.java
@@ -63,24 +63,6 @@ public class EBaseException extends Exception {
     }
 
     /**
-     * Constructs an instance of this exception with the given resource key
-     * and a parameter as a string.
-     *
-     * <PRE>
-     * new EBaseException(BaseResource.NO_CONFIG_FILE, fileName);
-     * </PRE>
-     * <P>
-     *
-     * @param msgFormat exception details in message string format
-     * @param param message string parameter
-     */
-    public EBaseException(String msgFormat, String param) {
-        super(msgFormat);
-        mParams = new String[1];
-        mParams[0] = param;
-    }
-
-    /**
      * Constructs an instance of the exception given the resource key and
      * a exception parameter.
      *
diff --git a/base/common/src/com/netscape/certsrv/ca/ECAException.java b/base/common/src/com/netscape/certsrv/ca/ECAException.java
index 54ddbe8062c6ed09e536c962a4b8d5dce974ed87..01c601e983ceecaf359a17b87694b6c9c415079c 100644
--- a/base/common/src/com/netscape/certsrv/ca/ECAException.java
+++ b/base/common/src/com/netscape/certsrv/ca/ECAException.java
@@ -51,17 +51,6 @@ public class ECAException extends EBaseException {
      * <P>
      *
      * @param msgFormat constant from CAResources.
-     * @param param additional parameters to the message.
-     */
-    public ECAException(String msgFormat, String param) {
-        super(msgFormat, param);
-    }
-
-    /**
-     * Constructs a CA exception.
-     * <P>
-     *
-     * @param msgFormat constant from CAResources.
      * @param e embedded exception.
      */
     public ECAException(String msgFormat, Exception e) {
diff --git a/base/common/src/com/netscape/certsrv/dbs/EDBException.java b/base/common/src/com/netscape/certsrv/dbs/EDBException.java
index 1908bdf7ed2e9a8222c8556c9563645d316ed277..279b9fb70834a35104307d32512ad58c3e221e4e 100644
--- a/base/common/src/com/netscape/certsrv/dbs/EDBException.java
+++ b/base/common/src/com/netscape/certsrv/dbs/EDBException.java
@@ -51,17 +51,6 @@ public class EDBException extends EBaseException {
      * <P>
      *
      * @param msgFormat message format
-     * @param param parameter
-     */
-    public EDBException(String msgFormat, String param) {
-        super(msgFormat, param);
-    }
-
-    /**
-     * Constructs a database exception.
-     * <P>
-     *
-     * @param msgFormat message format
      * @param e exception as parameter
      */
     public EDBException(String msgFormat, Exception e) {
diff --git a/base/common/src/com/netscape/certsrv/extensions/EExtensionsException.java b/base/common/src/com/netscape/certsrv/extensions/EExtensionsException.java
index 5374a466acce7884af6e72732fe8cd262097e8e2..e3ce3366e5c0ef0108d0ec5c0f29905f49a4f1a0 100644
--- a/base/common/src/com/netscape/certsrv/extensions/EExtensionsException.java
+++ b/base/common/src/com/netscape/certsrv/extensions/EExtensionsException.java
@@ -40,10 +40,6 @@ public class EExtensionsException extends EBaseException {
         super(msgFormat);
     }
 
-    public EExtensionsException(String msgFormat, String param) {
-        super(msgFormat, param);
-    }
-
     public EExtensionsException(String msgFormat, Exception e) {
         super(msgFormat, e);
     }
diff --git a/base/common/src/com/netscape/certsrv/jobs/EJobsException.java b/base/common/src/com/netscape/certsrv/jobs/EJobsException.java
index 38b9db6b9214a9f1d0e500b34b9c25d0433b1eb1..8632d6ca3335400312f8a5eae519e89175585183 100644
--- a/base/common/src/com/netscape/certsrv/jobs/EJobsException.java
+++ b/base/common/src/com/netscape/certsrv/jobs/EJobsException.java
@@ -48,14 +48,6 @@ public class EJobsException extends EBaseException {
      * Constructs a Identity exception.
      * <P>
      */
-    public EJobsException(String msgFormat, String param) {
-        super(msgFormat, param);
-    }
-
-    /**
-     * Constructs a Identity exception.
-     * <P>
-     */
     public EJobsException(String msgFormat, Exception e) {
         super(msgFormat, e);
     }
diff --git a/base/common/src/com/netscape/certsrv/kra/EKRAException.java b/base/common/src/com/netscape/certsrv/kra/EKRAException.java
index a42e8f409b76ea947d08e771a27d580446a996f9..c2b802078af5aeb096ad33f09d4c5cce71c1ea1a 100644
--- a/base/common/src/com/netscape/certsrv/kra/EKRAException.java
+++ b/base/common/src/com/netscape/certsrv/kra/EKRAException.java
@@ -54,17 +54,6 @@ public class EKRAException extends EBaseException {
      * <P>
      *
      * @param msgFormat constant from KRAResources.
-     * @param param additional parameters to the message.
-     */
-    public EKRAException(String msgFormat, String param) {
-        super(msgFormat, param);
-    }
-
-    /**
-     * Constructs a KRA exception.
-     * <P>
-     *
-     * @param msgFormat constant from KRAResources.
      * @param e embedded exception.
      */
     public EKRAException(String msgFormat, Exception e) {
diff --git a/base/common/src/com/netscape/certsrv/ldap/ELdapException.java b/base/common/src/com/netscape/certsrv/ldap/ELdapException.java
index 57d7ca9585d24329cc016b3c30a03c04fea4a0c8..2f4943c6d4869d96931f3aeea1a96943c259cfca 100644
--- a/base/common/src/com/netscape/certsrv/ldap/ELdapException.java
+++ b/base/common/src/com/netscape/certsrv/ldap/ELdapException.java
@@ -51,18 +51,6 @@ public class ELdapException extends EBaseException {
      * Constructs a Ldap exception.
      *
      * @param msgFormat Resource Key, if key not present, serves as the message.
-     *            Include a message string parameter for variable content.
-     * @param param Message string parameter.
-     *            <P>
-     */
-    public ELdapException(String msgFormat, String param) {
-        super(msgFormat, param);
-    }
-
-    /**
-     * Constructs a Ldap exception.
-     *
-     * @param msgFormat Resource Key, if key not present, serves as the message.
      * @param e Common exception.
      *            <P>
      */
diff --git a/base/common/src/com/netscape/certsrv/listeners/EListenersException.java b/base/common/src/com/netscape/certsrv/listeners/EListenersException.java
index 1169de0b17658a39a216b962cfcf06df42947f85..e1db15209f69a612e9843d20ad1521ade206e6ff 100644
--- a/base/common/src/com/netscape/certsrv/listeners/EListenersException.java
+++ b/base/common/src/com/netscape/certsrv/listeners/EListenersException.java
@@ -47,17 +47,6 @@ public class EListenersException extends EBaseException {
     }
 
     /**
-     * Constructs a listeners exception.
-     * <P>
-     *
-     * @param msgFormat exception details in message string format.
-     * @param param message string parameter.
-     */
-    public EListenersException(String msgFormat, String param) {
-        super(msgFormat, param);
-    }
-
-    /**
      * Constructs a Listeners exception.
      * <P>
      *
diff --git a/base/common/src/com/netscape/certsrv/notification/ENotificationException.java b/base/common/src/com/netscape/certsrv/notification/ENotificationException.java
index 096d6e3a5674d2544fe01e7e79f45376b29087b1..13371d9b7bf377bdd9d0f84747394be5061f86b1 100644
--- a/base/common/src/com/netscape/certsrv/notification/ENotificationException.java
+++ b/base/common/src/com/netscape/certsrv/notification/ENotificationException.java
@@ -48,14 +48,6 @@ public class ENotificationException extends EBaseException {
      * Constructs a Identity exception.
      * <P>
      */
-    public ENotificationException(String msgFormat, String param) {
-        super(msgFormat, param);
-    }
-
-    /**
-     * Constructs a Identity exception.
-     * <P>
-     */
     public ENotificationException(String msgFormat, Exception e) {
         super(msgFormat, e);
     }
diff --git a/base/common/src/com/netscape/certsrv/password/EPasswordCheckException.java b/base/common/src/com/netscape/certsrv/password/EPasswordCheckException.java
index 6b2459759c6da166a831b774bff009ef8a163d45..7ed8d90602317535a11828ab920b75e3c932c743 100644
--- a/base/common/src/com/netscape/certsrv/password/EPasswordCheckException.java
+++ b/base/common/src/com/netscape/certsrv/password/EPasswordCheckException.java
@@ -52,17 +52,6 @@ public class EPasswordCheckException extends EBaseException {
      * <P>
      *
      * @param msgFormat exception details in message string format
-     * @param param message string parameter
-     */
-    public EPasswordCheckException(String msgFormat, String param) {
-        super(msgFormat, param);
-    }
-
-    /**
-     * Constructs a password checker exception.
-     * <P>
-     *
-     * @param msgFormat exception details in message string format
      * @param exception system exception
      */
     public EPasswordCheckException(String msgFormat, Exception exception) {
diff --git a/base/common/src/com/netscape/certsrv/usrgrp/EUsrGrpException.java b/base/common/src/com/netscape/certsrv/usrgrp/EUsrGrpException.java
index cce9f3f3da35a69655c6b4bfa3656840f827e214..dff02cb4123e4f3a0db84119695db683dd9fcfa0 100644
--- a/base/common/src/com/netscape/certsrv/usrgrp/EUsrGrpException.java
+++ b/base/common/src/com/netscape/certsrv/usrgrp/EUsrGrpException.java
@@ -49,17 +49,6 @@ public class EUsrGrpException extends EBaseException {
     /**
      * Constructs a Identity exception.
      *
-     * @param msgFormat exception details in message string format
-     * @param param message string parameter
-     *            <P>
-     */
-    public EUsrGrpException(String msgFormat, String param) {
-        super(msgFormat, param);
-    }
-
-    /**
-     * Constructs a Identity exception.
-     *
      * @param e system exception
      *            <P>
      */
diff --git a/base/ocsp/src/com/netscape/ocsp/EOCSPException.java b/base/ocsp/src/com/netscape/ocsp/EOCSPException.java
index 1c878ad75b00b45ac4788cf1dfc33b173fb32a52..30574891fd8d7bd208dc50b055627e85f895408a 100644
--- a/base/ocsp/src/com/netscape/ocsp/EOCSPException.java
+++ b/base/ocsp/src/com/netscape/ocsp/EOCSPException.java
@@ -48,14 +48,6 @@ public class EOCSPException extends EBaseException {
      * Constructs a OCSP exception.
      * <P>
      */
-    public EOCSPException(String msgFormat, String param) {
-        super(msgFormat, param);
-    }
-
-    /**
-     * Constructs a OCSP exception.
-     * <P>
-     */
     public EOCSPException(String msgFormat, Exception e) {
         super(msgFormat, e);
     }
diff --git a/base/server/cms/src/com/netscape/cms/authentication/DNPattern.java b/base/server/cms/src/com/netscape/cms/authentication/DNPattern.java
index ccee3b51284b0a84c6889bfd05099c84d2b48a70..c62af4afcf794d5a5f025cf107535c7bf93e200a 100644
--- a/base/server/cms/src/com/netscape/cms/authentication/DNPattern.java
+++ b/base/server/cms/src/com/netscape/cms/authentication/DNPattern.java
@@ -163,7 +163,7 @@ public class DNPattern {
             try {
                 lastChar = in.read();
             } catch (IOException e) {
-                throw new EAuthException("CMS_AUTHENTICATION_INTERNAL_ERROR", e.toString());
+                throw new EAuthException("CMS_AUTHENTICATION_INTERNAL_ERROR", e);
             }
         } while (lastChar == ',');
 
diff --git a/base/server/cms/src/com/netscape/cms/servlet/common/ECMSGWException.java b/base/server/cms/src/com/netscape/cms/servlet/common/ECMSGWException.java
index 2c24c112a0e005ef2ad545cb2bc5d2c934972fe8..68a05c4f3a7eccd6d04d634d20466af751c35b6b 100644
--- a/base/server/cms/src/com/netscape/cms/servlet/common/ECMSGWException.java
+++ b/base/server/cms/src/com/netscape/cms/servlet/common/ECMSGWException.java
@@ -48,14 +48,6 @@ public class ECMSGWException extends EBaseException {
      * Constructs a CMSGW exception.
      * <P>
      */
-    public ECMSGWException(String msgFormat, String param) {
-        super(msgFormat, param);
-    }
-
-    /**
-     * Constructs a CMSGW exception.
-     * <P>
-     */
     public ECMSGWException(String msgFormat, Exception e) {
         super(msgFormat, e);
     }
-- 
1.8.4.2


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]