You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2018/07/19 17:41:21 UTC

[02/50] tinkerpop git commit: Added final to parameters and style tweaks

Added final to parameters and style tweaks

Added missing final keywords to LabelledCounter.

Added 'this.' to generated code.

Corrected 'stack label' to 'step label' in comments.

Minor correction in comment


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/a97d3eda
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/a97d3eda
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/a97d3eda

Branch: refs/heads/TINKERPOP-1996
Commit: a97d3edaae2fba293c6a5b5d43277214a2fb3a9a
Parents: 320c143
Author: GCHQResearcher1337 <39...@users.noreply.github.com>
Authored: Wed Jun 13 09:46:22 2018 +0100
Committer: GCHQResearcher1337 <39...@users.noreply.github.com>
Committed: Wed Jun 13 10:11:08 2018 +0100

----------------------------------------------------------------------
 .../traverser/B_LP_NL_O_P_S_SE_SL_Traverser.java  |  8 ++++----
 .../traverser/B_LP_NL_O_S_SE_SL_Traverser.java    |  8 ++++----
 .../traverser/B_NL_O_S_SE_SL_Traverser.java       |  8 ++++----
 .../traverser/LP_NL_O_OB_P_S_SE_SL_Traverser.java |  8 ++++----
 .../traverser/LP_NL_O_OB_S_SE_SL_Traverser.java   |  8 ++++----
 .../traverser/NL_O_OB_S_SE_SL_Traverser.java      |  8 ++++----
 .../traversal/traverser/util/LabelledCounter.java | 18 +++++++++---------
 7 files changed, 33 insertions(+), 33 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a97d3eda/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/B_LP_NL_O_P_S_SE_SL_Traverser.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/B_LP_NL_O_P_S_SE_SL_Traverser.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/B_LP_NL_O_P_S_SE_SL_Traverser.java
index 3412965..c45e9a8 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/B_LP_NL_O_P_S_SE_SL_Traverser.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/B_LP_NL_O_P_S_SE_SL_Traverser.java
@@ -44,7 +44,7 @@ public class B_LP_NL_O_P_S_SE_SL_Traverser<T> extends B_LP_O_P_S_SE_SL_Traverser
 
     @Override
     public void incrLoops(final String stepLabel) {
-        // If we encounter a new stack label then grow the stack otherwise increment the loop count
+        // If we encounter a new step label then grow the stack otherwise increment the loop count
         if (this.nestedLoops.size() == 0 || !this.nestedLoops.peek().hasLabel(stepLabel)) {
             this.nestedLoops.add(new LabelledCounter(stepLabel, (short)1));
         }
@@ -85,20 +85,20 @@ public class B_LP_NL_O_P_S_SE_SL_Traverser<T> extends B_LP_O_P_S_SE_SL_Traverser
     /////////////////
 
     @Override
-    public boolean equals(Object o) {
+    public boolean equals(final Object o) {
         if (this == o) return true;
         if (!(o instanceof B_LP_NL_O_P_S_SE_SL_Traverser)) return false;
         if (!super.equals(o)) return false;
 
         B_LP_NL_O_P_S_SE_SL_Traverser<?> that = (B_LP_NL_O_P_S_SE_SL_Traverser<?>) o;
 
-        return nestedLoops.equals(that.nestedLoops);
+        return this.nestedLoops.equals(that.nestedLoops);
     }
 
     @Override
     public int hashCode() {
         int result = super.hashCode();
-        result = 31 * result + nestedLoops.hashCode();
+        result = 31 * result + this.nestedLoops.hashCode();
         return result;
     }
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a97d3eda/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/B_LP_NL_O_S_SE_SL_Traverser.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/B_LP_NL_O_S_SE_SL_Traverser.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/B_LP_NL_O_S_SE_SL_Traverser.java
index 250a1fd..3959dd7 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/B_LP_NL_O_S_SE_SL_Traverser.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/B_LP_NL_O_S_SE_SL_Traverser.java
@@ -44,7 +44,7 @@ public class B_LP_NL_O_S_SE_SL_Traverser<T> extends B_LP_O_S_SE_SL_Traverser<T>
 
     @Override
     public void incrLoops(final String stepLabel) {
-        // If we encounter a new stack label then grow the stack otherwise increment the loop count
+        // If we encounter a new step label then grow the stack otherwise increment the loop count
         if (this.nestedLoops.size() == 0 || !this.nestedLoops.peek().hasLabel(stepLabel)) {
             this.nestedLoops.add(new LabelledCounter(stepLabel, (short)1));
         }
@@ -85,20 +85,20 @@ public class B_LP_NL_O_S_SE_SL_Traverser<T> extends B_LP_O_S_SE_SL_Traverser<T>
     /////////////////
 
     @Override
-    public boolean equals(Object o) {
+    public boolean equals(final Object o) {
         if (this == o) return true;
         if (!(o instanceof B_LP_NL_O_S_SE_SL_Traverser)) return false;
         if (!super.equals(o)) return false;
 
         B_LP_NL_O_S_SE_SL_Traverser<?> that = (B_LP_NL_O_S_SE_SL_Traverser<?>) o;
 
-        return nestedLoops.equals(that.nestedLoops);
+        return this.nestedLoops.equals(that.nestedLoops);
     }
 
     @Override
     public int hashCode() {
         int result = super.hashCode();
-        result = 31 * result + nestedLoops.hashCode();
+        result = 31 * result + this.nestedLoops.hashCode();
         return result;
     }
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a97d3eda/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/B_NL_O_S_SE_SL_Traverser.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/B_NL_O_S_SE_SL_Traverser.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/B_NL_O_S_SE_SL_Traverser.java
index 3018e22..11ce7fa 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/B_NL_O_S_SE_SL_Traverser.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/B_NL_O_S_SE_SL_Traverser.java
@@ -44,7 +44,7 @@ public class B_NL_O_S_SE_SL_Traverser<T> extends B_O_S_SE_SL_Traverser<T> {
 
     @Override
     public void incrLoops(final String stepLabel) {
-        // If we encounter a new stack label then grow the stack otherwise increment the loop count
+        // If we encounter a new step label then grow the stack otherwise increment the loop count
         if (this.nestedLoops.size() == 0 || !this.nestedLoops.peek().hasLabel(stepLabel)) {
             this.nestedLoops.add(new LabelledCounter(stepLabel, (short)1));
         }
@@ -85,20 +85,20 @@ public class B_NL_O_S_SE_SL_Traverser<T> extends B_O_S_SE_SL_Traverser<T> {
     /////////////////
 
     @Override
-    public boolean equals(Object o) {
+    public boolean equals(final Object o) {
         if (this == o) return true;
         if (!(o instanceof B_NL_O_S_SE_SL_Traverser)) return false;
         if (!super.equals(o)) return false;
 
         B_NL_O_S_SE_SL_Traverser<?> that = (B_NL_O_S_SE_SL_Traverser<?>) o;
 
-        return nestedLoops.equals(that.nestedLoops);
+        return this.nestedLoops.equals(that.nestedLoops);
     }
 
     @Override
     public int hashCode() {
         int result = super.hashCode();
-        result = 31 * result + nestedLoops.hashCode();
+        result = 31 * result + this.nestedLoops.hashCode();
         return result;
     }
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a97d3eda/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/LP_NL_O_OB_P_S_SE_SL_Traverser.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/LP_NL_O_OB_P_S_SE_SL_Traverser.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/LP_NL_O_OB_P_S_SE_SL_Traverser.java
index 3417864..f8b814f 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/LP_NL_O_OB_P_S_SE_SL_Traverser.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/LP_NL_O_OB_P_S_SE_SL_Traverser.java
@@ -45,7 +45,7 @@ public class LP_NL_O_OB_P_S_SE_SL_Traverser<T> extends LP_O_OB_P_S_SE_SL_Travers
 
     @Override
     public void incrLoops(final String stepLabel) {
-        // If we encounter a new stack label then grow the stack otherwise increment the loop count
+        // If we encounter a new step label then grow the stack otherwise increment the loop count
         if (this.nestedLoops.size() == 0 || !this.nestedLoops.peek().hasLabel(stepLabel)) {
             this.nestedLoops.add(new LabelledCounter(stepLabel, (short)1));
         }
@@ -86,20 +86,20 @@ public class LP_NL_O_OB_P_S_SE_SL_Traverser<T> extends LP_O_OB_P_S_SE_SL_Travers
     /////////////////
 
     @Override
-    public boolean equals(Object o) {
+    public boolean equals(final Object o) {
         if (this == o) return true;
         if (!(o instanceof LP_NL_O_OB_P_S_SE_SL_Traverser)) return false;
         if (!super.equals(o)) return false;
 
         LP_NL_O_OB_P_S_SE_SL_Traverser<?> that = (LP_NL_O_OB_P_S_SE_SL_Traverser<?>) o;
 
-        return nestedLoops.equals(that.nestedLoops);
+        return this.nestedLoops.equals(that.nestedLoops);
     }
 
     @Override
     public int hashCode() {
         int result = super.hashCode();
-        result = 31 * result + nestedLoops.hashCode();
+        result = 31 * result + this.nestedLoops.hashCode();
         return result;
     }
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a97d3eda/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/LP_NL_O_OB_S_SE_SL_Traverser.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/LP_NL_O_OB_S_SE_SL_Traverser.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/LP_NL_O_OB_S_SE_SL_Traverser.java
index facd4f9..9649f80 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/LP_NL_O_OB_S_SE_SL_Traverser.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/LP_NL_O_OB_S_SE_SL_Traverser.java
@@ -45,7 +45,7 @@ public class LP_NL_O_OB_S_SE_SL_Traverser<T> extends LP_O_OB_S_SE_SL_Traverser<T
 
     @Override
     public void incrLoops(final String stepLabel) {
-        // If we encounter a new stack label then grow the stack otherwise increment the loop count
+        // If we encounter a new step label then grow the stack otherwise increment the loop count
         if (this.nestedLoops.size() == 0 || !this.nestedLoops.peek().hasLabel(stepLabel)) {
             this.nestedLoops.add(new LabelledCounter(stepLabel, (short)1));
         }
@@ -86,20 +86,20 @@ public class LP_NL_O_OB_S_SE_SL_Traverser<T> extends LP_O_OB_S_SE_SL_Traverser<T
     /////////////////
 
     @Override
-    public boolean equals(Object o) {
+    public boolean equals(final Object o) {
         if (this == o) return true;
         if (!(o instanceof LP_NL_O_OB_S_SE_SL_Traverser)) return false;
         if (!super.equals(o)) return false;
 
         LP_NL_O_OB_S_SE_SL_Traverser<?> that = (LP_NL_O_OB_S_SE_SL_Traverser<?>) o;
 
-        return nestedLoops.equals(that.nestedLoops);
+        return this.nestedLoops.equals(that.nestedLoops);
     }
 
     @Override
     public int hashCode() {
         int result = super.hashCode();
-        result = 31 * result + nestedLoops.hashCode();
+        result = 31 * result + this.nestedLoops.hashCode();
         return result;
     }
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a97d3eda/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/NL_O_OB_S_SE_SL_Traverser.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/NL_O_OB_S_SE_SL_Traverser.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/NL_O_OB_S_SE_SL_Traverser.java
index d73dd19..2734d51 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/NL_O_OB_S_SE_SL_Traverser.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/NL_O_OB_S_SE_SL_Traverser.java
@@ -45,7 +45,7 @@ public class NL_O_OB_S_SE_SL_Traverser<T> extends O_OB_S_SE_SL_Traverser<T> {
 
     @Override
     public void incrLoops(final String stepLabel) {
-        // If we encounter a new stack label then grow the stack otherwise increment the loop count
+        // If we encounter a new step label then grow the stack otherwise increment the loop count
         if (this.nestedLoops.size() == 0 || !this.nestedLoops.peek().hasLabel(stepLabel)) {
             this.nestedLoops.add(new LabelledCounter(stepLabel, (short)1));
         }
@@ -86,20 +86,20 @@ public class NL_O_OB_S_SE_SL_Traverser<T> extends O_OB_S_SE_SL_Traverser<T> {
     /////////////////
 
     @Override
-    public boolean equals(Object o) {
+    public boolean equals(final Object o) {
         if (this == o) return true;
         if (!(o instanceof NL_O_OB_S_SE_SL_Traverser)) return false;
         if (!super.equals(o)) return false;
 
         NL_O_OB_S_SE_SL_Traverser<?> that = (NL_O_OB_S_SE_SL_Traverser<?>) o;
 
-        return nestedLoops.equals(that.nestedLoops);
+        return this.nestedLoops.equals(that.nestedLoops);
     }
 
     @Override
     public int hashCode() {
         int result = super.hashCode();
-        result = 31 * result + nestedLoops.hashCode();
+        result = 31 * result + this.nestedLoops.hashCode();
         return result;
     }
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a97d3eda/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/util/LabelledCounter.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/util/LabelledCounter.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/util/LabelledCounter.java
index bc07487..fe76891 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/util/LabelledCounter.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/util/LabelledCounter.java
@@ -28,11 +28,11 @@ import java.io.Serializable;
  */
 public class LabelledCounter implements Serializable {
 
-    private String label;
+    private final String label;
 
-    private MutableShort count;
+    private final MutableShort count;
 
-    public LabelledCounter(String label, short initialCount) {
+    public LabelledCounter(final String label, final short initialCount) {
         if (label == null) {
             throw new NullPointerException("Label is null");
         }
@@ -40,7 +40,7 @@ public class LabelledCounter implements Serializable {
         this.count = new MutableShort(initialCount);
     }
 
-    public boolean hasLabel(String label){
+    public boolean hasLabel(final String label){
         return this.label.equals(label);
     }
 
@@ -53,20 +53,20 @@ public class LabelledCounter implements Serializable {
     }
 
     @Override
-    public boolean equals(Object o) {
+    public boolean equals(final Object o) {
         if (this == o) return true;
         if (!(o instanceof LabelledCounter)) return false;
 
         LabelledCounter that = (LabelledCounter) o;
 
-        if (!label.equals(that.label)) return false;
-        return count.equals(that.count);
+        if (!this.label.equals(that.label)) return false;
+        return this.count.equals(that.count);
     }
 
     @Override
     public int hashCode() {
-        int result = label.hashCode();
-        result = 31 * result + count.hashCode();
+        int result = this.label.hashCode();
+        result = 31 * result + this.count.hashCode();
         return result;
     }
 }