cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r762440 - in /incubator/cassandra/trunk/src/org/apache/cassandra: continuations/ db/ net/ service/
Date Mon, 06 Apr 2009 17:55:53 GMT
Author: jbellis
Date: Mon Apr  6 17:55:52 2009
New Revision: 762440

URL: http://svn.apache.org/viewvc?rev=762440&view=rev
Log:
replace .indexOf != -1 with .contains.  patch by jbellis; reviewed by johano for #56

Modified:
    incubator/cassandra/trunk/src/org/apache/cassandra/continuations/ContinuationClassTransformer.java
    incubator/cassandra/trunk/src/org/apache/cassandra/db/Table.java
    incubator/cassandra/trunk/src/org/apache/cassandra/net/MessagingService.java
    incubator/cassandra/trunk/src/org/apache/cassandra/service/HttpRequestVerbHandler.java
    incubator/cassandra/trunk/src/org/apache/cassandra/service/StorageService.java
    incubator/cassandra/trunk/src/org/apache/cassandra/service/ZookeeperWatcher.java

Modified: incubator/cassandra/trunk/src/org/apache/cassandra/continuations/ContinuationClassTransformer.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/org/apache/cassandra/continuations/ContinuationClassTransformer.java?rev=762440&r1=762439&r2=762440&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/org/apache/cassandra/continuations/ContinuationClassTransformer.java
(original)
+++ incubator/cassandra/trunk/src/org/apache/cassandra/continuations/ContinuationClassTransformer.java
Mon Apr  6 17:55:52 2009
@@ -64,7 +64,7 @@
         
         for( AnnotationNode annotationNode : annotationNodes )
         {            
-            if ( annotationNode.desc.indexOf(ContinuationClassTransformer.targetAnnotation_)
!= -1 )
+            if (annotationNode.desc.contains(ContinuationClassTransformer.targetAnnotation_))
             {                
                 bytes = transformer_.transform(bytes);
             }

Modified: incubator/cassandra/trunk/src/org/apache/cassandra/db/Table.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/org/apache/cassandra/db/Table.java?rev=762440&r1=762439&r2=762440&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/org/apache/cassandra/db/Table.java (original)
+++ incubator/cassandra/trunk/src/org/apache/cassandra/db/Table.java Mon Apr  6 17:55:52 2009
@@ -272,7 +272,7 @@
         public void onStreamCompletion(String host, StreamContextManager.StreamContext streamContext,
StreamContextManager.StreamStatus streamStatus) throws IOException
         {                        
             /* Parse the stream context and the file to the list of SSTables in the associated
Column Family Store. */            
-            if ( streamContext.getTargetFile().indexOf("-Data.db") != -1 )
+            if (streamContext.getTargetFile().contains("-Data.db"))
             {
                 File file = new File( streamContext.getTargetFile() );
                 String fileName = file.getName();

Modified: incubator/cassandra/trunk/src/org/apache/cassandra/net/MessagingService.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/org/apache/cassandra/net/MessagingService.java?rev=762440&r1=762439&r2=762440&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/org/apache/cassandra/net/MessagingService.java (original)
+++ incubator/cassandra/trunk/src/org/apache/cassandra/net/MessagingService.java Mon Apr 
6 17:55:52 2009
@@ -368,7 +368,7 @@
         while(keys.hasNext())
         {
             key = (String)keys.next();
-            if(-1 != key.indexOf(localEndPoint.toString()))
+            if (key.contains(localEndPoint.toString()))
                 keys.remove();
         }
     }

Modified: incubator/cassandra/trunk/src/org/apache/cassandra/service/HttpRequestVerbHandler.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/org/apache/cassandra/service/HttpRequestVerbHandler.java?rev=762440&r1=762439&r2=762440&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/org/apache/cassandra/service/HttpRequestVerbHandler.java
(original)
+++ incubator/cassandra/trunk/src/org/apache/cassandra/service/HttpRequestVerbHandler.java
Mon Apr  6 17:55:52 2009
@@ -122,7 +122,7 @@
          */
         String path = httpRequest.getPath();
         /* for the health checks, just return the string only */
-        if(path.indexOf(LB_HEALTH_CHECK) != -1)
+        if(path.contains(LB_HEALTH_CHECK))
         {
         	httpResponse.println(handleLBHealthCheck());
             return;
@@ -134,23 +134,23 @@
         StringBuilder sbResult = new StringBuilder();
         do
         {
-            if(query.indexOf(DETAILS) != -1)
+            if(query.contains(DETAILS))
             {
                 fServeSummary = false;
                 sbResult.append(handleNodeDetails());
                 break;
             }
-            else if(query.indexOf(LOADME) != -1)
+            else if(query.contains(LOADME))
             {
                 sbResult.append(handleLoadMe());
                 break;
             }
-            else if(query.indexOf(KILLME) != -1)
+            else if(query.contains(KILLME))
             {
                 sbResult.append(handleKillMe());
                 break;
             }
-            else if(query.indexOf(COMPACTME) != -1)
+            else if(query.contains(COMPACTME))
             {
                 sbResult.append(handleCompactMe());
                 break;
@@ -192,17 +192,17 @@
         StringBuilder sbResult = new StringBuilder();
         do
         {
-            if(query.indexOf(QUERY) != -1)
+            if(query.contains(QUERY))
             {
                 sbResult.append(handleQuery(httpRequest));
                 break;
             }
-            else if(query.indexOf(INSERT) != -1)
+            else if(query.contains(INSERT))
             {
                 sbResult.append(handleInsert(httpRequest));
                 break;
             }
-            else if(query.indexOf(SCRIPT) != -1)
+            else if(query.contains(SCRIPT))
             {
                 sbResult.append(handleScript(httpRequest));
                 break;

Modified: incubator/cassandra/trunk/src/org/apache/cassandra/service/StorageService.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/org/apache/cassandra/service/StorageService.java?rev=762440&r1=762439&r2=762440&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/org/apache/cassandra/service/StorageService.java (original)
+++ incubator/cassandra/trunk/src/org/apache/cassandra/service/StorageService.java Mon Apr
 6 17:55:52 2009
@@ -357,7 +357,7 @@
                         String path = "/Cassandra/" + DatabaseDescriptor.getClusterName()
+ "/Leader";
                         String eventPath = we.getPath();
                         logger_.debug("PROCESS EVENT : " + eventPath);
-                        if ( eventPath != null && (eventPath.indexOf(path) != -1)
)
+                        if (eventPath != null && (eventPath.contains(path)))
                         {                                                           
                             logger_.debug("Signalling the leader instance ...");
                             LeaderElector.instance().signal();                          
             

Modified: incubator/cassandra/trunk/src/org/apache/cassandra/service/ZookeeperWatcher.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/org/apache/cassandra/service/ZookeeperWatcher.java?rev=762440&r1=762439&r2=762440&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/org/apache/cassandra/service/ZookeeperWatcher.java (original)
+++ incubator/cassandra/trunk/src/org/apache/cassandra/service/ZookeeperWatcher.java Mon Apr
 6 17:55:52 2009
@@ -34,7 +34,7 @@
     {                            
         String eventPath = we.getPath();
         logger_.debug("PROCESS EVENT : " + eventPath);
-        if ( eventPath != null && (eventPath.indexOf(leader_) != -1) )
+        if (eventPath != null && (eventPath.contains(leader_)))
         {                                                           
             logger_.debug("Signalling the leader instance ...");
             LeaderElector.instance().signal();                                        



Mime
View raw message