You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2017/01/26 05:30:44 UTC

[10/50] groovy git commit: typos/formatting

typos/formatting


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

Branch: refs/heads/GROOVY_2_4_X
Commit: 376e051359f50b0a2a0543b75a0de714df857fc3
Parents: ea792ff
Author: paulk <pa...@asert.com.au>
Authored: Mon Nov 7 20:57:28 2016 +1000
Committer: paulk <pa...@asert.com.au>
Committed: Mon Nov 7 21:23:19 2016 +1000

----------------------------------------------------------------------
 .../groovy/classgen/asm/CompileStack.java       | 37 ++++++++++----------
 1 file changed, 18 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/376e0513/src/main/org/codehaus/groovy/classgen/asm/CompileStack.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/classgen/asm/CompileStack.java b/src/main/org/codehaus/groovy/classgen/asm/CompileStack.java
index 0c98fd6..99555ed 100644
--- a/src/main/org/codehaus/groovy/classgen/asm/CompileStack.java
+++ b/src/main/org/codehaus/groovy/classgen/asm/CompileStack.java
@@ -105,9 +105,9 @@ public class CompileStack implements Opcodes {
     private final LinkedList stateStack = new LinkedList();
 
     // handle different states for the implicit "this"
-    private LinkedList<Boolean> implicitThisStack = new LinkedList();
+    private LinkedList<Boolean> implicitThisStack = new LinkedList<Boolean>();
     // handle different states for being on the left hand side
-    private LinkedList<Boolean> lhsStack = new LinkedList();
+    private LinkedList<Boolean> lhsStack = new LinkedList<Boolean>();
     {
         implicitThisStack.add(false);
         lhsStack.add(false);
@@ -130,7 +130,7 @@ public class CompileStack implements Opcodes {
     // stores if implicit or explicit this is used.
     private boolean implicitThis;
     private WriterController controller;
-    private boolean inSpecialConstructallCall;
+    private boolean inSpecialConstructorCall;
 
     protected static class LabelRange {
         public Label start;
@@ -171,7 +171,7 @@ public class CompileStack implements Opcodes {
         final Map stackVariables;
         final Map currentBlockNamedLabels;
         final LinkedList<BlockRecorder> finallyBlocks;
-        final boolean inSpecialConstructallCall;
+        final boolean inSpecialConstructorCall;
 
         StateStackElement() {
             scope = CompileStack.this.scope;
@@ -180,7 +180,7 @@ public class CompileStack implements Opcodes {
             stackVariables = CompileStack.this.stackVariables;
             currentBlockNamedLabels = CompileStack.this.currentBlockNamedLabels;
             finallyBlocks = CompileStack.this.finallyBlocks;
-            inSpecialConstructallCall = CompileStack.this.inSpecialConstructallCall;
+            inSpecialConstructorCall = CompileStack.this.inSpecialConstructorCall;
         }
     }
 
@@ -204,7 +204,7 @@ public class CompileStack implements Opcodes {
         breakLabel = element.breakLabel;
         stackVariables = element.stackVariables;
         finallyBlocks = element.finallyBlocks;
-        inSpecialConstructallCall = element.inSpecialConstructallCall;
+        inSpecialConstructorCall = element.inSpecialConstructorCall;
     }
 
     public Label getContinueLabel() {
@@ -388,7 +388,6 @@ public class CompileStack implements Opcodes {
         usedVariables.clear();
         scope = null;
         finallyBlocks.clear();
-        mv=null;
         resetVariableIndex(false);
         superBlockNamedLabels.clear();
         currentBlockNamedLabels.clear();
@@ -571,8 +570,8 @@ public class CompileStack implements Opcodes {
     private void makeLocalVariablesOffset(Parameter[] paras,boolean isInStaticContext) {
         resetVariableIndex(isInStaticContext);
 
-        for (int i = 0; i < paras.length; i++) {
-            makeNextVariableID(paras[i].getType(),false);
+        for (Parameter para : paras) {
+            makeNextVariableID(para.getType(), false);
         }
         localVariableOffset = nextVariableIndex;
 
@@ -586,16 +585,16 @@ public class CompileStack implements Opcodes {
 
         makeLocalVariablesOffset(paras,isInStaticContext);
 
-        for (int i = 0; i < paras.length; i++) {
-            String name = paras[i].getName();
+        for (Parameter para : paras) {
+            String name = para.getName();
             BytecodeVariable answer;
-            ClassNode type = paras[i].getType();
-            if (paras[i].isClosureSharedVariable()) {
-                boolean useExistingReference = paras[i].getNodeMetaData(ClosureWriter.UseExistingReference.class) != null;
-                answer = defineVar(name, paras[i].getOriginType(), true, useExistingReference);
+            ClassNode type = para.getType();
+            if (para.isClosureSharedVariable()) {
+                boolean useExistingReference = para.getNodeMetaData(ClosureWriter.UseExistingReference.class) != null;
+                answer = defineVar(name, para.getOriginType(), true, useExistingReference);
                 answer.setStartLabel(startLabel);
                 if (!useExistingReference) {
-                    controller.getOperandStack().load(type,currentVariableIndex);
+                    controller.getOperandStack().load(type, currentVariableIndex);
                     controller.getOperandStack().box();
 
                     // GROOVY-4237, the original variable should always appear
@@ -605,7 +604,7 @@ public class CompileStack implements Opcodes {
                     // reference will be used
                     Label newStart = new Label();
                     controller.getMethodVisitor().visitLabel(newStart);
-                    BytecodeVariable var = new BytecodeVariable(currentVariableIndex, paras[i].getOriginType(), name, currentVariableIndex);
+                    BytecodeVariable var = new BytecodeVariable(currentVariableIndex, para.getOriginType(), name, currentVariableIndex);
                     var.setStartLabel(startLabel);
                     var.setEndLabel(newStart);
                     usedVariables.add(var);
@@ -856,11 +855,11 @@ public class CompileStack implements Opcodes {
     }
 
     public boolean isInSpecialConstructorCall() {
-        return inSpecialConstructallCall;
+        return inSpecialConstructorCall;
     }
 
     public void pushInSpecialConstructorCall() {
         pushState();
-        inSpecialConstructallCall = true;
+        inSpecialConstructorCall = true;
     }
 }