james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fel...@apache.org
Subject svn commit: r1078722 - in /james/mailbox/trunk/api/src/main/java/org/apache/james/mailbox: Content.java MailboxQuery.java MessageResult.java SearchQuery.java util/FetchGroupImpl.java util/MailboxEventDispatcher.java util/MessageResultImpl.java
Date Mon, 07 Mar 2011 09:28:50 GMT
Author: felixk
Date: Mon Mar  7 09:28:49 2011
New Revision: 1078722

URL: http://svn.apache.org/viewvc?rev=1078722&view=rev
Log:
Fix various PMD report findings.

Modified:
    james/mailbox/trunk/api/src/main/java/org/apache/james/mailbox/Content.java
    james/mailbox/trunk/api/src/main/java/org/apache/james/mailbox/MailboxQuery.java
    james/mailbox/trunk/api/src/main/java/org/apache/james/mailbox/MessageResult.java
    james/mailbox/trunk/api/src/main/java/org/apache/james/mailbox/SearchQuery.java
    james/mailbox/trunk/api/src/main/java/org/apache/james/mailbox/util/FetchGroupImpl.java
    james/mailbox/trunk/api/src/main/java/org/apache/james/mailbox/util/MailboxEventDispatcher.java
    james/mailbox/trunk/api/src/main/java/org/apache/james/mailbox/util/MessageResultImpl.java

Modified: james/mailbox/trunk/api/src/main/java/org/apache/james/mailbox/Content.java
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/api/src/main/java/org/apache/james/mailbox/Content.java?rev=1078722&r1=1078721&r2=1078722&view=diff
==============================================================================
--- james/mailbox/trunk/api/src/main/java/org/apache/james/mailbox/Content.java (original)
+++ james/mailbox/trunk/api/src/main/java/org/apache/james/mailbox/Content.java Mon Mar  7
09:28:49 2011
@@ -22,8 +22,6 @@ package org.apache.james.mailbox;
 import java.io.IOException;
 import java.nio.channels.WritableByteChannel;
 
-import javax.mail.MessagingException;
-
 /**
  * IMAP needs to know the size of the content before it starts to write it
  * out. This interface allows direct writing whilst exposing total size.

Modified: james/mailbox/trunk/api/src/main/java/org/apache/james/mailbox/MailboxQuery.java
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/api/src/main/java/org/apache/james/mailbox/MailboxQuery.java?rev=1078722&r1=1078721&r2=1078722&view=diff
==============================================================================
--- james/mailbox/trunk/api/src/main/java/org/apache/james/mailbox/MailboxQuery.java (original)
+++ james/mailbox/trunk/api/src/main/java/org/apache/james/mailbox/MailboxQuery.java Mon Mar
 7 09:28:49 2011
@@ -212,12 +212,11 @@ public class MailboxQuery {
             boolean matchRest = false;
             for (int i = nameIndex; i < name.length(); i++) {
                 final char tasteNextName = name.charAt(i);
-                if (expressionNextNormal == tasteNextName) {
-                    if (isWildcardMatch(name, i, nextNormal)) {
-                        matchRest = true;
-                        break;
-                    }
-                }
+		if ((expressionNextNormal == tasteNextName)
+			&& (isWildcardMatch(name, i, nextNormal))) {
+		    matchRest = true;
+		    break;
+		}
             }
             result = matchRest;
         } else {

Modified: james/mailbox/trunk/api/src/main/java/org/apache/james/mailbox/MessageResult.java
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/api/src/main/java/org/apache/james/mailbox/MessageResult.java?rev=1078722&r1=1078721&r2=1078722&view=diff
==============================================================================
--- james/mailbox/trunk/api/src/main/java/org/apache/james/mailbox/MessageResult.java (original)
+++ james/mailbox/trunk/api/src/main/java/org/apache/james/mailbox/MessageResult.java Mon
Mar  7 09:28:49 2011
@@ -24,7 +24,6 @@ import java.util.Iterator;
 import java.util.Set;
 
 import javax.mail.Flags;
-import javax.mail.MessagingException;
 
 
 /**

Modified: james/mailbox/trunk/api/src/main/java/org/apache/james/mailbox/SearchQuery.java
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/api/src/main/java/org/apache/james/mailbox/SearchQuery.java?rev=1078722&r1=1078721&r2=1078722&view=diff
==============================================================================
--- james/mailbox/trunk/api/src/main/java/org/apache/james/mailbox/SearchQuery.java (original)
+++ james/mailbox/trunk/api/src/main/java/org/apache/james/mailbox/SearchQuery.java Mon Mar
 7 09:28:49 2011
@@ -502,11 +502,11 @@ public class SearchQuery {
             this.highValue = highValue;
         }
 
-        public final long getHighValue() {
+        public long getHighValue() {
             return highValue;
         }
 
-        public final long getLowValue() {
+        public long getLowValue() {
             return lowValue;
         }
 
@@ -598,7 +598,7 @@ public class SearchQuery {
          * 
          * @return <code>List</code> of {@link Criterion}
          */
-        public final List<Criterion> getCriteria() {
+        public List<Criterion> getCriteria() {
             return criteria;
         }
 
@@ -607,7 +607,7 @@ public class SearchQuery {
          * 
          * @return not null
          */
-        public final Conjunction getType() {
+        public Conjunction getType() {
             return type;
         }
 
@@ -671,7 +671,7 @@ public class SearchQuery {
     public static final class AllCriterion extends Criterion {
         private static final AllCriterion ALL = new AllCriterion();
 
-        private static final Criterion all() {
+        private static Criterion all() {
             return ALL;
         }
 
@@ -724,7 +724,7 @@ public class SearchQuery {
          * 
          * @return not null
          */
-        public final Scope getType() {
+        public Scope getType() {
             return type;
         }
 
@@ -733,7 +733,7 @@ public class SearchQuery {
          * 
          * @return the <code>Operator</code>, not null
          */
-        public final ContainsOperator getOperator() {
+        public ContainsOperator getOperator() {
             return operator;
         }
 
@@ -810,7 +810,7 @@ public class SearchQuery {
          * 
          * @return the headerName
          */
-        public final String getHeaderName() {
+        public String getHeaderName() {
             return headerName;
         }
 
@@ -819,7 +819,7 @@ public class SearchQuery {
          * 
          * @return the <code>Operator</code>, not null
          */
-        public final HeaderOperator getOperator() {
+        public HeaderOperator getOperator() {
             return operator;
         }
 
@@ -898,7 +898,7 @@ public class SearchQuery {
          * 
          * @return the <code>Operator</code>, not null
          */
-        public final DateOperator getOperator() {
+        public DateOperator getOperator() {
             return operator;
         }
 
@@ -968,7 +968,7 @@ public class SearchQuery {
          * 
          * @return the <code>NumericOperator</code>, not null
          */
-        public final NumericOperator getOperator() {
+        public NumericOperator getOperator() {
             return operator;
         }
 
@@ -1042,7 +1042,7 @@ public class SearchQuery {
          * 
          * @return the flag name, not null
          */
-        public final String getFlag() {
+        public String getFlag() {
             return flag;
         }
 
@@ -1051,7 +1051,7 @@ public class SearchQuery {
          * 
          * @return the <code>BooleanOperator</code>, not null
          */
-        public final BooleanOperator getOperator() {
+        public BooleanOperator getOperator() {
             return operator;
         }
 
@@ -1131,7 +1131,7 @@ public class SearchQuery {
          * 
          * @return the flag, not null
          */
-        public final Flag getFlag() {
+        public Flag getFlag() {
             return flag;
         }
 
@@ -1140,7 +1140,7 @@ public class SearchQuery {
          * 
          * @return the <code>BooleanOperator</code>, not null
          */
-        public final BooleanOperator getOperator() {
+        public BooleanOperator getOperator() {
             return operator;
         }
 
@@ -1218,7 +1218,7 @@ public class SearchQuery {
          * 
          * @return the <code>InOperator</code>
          */
-        public final InOperator getOperator() {
+        public InOperator getOperator() {
             return operator;
         }
 
@@ -1301,7 +1301,7 @@ public class SearchQuery {
          * 
          * @return the value
          */
-        public final String getValue() {
+        public String getValue() {
             return value;
         }
 
@@ -1360,7 +1360,7 @@ public class SearchQuery {
     public static final class ExistsOperator implements HeaderOperator {
         private static final ExistsOperator EXISTS = new ExistsOperator();
 
-        public static final ExistsOperator exists() {
+        public static ExistsOperator exists() {
             return EXISTS;
         }
 
@@ -1399,11 +1399,11 @@ public class SearchQuery {
 
         private static final BooleanOperator UNSET = new BooleanOperator(false);
 
-        public static final BooleanOperator set() {
+        public static BooleanOperator set() {
             return SET;
         }
 
-        public static final BooleanOperator unset() {
+        public static BooleanOperator unset() {
             return UNSET;
         }
 
@@ -1420,7 +1420,7 @@ public class SearchQuery {
          * @return true indicates that set values should be selected, false
          *         indicates that unset values should be selected
          */
-        public final boolean isSet() {
+        public boolean isSet() {
             return set;
         }
 
@@ -1500,7 +1500,7 @@ public class SearchQuery {
          * 
          * @return not null
          */
-        public final NumericComparator getType() {
+        public NumericComparator getType() {
             return type;
         }
 
@@ -1509,7 +1509,7 @@ public class SearchQuery {
          * 
          * @return the value
          */
-        public final long getValue() {
+        public long getValue() {
             return value;
         }
 
@@ -1598,7 +1598,7 @@ public class SearchQuery {
          * 
          * @return the day, one based
          */
-        public final int getDay() {
+        public int getDay() {
             return day;
         }
 
@@ -1607,7 +1607,7 @@ public class SearchQuery {
          * 
          * @return the month, one based
          */
-        public final int getMonth() {
+        public int getMonth() {
             return month;
         }
 
@@ -1617,7 +1617,7 @@ public class SearchQuery {
          * @return the type, either {@link #BEFORE}, {@link #AFTER} or
          *         {@link ON}
          */
-        public final DateComparator getType() {
+        public DateComparator getType() {
             return type;
         }
 
@@ -1626,7 +1626,7 @@ public class SearchQuery {
          * 
          * @return the year
          */
-        public final int getYear() {
+        public int getYear() {
             return year;
         }
 
@@ -1705,7 +1705,7 @@ public class SearchQuery {
          * 
          * @return the <code>NumericRange</code>'s search on, not null
          */
-        public final NumericRange[] getRange() {
+        public NumericRange[] getRange() {
             return range;
         }
 

Modified: james/mailbox/trunk/api/src/main/java/org/apache/james/mailbox/util/FetchGroupImpl.java
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/api/src/main/java/org/apache/james/mailbox/util/FetchGroupImpl.java?rev=1078722&r1=1078721&r2=1078722&view=diff
==============================================================================
--- james/mailbox/trunk/api/src/main/java/org/apache/james/mailbox/util/FetchGroupImpl.java
(original)
+++ james/mailbox/trunk/api/src/main/java/org/apache/james/mailbox/util/FetchGroupImpl.java
Mon Mar  7 09:28:49 2011
@@ -24,7 +24,6 @@ import java.util.Iterator;
 import java.util.Set;
 
 import org.apache.james.mailbox.MessageResult;
-import org.apache.james.mailbox.MessageResult.FetchGroup;
 import org.apache.james.mailbox.MessageResult.MimePath;
 
 /**

Modified: james/mailbox/trunk/api/src/main/java/org/apache/james/mailbox/util/MailboxEventDispatcher.java
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/api/src/main/java/org/apache/james/mailbox/util/MailboxEventDispatcher.java?rev=1078722&r1=1078721&r2=1078722&view=diff
==============================================================================
--- james/mailbox/trunk/api/src/main/java/org/apache/james/mailbox/util/MailboxEventDispatcher.java
(original)
+++ james/mailbox/trunk/api/src/main/java/org/apache/james/mailbox/util/MailboxEventDispatcher.java
Mon Mar  7 09:28:49 2011
@@ -182,7 +182,7 @@ public class MailboxEventDispatcher impl
     private final static class FlagsUpdatedImpl extends
             MailboxListener.FlagsUpdated {
 
-        private static final boolean isChanged(final Flags original,
+        private static boolean isChanged(final Flags original,
                 final Flags updated, Flags.Flag flag) {
             return original != null && updated != null
                     && (original.contains(flag) ^ updated.contains(flag));
@@ -261,12 +261,11 @@ public class MailboxEventDispatcher impl
             }
 
             private void nextPosition() {
-                if (position < NUMBER_OF_SYSTEM_FLAGS) {
-                    if (!modifiedFlags[position]) {
-                        position++;
-                        nextPosition();
-                    }
-                }
+		if ((position < NUMBER_OF_SYSTEM_FLAGS)
+			&& (!modifiedFlags[position])) {
+		    position++;
+		    nextPosition();
+		}
             }
 
             /*

Modified: james/mailbox/trunk/api/src/main/java/org/apache/james/mailbox/util/MessageResultImpl.java
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/api/src/main/java/org/apache/james/mailbox/util/MessageResultImpl.java?rev=1078722&r1=1078721&r2=1078722&view=diff
==============================================================================
--- james/mailbox/trunk/api/src/main/java/org/apache/james/mailbox/util/MessageResultImpl.java
(original)
+++ james/mailbox/trunk/api/src/main/java/org/apache/james/mailbox/util/MessageResultImpl.java
Mon Mar  7 09:28:49 2011
@@ -328,47 +328,47 @@ public class MessageResultImpl implement
 
         private int content;
 
-        public final Content getBody() {
+        public Content getBody() {
             return body;
         }
 
-        public final void setBody(Content body) {
+        public void setBody(Content body) {
             content = content | FetchGroup.BODY_CONTENT;
             this.body = body;
         }
 
-        public final Content getMimeBody() {
+        public Content getMimeBody() {
             return mimeBody;
         }
 
-        public final void setMimeBody(Content mimeBody) {
+        public void setMimeBody(Content mimeBody) {
             content = content | FetchGroup.MIME_CONTENT;
             this.mimeBody = mimeBody;
         }
 
-        public final Content getFull() {
+        public Content getFull() {
             return full;
         }
 
-        public final void setFull(Content full) {
+        public void setFull(Content full) {
             content = content | FetchGroup.FULL_CONTENT;
             this.full = full;
         }
 
-        public final Iterator<Header> getHeaders() {
+        public Iterator<Header> getHeaders() {
             return headers;
         }
 
-        public final void setHeaders(Iterator<Header> headers) {
+        public void setHeaders(Iterator<Header> headers) {
             content = content | FetchGroup.HEADERS;
             this.headers = headers;
         }
 
-        public final Iterator<Header> getMimeHeaders() {
+        public Iterator<Header> getMimeHeaders() {
             return mimeHeaders;
         }
 
-        public final void setMimeHeaders(Iterator<Header> mimeHeaders) {
+        public void setMimeHeaders(Iterator<Header> mimeHeaders) {
             content = content | FetchGroup.MIME_HEADERS;
             this.mimeHeaders = mimeHeaders;
         }



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message