james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fel...@apache.org
Subject svn commit: r1092346 - in /james/mailbox/trunk: api/src/main/java/org/apache/james/mailbox/util/ jcr/src/main/java/org/apache/james/mailbox/jcr/mail/model/ store/src/main/java/org/apache/james/mailbox/store/
Date Thu, 14 Apr 2011 15:37:00 GMT
Author: felixk
Date: Thu Apr 14 15:37:00 2011
New Revision: 1092346

URL: http://svn.apache.org/viewvc?rev=1092346&view=rev
Log:
Some small performance improvements

Modified:
    james/mailbox/trunk/api/src/main/java/org/apache/james/mailbox/util/MessageResultImpl.java
    james/mailbox/trunk/jcr/src/main/java/org/apache/james/mailbox/jcr/mail/model/JCRHeader.java
    james/mailbox/trunk/jcr/src/main/java/org/apache/james/mailbox/jcr/mail/model/JCRMessage.java
    james/mailbox/trunk/jcr/src/main/java/org/apache/james/mailbox/jcr/mail/model/JCRProperty.java
    james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/MessageSearches.java

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=1092346&r1=1092345&r2=1092346&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
Thu Apr 14 15:37:00 2011
@@ -120,7 +120,7 @@ public class MessageResultImpl implement
     public int compareTo(MessageResult that) {
         if (this.uid > 0 && that.getUid() > 0) {
             // TODO: this seems inefficient
-            return new Long(uid).compareTo(new Long(that.getUid()));
+            return Long.valueOf(uid).compareTo(Long.valueOf(that.getUid()));
         } else {
             // TODO: throwing an undocumented untyped runtime seems wrong
             // TODO: if uids must be greater than zero then this should be

Modified: james/mailbox/trunk/jcr/src/main/java/org/apache/james/mailbox/jcr/mail/model/JCRHeader.java
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/jcr/src/main/java/org/apache/james/mailbox/jcr/mail/model/JCRHeader.java?rev=1092346&r1=1092345&r2=1092346&view=diff
==============================================================================
--- james/mailbox/trunk/jcr/src/main/java/org/apache/james/mailbox/jcr/mail/model/JCRHeader.java
(original)
+++ james/mailbox/trunk/jcr/src/main/java/org/apache/james/mailbox/jcr/mail/model/JCRHeader.java
Thu Apr 14 15:37:00 2011
@@ -89,7 +89,7 @@ public class JCRHeader extends AbstractC
     public int getLineNumber() {
         if (isPersistent()) {
             try {
-                return new Long(node.getProperty(LINENUMBER_PROPERTY).getLong()).intValue();
+                return (int)node.getProperty(LINENUMBER_PROPERTY).getLong();
             } catch (RepositoryException e) {
                 logger.error("Unable to access property " + FIELDNAME_PROPERTY, e);
             }

Modified: james/mailbox/trunk/jcr/src/main/java/org/apache/james/mailbox/jcr/mail/model/JCRMessage.java
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/jcr/src/main/java/org/apache/james/mailbox/jcr/mail/model/JCRMessage.java?rev=1092346&r1=1092345&r2=1092346&view=diff
==============================================================================
--- james/mailbox/trunk/jcr/src/main/java/org/apache/james/mailbox/jcr/mail/model/JCRMessage.java
(original)
+++ james/mailbox/trunk/jcr/src/main/java/org/apache/james/mailbox/jcr/mail/model/JCRMessage.java
Thu Apr 14 15:37:00 2011
@@ -397,7 +397,7 @@ public class JCRMessage extends Abstract
     protected int getBodyStartOctet() {
         if (isPersistent()) {
             try {
-                return new Long(node.getProperty(BODY_START_OCTET_PROPERTY).getLong()).intValue();
+                return (int)node.getProperty(BODY_START_OCTET_PROPERTY).getLong();
             } catch (RepositoryException e) {
                 logger.error("Unable to retrieve property " + TEXTUAL_LINE_COUNT_PROPERTY,
e);
 

Modified: james/mailbox/trunk/jcr/src/main/java/org/apache/james/mailbox/jcr/mail/model/JCRProperty.java
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/jcr/src/main/java/org/apache/james/mailbox/jcr/mail/model/JCRProperty.java?rev=1092346&r1=1092345&r2=1092346&view=diff
==============================================================================
--- james/mailbox/trunk/jcr/src/main/java/org/apache/james/mailbox/jcr/mail/model/JCRProperty.java
(original)
+++ james/mailbox/trunk/jcr/src/main/java/org/apache/james/mailbox/jcr/mail/model/JCRProperty.java
Thu Apr 14 15:37:00 2011
@@ -71,7 +71,7 @@ public class JCRProperty extends Abstrac
     public int getOrder() {
         if (isPersistent()) {
             try {
-                return new Long(node.getProperty(ORDER_PROPERTY).getLong()).intValue();
+                return (int)node.getProperty(ORDER_PROPERTY).getLong();
             } catch (RepositoryException e) {
                 logger.error("Unable to access Property " + ORDER_PROPERTY, e);
             }

Modified: james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/MessageSearches.java
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/MessageSearches.java?rev=1092346&r1=1092345&r2=1092346&view=diff
==============================================================================
--- james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/MessageSearches.java
(original)
+++ james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/MessageSearches.java
Thu Apr 14 15:37:00 2011
@@ -248,7 +248,7 @@ public class MessageSearches {
             result = isSet == message.isFlagged();
         } else if (flag == Flags.Flag.RECENT) {
             final long uid = message.getUid();
-            result = isSet == recentMessageUids.contains(new Long(uid));
+            result = isSet == recentMessageUids.contains(Long.valueOf(uid));
         } else if (flag == Flags.Flag.DELETED) {
             result = isSet == message.isDeleted();
         } else {



---------------------------------------------------------------------
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