james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From matth...@apache.org
Subject svn commit: r1726767 - in /james/project/trunk: mailbox/maildir/src/test/java/org/apache/james/mailbox/maildir/ mailbox/store/src/main/java/org/apache/james/mailbox/store/search/ mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmail...
Date Tue, 26 Jan 2016 10:43:29 GMT
Author: matthieu
Date: Tue Jan 26 10:43:29 2016
New Revision: 1726767

URL: http://svn.apache.org/viewvc?rev=1726767&view=rev
Log:
JAMES-1669 replace indexOf by contains when possible

Modified:
    james/project/trunk/mailbox/maildir/src/test/java/org/apache/james/mailbox/maildir/OsDetector.java
    james/project/trunk/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/MessageSearches.java
    james/project/trunk/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/util/OsDetector.java
    james/project/trunk/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/MailAddress.java
    james/project/trunk/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/MailCmdHandler.java
    james/project/trunk/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/RcptCmdHandler.java

Modified: james/project/trunk/mailbox/maildir/src/test/java/org/apache/james/mailbox/maildir/OsDetector.java
URL: http://svn.apache.org/viewvc/james/project/trunk/mailbox/maildir/src/test/java/org/apache/james/mailbox/maildir/OsDetector.java?rev=1726767&r1=1726766&r2=1726767&view=diff
==============================================================================
--- james/project/trunk/mailbox/maildir/src/test/java/org/apache/james/mailbox/maildir/OsDetector.java
(original)
+++ james/project/trunk/mailbox/maildir/src/test/java/org/apache/james/mailbox/maildir/OsDetector.java
Tue Jan 26 10:43:29 2016
@@ -28,7 +28,7 @@ public class OsDetector {
      */
     public static boolean isWindows() {
         String os = System.getProperty("os.name").toLowerCase();
-        return (os.indexOf( "win" ) >= 0); 
+        return (os.contains("win"));
     }
     
     

Modified: james/project/trunk/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/MessageSearches.java
URL: http://svn.apache.org/viewvc/james/project/trunk/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/MessageSearches.java?rev=1726767&r1=1726766&r2=1726767&view=diff
==============================================================================
--- james/project/trunk/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/MessageSearches.java
(original)
+++ james/project/trunk/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/MessageSearches.java
Tue Jan 26 10:43:29 2016
@@ -420,7 +420,7 @@ public class MessageSearches implements
             if (headerName.equalsIgnoreCase(name)) {
                 final String value = header.getValue();
                 if (value != null) {
-                    if (value.toUpperCase().indexOf(text) > -1) {
+                    if (value.toUpperCase().contains(text)) {
                         result = true;
                         break;
                     }

Modified: james/project/trunk/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/util/OsDetector.java
URL: http://svn.apache.org/viewvc/james/project/trunk/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/util/OsDetector.java?rev=1726767&r1=1726766&r2=1726767&view=diff
==============================================================================
--- james/project/trunk/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/util/OsDetector.java
(original)
+++ james/project/trunk/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/util/OsDetector.java
Tue Jan 26 10:43:29 2016
@@ -28,7 +28,7 @@ public class OsDetector {
      */
     public static boolean isWindows() {
         String os = System.getProperty("os.name").toLowerCase();
-        return (os.indexOf( "win" ) >= 0); 
+        return (os.contains("win"));
     }
     
     

Modified: james/project/trunk/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/MailAddress.java
URL: http://svn.apache.org/viewvc/james/project/trunk/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/MailAddress.java?rev=1726767&r1=1726766&r2=1726767&view=diff
==============================================================================
--- james/project/trunk/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/MailAddress.java
(original)
+++ james/project/trunk/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/MailAddress.java
Tue Jan 26 10:43:29 2016
@@ -406,7 +406,7 @@ public class MailAddress {
 
     private int parseDomainLiteral(StringBuffer dSB, String address, int pos) throws MailAddressException
{
         //throw away all irrelevant '\' they're not necessary for escaping of '.' or digits,
and are illegal as part of the domain-literal
-        while(address.indexOf("\\")>-1){
+        while(address.contains("\\")){
              address= address.substring(0,address.indexOf("\\")) + address.substring(address.indexOf("\\")+1);
         }
         StringBuffer resultSB = new StringBuffer();

Modified: james/project/trunk/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/MailCmdHandler.java
URL: http://svn.apache.org/viewvc/james/project/trunk/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/MailCmdHandler.java?rev=1726767&r1=1726766&r2=1726767&view=diff
==============================================================================
--- james/project/trunk/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/MailCmdHandler.java
(original)
+++ james/project/trunk/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/MailCmdHandler.java
Tue Jan 26 10:43:29 2016
@@ -240,7 +240,7 @@ public class MailCmdHandler extends Abst
                 // This is the <> case. Let senderAddress == null
             } else {
 
-                if (sender.indexOf("@") < 0) {
+                if (!sender.contains("@")) {
                     sender = sender
                             + "@"
                             + getDefaultDomain();

Modified: james/project/trunk/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/RcptCmdHandler.java
URL: http://svn.apache.org/viewvc/james/project/trunk/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/RcptCmdHandler.java?rev=1726767&r1=1726766&r2=1726767&view=diff
==============================================================================
--- james/project/trunk/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/RcptCmdHandler.java
(original)
+++ james/project/trunk/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/RcptCmdHandler.java
Tue Jan 26 10:43:29 2016
@@ -150,7 +150,7 @@ public class RcptCmdHandler extends Abst
             recipient = recipient.substring(1, recipient.length() - 1);
         }
 
-        if (recipient.indexOf("@") < 0) {
+        if (!recipient.contains("@")) {
             // set the default domain
             recipient = recipient
                     + "@"



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