cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1142727 - in /cassandra/branches/cassandra-0.7: CHANGES.txt src/java/org/apache/cassandra/cli/CliMain.java
Date Mon, 04 Jul 2011 16:22:13 GMT
Author: jbellis
Date: Mon Jul  4 16:22:12 2011
New Revision: 1142727

URL: http://svn.apache.org/viewvc?rev=1142727&view=rev
Log:
improve cli treatment of multiline comments
patch by pyaskevich; reviewed by jbellis for CASSANDRA-2852

Modified:
    cassandra/branches/cassandra-0.7/CHANGES.txt
    cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/cli/CliMain.java

Modified: cassandra/branches/cassandra-0.7/CHANGES.txt
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/CHANGES.txt?rev=1142727&r1=1142726&r2=1142727&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/CHANGES.txt (original)
+++ cassandra/branches/cassandra-0.7/CHANGES.txt Mon Jul  4 16:22:12 2011
@@ -31,6 +31,7 @@
    (CASSANDRA-2841)
  * allow deleting a row and updating indexed columns in it in the
    same mutation (CASSANDRA-2773)
+ * improve cli treatment of multiline comments (CASSANDRA-2852)
 
 
 0.7.6

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/cli/CliMain.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/cli/CliMain.java?rev=1142727&r1=1142726&r2=1142727&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/cli/CliMain.java (original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/cli/CliMain.java Mon Jul
 4 16:22:12 2011
@@ -365,6 +365,8 @@ public class CliMain
         String line = "";
         String currentStatement = "";
 
+        boolean commentedBlock = false;
+
         while ((line = reader.readLine()) != null)
         {
             line = line.trim();
@@ -373,6 +375,18 @@ public class CliMain
             if (line.isEmpty() || line.startsWith("--"))
                 continue;
 
+            if (line.startsWith("/*"))
+                commentedBlock = true;
+
+            if (line.startsWith("*/") || line.endsWith("*/"))
+            {
+                commentedBlock = false;
+                continue;
+            }
+
+            if (commentedBlock) // skip commented lines
+                continue;
+
             currentStatement += line;
 
             if (line.endsWith(";"))



Mime
View raw message