From 7ccac7a9e0bc681396038e99e475b0c1a7b16bf4 Mon Sep 17 00:00:00 2001
From: Matthew Swift <matthew.swift@forgerock.com>
Date: Sat, 18 Jan 2014 01:05:03 +0000
Subject: [PATCH] Simplify config framework exception hierarchy by removing AdminRuntimeException.
---
/dev/null | 90 ---------------------------------------------
opendj-sdk/opendj3-server-dev/src/server/org/opends/server/admin/PropertyException.java | 24 ++++++++++-
2 files changed, 21 insertions(+), 93 deletions(-)
diff --git a/opendj-sdk/opendj3-server-dev/src/server/org/opends/server/admin/AdminRuntimeException.java b/opendj-sdk/opendj3-server-dev/src/server/org/opends/server/admin/AdminRuntimeException.java
deleted file mode 100644
index 826244a..0000000
--- a/opendj-sdk/opendj3-server-dev/src/server/org/opends/server/admin/AdminRuntimeException.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
- * or http://forgerock.org/license/CDDLv1.0.html.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at legal-notices/CDDLv1_0.txt.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information:
- * Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- *
- *
- * Copyright 2008-2009 Sun Microsystems, Inc.
- */
-
-package org.opends.server.admin;
-
-
-
-import org.opends.messages.Message;
-
-
-
-/**
- * Exceptions thrown when interacting with administration framework
- * that applications are not expected to catch.
- */
-public abstract class AdminRuntimeException extends RuntimeException {
-
- /**
- * Fake serialization ID.
- */
- private static final long serialVersionUID = 1L;
-
-
-
- // Message that explains the problem.
- private final Message message;
-
-
-
- /**
- * Create an admin runtime exception with a message and cause.
- *
- * @param message
- * The message.
- * @param cause
- * The cause.
- */
- protected AdminRuntimeException(Message message, Throwable cause) {
- super(message.toString(), cause);
- this.message = message;
- }
-
-
-
- /**
- * Create an admin runtime exception with a message.
- *
- * @param message
- * The message.
- */
- protected AdminRuntimeException(Message message) {
- super(message.toString());
- this.message = message;
- }
-
-
-
- /**
- * Returns the message that explains the problem that occurred.
- *
- * @return Returns the message describing the problem that occurred
- * (never <code>null</code>).
- */
- public Message getMessageObject() {
- return this.message;
- }
-}
diff --git a/opendj-sdk/opendj3-server-dev/src/server/org/opends/server/admin/PropertyException.java b/opendj-sdk/opendj3-server-dev/src/server/org/opends/server/admin/PropertyException.java
index 5134d1f..a1d0f8c 100644
--- a/opendj-sdk/opendj3-server-dev/src/server/org/opends/server/admin/PropertyException.java
+++ b/opendj-sdk/opendj3-server-dev/src/server/org/opends/server/admin/PropertyException.java
@@ -39,7 +39,7 @@
* Exceptions thrown as a result of errors that occurred when decoding and
* modifying property values.
*/
-public final class PropertyException extends AdminRuntimeException
+public final class PropertyException extends RuntimeException
{
/**
@@ -183,6 +183,9 @@
+ // Message that explains the problem.
+ private final Message message;
+
/*
* The property definition associated with the property that caused the
* exception.
@@ -193,7 +196,8 @@
private PropertyException(PropertyDefinition<?> pd, Message message)
{
- super(message);
+ super(message.toString());
+ this.message = message;
this.pd = pd;
}
@@ -202,13 +206,27 @@
private PropertyException(PropertyDefinition<?> pd, Message message,
Throwable cause)
{
- super(message, cause);
+ super(message.toString(), cause);
+ this.message = message;
this.pd = pd;
}
/**
+ * Returns the message that explains the problem that occurred.
+ *
+ * @return Returns the message describing the problem that occurred (never
+ * <code>null</code>).
+ */
+ public Message getMessageObject()
+ {
+ return message;
+ }
+
+
+
+ /**
* Get the property definition associated with the property that caused the
* exception.
*
--
Gitblit v1.10.0