Author: rdonkin
Date: Sun May 10 19:21:37 2009
New Revision: 773388

URL: http://svn.apache.org/viewvc?rev=773388&view=rev
Log:
Pull keys up into superclass. IMAP-72 
https://issues.apache.org/jira/browse/IMAP-72

Modified:
    
james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/MailboxException.java
    
james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/SubscriptionException.java

Modified: 
james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/MailboxException.java
URL: 
http://svn.apache.org/viewvc/james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/MailboxException.java?rev=773388&r1=773387&r2=773388&view=diff
==============================================================================
--- 
james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/MailboxException.java
 (original)
+++ 
james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/MailboxException.java
 Sun May 10 19:21:37 2009
@@ -21,10 +21,14 @@
 
 import javax.mail.MessagingException;
 
+import org.apache.james.imap.api.display.HumanReadableTextKey;
+
 public class MailboxException extends MessagingException {
 
-    private static final long serialVersionUID = -4076702573622808863L;
+    private static final long serialVersionUID = 4612761817238115904L;
 
+    private final HumanReadableTextKey key;
+    
     public MailboxException(final Exception cause) {
         this(cause.getMessage(), cause);
     }
@@ -36,13 +40,36 @@
     public MailboxException(final String message, final Throwable cause) {
         super(message);
         initCause(cause);
+        key = null;
     }
     
     public MailboxException(final String message, final Exception cause) {
         super(message, cause);
+        key = null;
     }
 
     public MailboxException(String message) {
         super(message);
+        key = null;
+    }
+    
+    public MailboxException(final HumanReadableTextKey key) {
+        super(key.toString());
+        this.key = key;
+    }
+
+    public MailboxException(final HumanReadableTextKey key, Throwable cause) {
+        super(key.getDefaultValue());
+        initCause(cause);
+        this.key = key;
+    }
+
+    /**
+     * Gets the message key.
+     * 
+     * @return the key, possibly null
+     */
+    public final HumanReadableTextKey getKey() {
+        return key;
     }
 }

Modified: 
james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/SubscriptionException.java
URL: 
http://svn.apache.org/viewvc/james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/SubscriptionException.java?rev=773388&r1=773387&r2=773388&view=diff
==============================================================================
--- 
james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/SubscriptionException.java
 (original)
+++ 
james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/SubscriptionException.java
 Sun May 10 19:21:37 2009
@@ -26,27 +26,13 @@
  */
 public class SubscriptionException extends MailboxException {
 
-    private static final long serialVersionUID = -2057022968413471837L;
-
-    private final HumanReadableTextKey key;
+    private static final long serialVersionUID = -4512372322774311468L;
 
     public SubscriptionException(final HumanReadableTextKey key) {
-        super(key.toString());
-        this.key = key;
+        super(key);
     }
 
     public SubscriptionException(final HumanReadableTextKey key, Throwable 
cause) {
-        super(cause);
-        this.key = key;
-    }
-
-    /**
-     * Gets the message key.
-     * 
-     * @return the key, possibly null
-     */
-    public final HumanReadableTextKey getKey() {
-        return key;
+        super(key, cause);
     }
-
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to