[1/3] groovy git commit: formatting

2018-04-12 Thread paulk
Repository: groovy
Updated Branches:
  refs/heads/master 322e86274 -> 12d0f4431


formatting


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

Branch: refs/heads/master
Commit: cb7db51e2c41a4ed5ca2c179dc3d0b2e7b6b5618
Parents: 322e862
Author: Paul King 
Authored: Thu Apr 12 18:50:39 2018 +1000
Committer: Paul King 
Committed: Fri Apr 13 03:25:30 2018 +1000

--
 src/main/java/org/codehaus/groovy/control/GenericsVisitor.java | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/groovy/blob/cb7db51e/src/main/java/org/codehaus/groovy/control/GenericsVisitor.java
--
diff --git a/src/main/java/org/codehaus/groovy/control/GenericsVisitor.java 
b/src/main/java/org/codehaus/groovy/control/GenericsVisitor.java
index 36ef5ea..53885cf 100644
--- a/src/main/java/org/codehaus/groovy/control/GenericsVisitor.java
+++ b/src/main/java/org/codehaus/groovy/control/GenericsVisitor.java
@@ -30,8 +30,6 @@ import org.codehaus.groovy.ast.expr.ConstructorCallExpression;
 /**
  * class used to verify correct usage of generics in
  * class header (class and superclass declaration)
- *
- * @author Jochen Theodorou
  */
 public class GenericsVisitor extends ClassCodeVisitorSupport {
 private final SourceUnit source;
@@ -48,7 +46,7 @@ public class GenericsVisitor extends ClassCodeVisitorSupport {
 public void visitClass(ClassNode node) {
 boolean error = checkWildcard(node);
 if (error) return;
-boolean isAnon = node instanceof InnerClassNode && 
((InnerClassNode)node).isAnonymous();
+boolean isAnon = node instanceof InnerClassNode && ((InnerClassNode) 
node).isAnonymous();
 checkGenericsUsage(node.getUnresolvedSuperClass(false), 
node.getSuperClass(), isAnon ? true : null);
 ClassNode[] interfaces = node.getInterfaces();
 for (ClassNode anInterface : interfaces) {
@@ -67,7 +65,7 @@ public class GenericsVisitor extends ClassCodeVisitorSupport {
 @Override
 public void visitConstructorCallExpression(ConstructorCallExpression call) 
{
 ClassNode type = call.getType();
-boolean isAnon = type instanceof InnerClassNode && 
((InnerClassNode)type).isAnonymous();
+boolean isAnon = type instanceof InnerClassNode && ((InnerClassNode) 
type).isAnonymous();
 checkGenericsUsage(type, type.redirect(), isAnon);
 }
 



[1/3] groovy git commit: formatting

2018-04-12 Thread paulk
Repository: groovy
Updated Branches:
  refs/heads/GROOVY_2_6_X 61284355f -> d862bdbdc


formatting


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

Branch: refs/heads/GROOVY_2_6_X
Commit: 2c9197fa2fa57c4cfc46e55d97ebb8b876b559c8
Parents: 6128435
Author: Paul King 
Authored: Thu Apr 12 18:50:39 2018 +1000
Committer: Paul King 
Committed: Thu Apr 12 23:42:01 2018 +1000

--
 src/main/java/org/codehaus/groovy/control/GenericsVisitor.java | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/groovy/blob/2c9197fa/src/main/java/org/codehaus/groovy/control/GenericsVisitor.java
--
diff --git a/src/main/java/org/codehaus/groovy/control/GenericsVisitor.java 
b/src/main/java/org/codehaus/groovy/control/GenericsVisitor.java
index 36ef5ea..53885cf 100644
--- a/src/main/java/org/codehaus/groovy/control/GenericsVisitor.java
+++ b/src/main/java/org/codehaus/groovy/control/GenericsVisitor.java
@@ -30,8 +30,6 @@ import org.codehaus.groovy.ast.expr.ConstructorCallExpression;
 /**
  * class used to verify correct usage of generics in
  * class header (class and superclass declaration)
- *
- * @author Jochen Theodorou
  */
 public class GenericsVisitor extends ClassCodeVisitorSupport {
 private final SourceUnit source;
@@ -48,7 +46,7 @@ public class GenericsVisitor extends ClassCodeVisitorSupport {
 public void visitClass(ClassNode node) {
 boolean error = checkWildcard(node);
 if (error) return;
-boolean isAnon = node instanceof InnerClassNode && 
((InnerClassNode)node).isAnonymous();
+boolean isAnon = node instanceof InnerClassNode && ((InnerClassNode) 
node).isAnonymous();
 checkGenericsUsage(node.getUnresolvedSuperClass(false), 
node.getSuperClass(), isAnon ? true : null);
 ClassNode[] interfaces = node.getInterfaces();
 for (ClassNode anInterface : interfaces) {
@@ -67,7 +65,7 @@ public class GenericsVisitor extends ClassCodeVisitorSupport {
 @Override
 public void visitConstructorCallExpression(ConstructorCallExpression call) 
{
 ClassNode type = call.getType();
-boolean isAnon = type instanceof InnerClassNode && 
((InnerClassNode)type).isAnonymous();
+boolean isAnon = type instanceof InnerClassNode && ((InnerClassNode) 
type).isAnonymous();
 checkGenericsUsage(type, type.redirect(), isAnon);
 }
 



groovy git commit: formatting

2018-04-12 Thread paulk
Repository: groovy
Updated Branches:
  refs/heads/GROOVY_2_5_X d3d75e514 -> 43706262b


formatting


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

Branch: refs/heads/GROOVY_2_5_X
Commit: 43706262b33b37ea4006e81027e9e6a1fe1d9efa
Parents: d3d75e5
Author: Paul King 
Authored: Thu Apr 12 18:50:39 2018 +1000
Committer: Paul King 
Committed: Thu Apr 12 18:50:39 2018 +1000

--
 src/main/java/org/codehaus/groovy/control/GenericsVisitor.java | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/groovy/blob/43706262/src/main/java/org/codehaus/groovy/control/GenericsVisitor.java
--
diff --git a/src/main/java/org/codehaus/groovy/control/GenericsVisitor.java 
b/src/main/java/org/codehaus/groovy/control/GenericsVisitor.java
index 36ef5ea..53885cf 100644
--- a/src/main/java/org/codehaus/groovy/control/GenericsVisitor.java
+++ b/src/main/java/org/codehaus/groovy/control/GenericsVisitor.java
@@ -30,8 +30,6 @@ import org.codehaus.groovy.ast.expr.ConstructorCallExpression;
 /**
  * class used to verify correct usage of generics in
  * class header (class and superclass declaration)
- *
- * @author Jochen Theodorou
  */
 public class GenericsVisitor extends ClassCodeVisitorSupport {
 private final SourceUnit source;
@@ -48,7 +46,7 @@ public class GenericsVisitor extends ClassCodeVisitorSupport {
 public void visitClass(ClassNode node) {
 boolean error = checkWildcard(node);
 if (error) return;
-boolean isAnon = node instanceof InnerClassNode && 
((InnerClassNode)node).isAnonymous();
+boolean isAnon = node instanceof InnerClassNode && ((InnerClassNode) 
node).isAnonymous();
 checkGenericsUsage(node.getUnresolvedSuperClass(false), 
node.getSuperClass(), isAnon ? true : null);
 ClassNode[] interfaces = node.getInterfaces();
 for (ClassNode anInterface : interfaces) {
@@ -67,7 +65,7 @@ public class GenericsVisitor extends ClassCodeVisitorSupport {
 @Override
 public void visitConstructorCallExpression(ConstructorCallExpression call) 
{
 ClassNode type = call.getType();
-boolean isAnon = type instanceof InnerClassNode && 
((InnerClassNode)type).isAnonymous();
+boolean isAnon = type instanceof InnerClassNode && ((InnerClassNode) 
type).isAnonymous();
 checkGenericsUsage(type, type.redirect(), isAnon);
 }
 



groovy git commit: formatting

2018-04-11 Thread paulk
Repository: groovy
Updated Branches:
  refs/heads/GROOVY_2_5_X 7d49e93e5 -> d3d75e514


formatting


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

Branch: refs/heads/GROOVY_2_5_X
Commit: d3d75e5140327c2a05bff0ec9c9cff10004e18f6
Parents: 7d49e93
Author: Paul King 
Authored: Thu Apr 12 13:57:41 2018 +1000
Committer: Paul King 
Committed: Thu Apr 12 13:57:41 2018 +1000

--
 src/main/java/org/codehaus/groovy/ast/tools/GenericsUtils.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/groovy/blob/d3d75e51/src/main/java/org/codehaus/groovy/ast/tools/GenericsUtils.java
--
diff --git a/src/main/java/org/codehaus/groovy/ast/tools/GenericsUtils.java 
b/src/main/java/org/codehaus/groovy/ast/tools/GenericsUtils.java
index 83d1999..31f6c6e 100644
--- a/src/main/java/org/codehaus/groovy/ast/tools/GenericsUtils.java
+++ b/src/main/java/org/codehaus/groovy/ast/tools/GenericsUtils.java
@@ -144,7 +144,7 @@ public class GenericsUtils {
  * types it defines.
  *
  * @param node the class node to check
- + @param map the generics type information collector
+ * @param map the generics type information collector
  */
 public static void extractPlaceholders(ClassNode node, Map map) {
 if (node == null) return;



[2/2] groovy git commit: formatting only

2018-04-11 Thread paulk
formatting only


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

Branch: refs/heads/GROOVY_2_5_X
Commit: d98afbeb2b332be1853dacdca2aecc300ca0743c
Parents: 15fc348
Author: Paul King 
Authored: Thu Apr 12 10:52:32 2018 +1000
Committer: Paul King 
Committed: Thu Apr 12 10:52:32 2018 +1000

--
 .../groovy/ast/tools/GenericsUtils.java | 118 ++--
 .../stc/StaticTypeCheckingSupport.java  | 377 +-
 .../stc/StaticTypeCheckingVisitor.java  | 683 ++-
 3 files changed, 610 insertions(+), 568 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/groovy/blob/d98afbeb/src/main/java/org/codehaus/groovy/ast/tools/GenericsUtils.java
--
diff --git a/src/main/java/org/codehaus/groovy/ast/tools/GenericsUtils.java 
b/src/main/java/org/codehaus/groovy/ast/tools/GenericsUtils.java
index 126ef42..1b0fb04 100644
--- a/src/main/java/org/codehaus/groovy/ast/tools/GenericsUtils.java
+++ b/src/main/java/org/codehaus/groovy/ast/tools/GenericsUtils.java
@@ -52,9 +52,6 @@ import static 
org.codehaus.groovy.transform.stc.StaticTypeCheckingSupport.implem
 
 /**
  * Utility methods to deal with generic types.
- *
- * @author Cedric Champeau
- * @author Paul King
  */
 public class GenericsUtils {
 public static final GenericsType[] EMPTY_GENERICS_ARRAY = 
GenericsType.EMPTY_ARRAY;
@@ -65,28 +62,29 @@ public class GenericsUtils {
  * class uses generic type T,U,V 
(redirectGenericTypes), is used with actual type parameters
  * java.lang.String, U,V, then a class or interface 
using generic types T,V
  * will be aligned to java.lang.String,V
+ *
  * @param redirectGenericTypes the type arguments or the redirect class 
node
- * @param parameterizedTypes the actual type arguments used on this class 
node
- * @param alignmentTarget the generic type arguments to which we want to 
align to
+ * @param parameterizedTypes   the actual type arguments used on this 
class node
+ * @param alignmentTarget  the generic type arguments to which we want 
to align to
  * @return aligned type arguments
  * @deprecated You shouldn't call this method because it is inherently 
unreliable
  */
 @Deprecated
 public static GenericsType[] alignGenericTypes(final GenericsType[] 
redirectGenericTypes, final GenericsType[] parameterizedTypes, final 
GenericsType[] alignmentTarget) {
-if (alignmentTarget==null) return EMPTY_GENERICS_ARRAY;
-if (parameterizedTypes==null || parameterizedTypes.length==0) return 
alignmentTarget;
+if (alignmentTarget == null) return EMPTY_GENERICS_ARRAY;
+if (parameterizedTypes == null || parameterizedTypes.length == 0) 
return alignmentTarget;
 GenericsType[] generics = new GenericsType[alignmentTarget.length];
 for (int i = 0, scgtLength = alignmentTarget.length; i < scgtLength; 
i++) {
 final GenericsType currentTarget = alignmentTarget[i];
 GenericsType match = null;
-if (redirectGenericTypes!=null) {
+if (redirectGenericTypes != null) {
 for (int j = 0; j < redirectGenericTypes.length && match == 
null; j++) {
 GenericsType redirectGenericType = redirectGenericTypes[j];
 if 
(redirectGenericType.isCompatibleWith(currentTarget.getType())) {
 if (currentTarget.isPlaceholder() && 
redirectGenericType.isPlaceholder() && 
!currentTarget.getName().equals(redirectGenericType.getName())) {
 // check if there's a potential better match
 boolean skip = false;
-for (int k=j+1; k 
genericsSpec, MethodNode mn) {
+public static MethodNode correctToGenericsSpec(Map 
genericsSpec, MethodNode mn) {
 ClassNode correctedType = correctToGenericsSpecRecurse(genericsSpec, 
mn.getReturnType());
 Parameter[] origParameters = mn.getParameters();
 Parameter[] newParameters = new Parameter[origParameters.length];
@@ -293,26 +295,26 @@ public class GenericsUtils {
 return new MethodNode(mn.getName(), mn.getModifiers(), correctedType, 
newParameters, mn.getExceptions(), mn.getCode());
 }
 
-public static ClassNode correctToGenericsSpecRecurse(Map 
genericsSpec, ClassNode type) {
+public static ClassNode correctToGenericsSpecRecurse(Map genericsSpec, ClassNode type) {
 return correctToGenericsSpecRecurse(genericsSpec, type, new 

[1/2] groovy git commit: formatting only

2018-04-11 Thread paulk
Repository: groovy
Updated Branches:
  refs/heads/GROOVY_2_5_X 15fc34835 -> d98afbeb2


http://git-wip-us.apache.org/repos/asf/groovy/blob/d98afbeb/src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java
--
diff --git 
a/src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java
 
b/src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java
index 9137bd7..b8f3763 100644
--- 
a/src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java
+++ 
b/src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java
@@ -300,13 +300,13 @@ public class StaticTypeCheckingVisitor extends 
ClassCodeVisitorSupport {
 if (returnStatement.getExpression() == ConstantExpression.NULL) 
return;
 if (isNullConstant(returnStatement.getExpression())) return;
 checkReturnType(returnStatement);
-if (typeCheckingContext.getEnclosingClosure()!=null) {
+if (typeCheckingContext.getEnclosingClosure() != null) {
 addClosureReturnType(getType(returnStatement.getExpression()));
 } else if (typeCheckingContext.getEnclosingMethod() != null) {
 } else {
 throw new GroovyBugError("Unexpected return statement at "
-+ 
returnStatement.getLineNumber()+":"+returnStatement.getColumnNumber()
-+ " "+returnStatement.getText());
++ returnStatement.getLineNumber() + ":" + 
returnStatement.getColumnNumber()
++ " " + returnStatement.getText());
 }
 }
 };
@@ -441,6 +441,7 @@ public class StaticTypeCheckingVisitor extends 
ClassCodeVisitorSupport {
 
 /**
  * Test if a node is an inner class node, and if it is, then checks if the 
enclosing method is skipped.
+ *
  * @param node
  * @return true if the inner class node should be skipped
  */
@@ -462,7 +463,7 @@ public class StaticTypeCheckingVisitor extends 
ClassCodeVisitorSupport {
 @SuppressWarnings("unchecked")
 private static void addPrivateFieldOrMethodAccess(Expression source, 
ClassNode cn, StaticTypesMarker type, ASTNode accessedMember) {
 Set set = (Set) cn.getNodeMetaData(type);
-if (set==null) {
+if (set == null) {
 set = new LinkedHashSet();
 cn.putNodeMetaData(type, set);
 }
@@ -474,9 +475,9 @@ public class StaticTypeCheckingVisitor extends 
ClassCodeVisitorSupport {
  * Given a field node, checks if we are accessing or setting a private 
field from an inner class.
  */
 private void checkOrMarkPrivateAccess(Expression source, FieldNode fn, 
boolean lhsOfAssignment) {
-if (fn!=null && Modifier.isPrivate(fn.getModifiers()) &&
-(fn.getDeclaringClass() != 
typeCheckingContext.getEnclosingClassNode() || 
typeCheckingContext.getEnclosingClosure()!=null) &&
-fn.getDeclaringClass().getModule() == 
typeCheckingContext.getEnclosingClassNode().getModule()) {
+if (fn != null && Modifier.isPrivate(fn.getModifiers()) &&
+(fn.getDeclaringClass() != 
typeCheckingContext.getEnclosingClassNode() || 
typeCheckingContext.getEnclosingClosure() != null) &&
+fn.getDeclaringClass().getModule() == 
typeCheckingContext.getEnclosingClassNode().getModule()) {
 StaticTypesMarker marker = lhsOfAssignment ? 
StaticTypesMarker.PV_FIELDS_MUTATION : StaticTypesMarker.PV_FIELDS_ACCESS;
 addPrivateFieldOrMethodAccess(source, fn.getDeclaringClass(), 
marker, fn);
 }
@@ -486,7 +487,7 @@ public class StaticTypeCheckingVisitor extends 
ClassCodeVisitorSupport {
  * Given a method node, checks if we are calling a private method from an 
inner class.
  */
 private void checkOrMarkPrivateAccess(Expression source, MethodNode mn) {
-if (mn==null) {
+if (mn == null) {
 return;
 }
 ClassNode declaringClass = mn.getDeclaringClass();
@@ -495,7 +496,7 @@ public class StaticTypeCheckingVisitor extends 
ClassCodeVisitorSupport {
 int mods = mn.getModifiers();
 boolean sameModule = declaringClass.getModule() == 
enclosingClassNode.getModule();
 String packageName = declaringClass.getPackageName();
-if (packageName==null) {
+if (packageName == null) {
 packageName = "";
 }
 if ((Modifier.isPrivate(mods) && sameModule)) {
@@ -515,7 +516,7 @@ public class StaticTypeCheckingVisitor extends 
ClassCodeVisitorSupport {
 
 private void checkSuperCallFromClosure(Expression call, MethodNode 
directCallTarget) {
 if (call instanceof MethodCallExpression && 
typeCheckingContext.getEnclosingClosure() != null) {
-Expression objectExpression = 

[1/2] groovy git commit: formatting only

2018-04-11 Thread paulk
Repository: groovy
Updated Branches:
  refs/heads/GROOVY_2_6_X 49a1c02d8 -> ef659512a


http://git-wip-us.apache.org/repos/asf/groovy/blob/ef659512/src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java
--
diff --git 
a/src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java
 
b/src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java
index 17d6c92..9308617 100644
--- 
a/src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java
+++ 
b/src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java
@@ -304,13 +304,13 @@ public class StaticTypeCheckingVisitor extends 
ClassCodeVisitorSupport {
 if (returnStatement.getExpression() == ConstantExpression.NULL) 
return;
 if (isNullConstant(returnStatement.getExpression())) return;
 checkReturnType(returnStatement);
-if (typeCheckingContext.getEnclosingClosure()!=null) {
+if (typeCheckingContext.getEnclosingClosure() != null) {
 addClosureReturnType(getType(returnStatement.getExpression()));
 } else if (typeCheckingContext.getEnclosingMethod() != null) {
 } else {
 throw new GroovyBugError("Unexpected return statement at "
-+ 
returnStatement.getLineNumber()+":"+returnStatement.getColumnNumber()
-+ " "+returnStatement.getText());
++ returnStatement.getLineNumber() + ":" + 
returnStatement.getColumnNumber()
++ " " + returnStatement.getText());
 }
 }
 };
@@ -445,6 +445,7 @@ public class StaticTypeCheckingVisitor extends 
ClassCodeVisitorSupport {
 
 /**
  * Test if a node is an inner class node, and if it is, then checks if the 
enclosing method is skipped.
+ *
  * @param node
  * @return true if the inner class node should be skipped
  */
@@ -466,7 +467,7 @@ public class StaticTypeCheckingVisitor extends 
ClassCodeVisitorSupport {
 @SuppressWarnings("unchecked")
 private static void addPrivateFieldOrMethodAccess(Expression source, 
ClassNode cn, StaticTypesMarker type, ASTNode accessedMember) {
 Set set = (Set) cn.getNodeMetaData(type);
-if (set==null) {
+if (set == null) {
 set = new LinkedHashSet();
 cn.putNodeMetaData(type, set);
 }
@@ -478,9 +479,9 @@ public class StaticTypeCheckingVisitor extends 
ClassCodeVisitorSupport {
  * Given a field node, checks if we are accessing or setting a private 
field from an inner class.
  */
 private void checkOrMarkPrivateAccess(Expression source, FieldNode fn, 
boolean lhsOfAssignment) {
-if (fn!=null && Modifier.isPrivate(fn.getModifiers()) &&
-(fn.getDeclaringClass() != 
typeCheckingContext.getEnclosingClassNode() || 
typeCheckingContext.getEnclosingClosure()!=null) &&
-fn.getDeclaringClass().getModule() == 
typeCheckingContext.getEnclosingClassNode().getModule()) {
+if (fn != null && Modifier.isPrivate(fn.getModifiers()) &&
+(fn.getDeclaringClass() != 
typeCheckingContext.getEnclosingClassNode() || 
typeCheckingContext.getEnclosingClosure() != null) &&
+fn.getDeclaringClass().getModule() == 
typeCheckingContext.getEnclosingClassNode().getModule()) {
 StaticTypesMarker marker = lhsOfAssignment ? 
StaticTypesMarker.PV_FIELDS_MUTATION : StaticTypesMarker.PV_FIELDS_ACCESS;
 addPrivateFieldOrMethodAccess(source, fn.getDeclaringClass(), 
marker, fn);
 }
@@ -490,7 +491,7 @@ public class StaticTypeCheckingVisitor extends 
ClassCodeVisitorSupport {
  * Given a method node, checks if we are calling a private method from an 
inner class.
  */
 private void checkOrMarkPrivateAccess(Expression source, MethodNode mn) {
-if (mn==null) {
+if (mn == null) {
 return;
 }
 ClassNode declaringClass = mn.getDeclaringClass();
@@ -499,7 +500,7 @@ public class StaticTypeCheckingVisitor extends 
ClassCodeVisitorSupport {
 int mods = mn.getModifiers();
 boolean sameModule = declaringClass.getModule() == 
enclosingClassNode.getModule();
 String packageName = declaringClass.getPackageName();
-if (packageName==null) {
+if (packageName == null) {
 packageName = "";
 }
 if ((Modifier.isPrivate(mods) && sameModule)) {
@@ -519,7 +520,7 @@ public class StaticTypeCheckingVisitor extends 
ClassCodeVisitorSupport {
 
 private void checkSuperCallFromClosure(Expression call, MethodNode 
directCallTarget) {
 if (call instanceof MethodCallExpression && 
typeCheckingContext.getEnclosingClosure() != null) {
-Expression objectExpression = 

[2/2] groovy git commit: formatting only

2018-04-11 Thread paulk
formatting only


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

Branch: refs/heads/GROOVY_2_6_X
Commit: ef659512a5ca54ca120dc5e86d5fd0472b7e
Parents: 49a1c02
Author: Paul King 
Authored: Thu Apr 12 10:12:09 2018 +1000
Committer: Paul King 
Committed: Thu Apr 12 10:49:00 2018 +1000

--
 .../groovy/ast/tools/GenericsUtils.java | 122 ++--
 .../stc/StaticTypeCheckingSupport.java  | 380 ++-
 .../stc/StaticTypeCheckingVisitor.java  | 672 ++-
 3 files changed, 610 insertions(+), 564 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/groovy/blob/ef659512/src/main/java/org/codehaus/groovy/ast/tools/GenericsUtils.java
--
diff --git a/src/main/java/org/codehaus/groovy/ast/tools/GenericsUtils.java 
b/src/main/java/org/codehaus/groovy/ast/tools/GenericsUtils.java
index 126ef42..b562ab8 100644
--- a/src/main/java/org/codehaus/groovy/ast/tools/GenericsUtils.java
+++ b/src/main/java/org/codehaus/groovy/ast/tools/GenericsUtils.java
@@ -52,9 +52,6 @@ import static 
org.codehaus.groovy.transform.stc.StaticTypeCheckingSupport.implem
 
 /**
  * Utility methods to deal with generic types.
- *
- * @author Cedric Champeau
- * @author Paul King
  */
 public class GenericsUtils {
 public static final GenericsType[] EMPTY_GENERICS_ARRAY = 
GenericsType.EMPTY_ARRAY;
@@ -65,28 +62,29 @@ public class GenericsUtils {
  * class uses generic type T,U,V 
(redirectGenericTypes), is used with actual type parameters
  * java.lang.String, U,V, then a class or interface 
using generic types T,V
  * will be aligned to java.lang.String,V
+ *
  * @param redirectGenericTypes the type arguments or the redirect class 
node
- * @param parameterizedTypes the actual type arguments used on this class 
node
- * @param alignmentTarget the generic type arguments to which we want to 
align to
+ * @param parameterizedTypes   the actual type arguments used on this 
class node
+ * @param alignmentTarget  the generic type arguments to which we want 
to align to
  * @return aligned type arguments
  * @deprecated You shouldn't call this method because it is inherently 
unreliable
  */
 @Deprecated
 public static GenericsType[] alignGenericTypes(final GenericsType[] 
redirectGenericTypes, final GenericsType[] parameterizedTypes, final 
GenericsType[] alignmentTarget) {
-if (alignmentTarget==null) return EMPTY_GENERICS_ARRAY;
-if (parameterizedTypes==null || parameterizedTypes.length==0) return 
alignmentTarget;
+if (alignmentTarget == null) return EMPTY_GENERICS_ARRAY;
+if (parameterizedTypes == null || parameterizedTypes.length == 0) 
return alignmentTarget;
 GenericsType[] generics = new GenericsType[alignmentTarget.length];
 for (int i = 0, scgtLength = alignmentTarget.length; i < scgtLength; 
i++) {
 final GenericsType currentTarget = alignmentTarget[i];
 GenericsType match = null;
-if (redirectGenericTypes!=null) {
+if (redirectGenericTypes != null) {
 for (int j = 0; j < redirectGenericTypes.length && match == 
null; j++) {
 GenericsType redirectGenericType = redirectGenericTypes[j];
 if 
(redirectGenericType.isCompatibleWith(currentTarget.getType())) {
 if (currentTarget.isPlaceholder() && 
redirectGenericType.isPlaceholder() && 
!currentTarget.getName().equals(redirectGenericType.getName())) {
 // check if there's a potential better match
 boolean skip = false;
-for (int k=j+1; k map) {
 if (node == null) return;
@@ -158,7 +158,7 @@ public class GenericsUtils {
 GenericsType[] parameterized = node.getGenericsTypes();
 if (parameterized == null || parameterized.length == 0) return;
 GenericsType[] redirectGenericsTypes = 
node.redirect().getGenericsTypes();
-if (redirectGenericsTypes==null) redirectGenericsTypes = parameterized;
+if (redirectGenericsTypes == null) redirectGenericsTypes = 
parameterized;
 for (int i = 0; i < redirectGenericsTypes.length; i++) {
 GenericsType redirectType = redirectGenericsTypes[i];
 if (redirectType.isPlaceholder()) {
@@ -168,11 +168,11 @@ public class GenericsUtils {
 map.put(name, value);
 if (value.isWildcard()) {
 ClassNode lowerBound = 

[1/2] groovy git commit: formatting only

2018-04-11 Thread paulk
Repository: groovy
Updated Branches:
  refs/heads/master 4ada9e66c -> d033d1ce5


http://git-wip-us.apache.org/repos/asf/groovy/blob/d033d1ce/src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java
--
diff --git 
a/src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java
 
b/src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java
index c8e79bb..a6067c2 100644
--- 
a/src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java
+++ 
b/src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java
@@ -304,13 +304,13 @@ public class StaticTypeCheckingVisitor extends 
ClassCodeVisitorSupport {
 if (returnStatement.getExpression() == ConstantExpression.NULL) 
return;
 if (isNullConstant(returnStatement.getExpression())) return;
 checkReturnType(returnStatement);
-if (typeCheckingContext.getEnclosingClosure()!=null) {
+if (typeCheckingContext.getEnclosingClosure() != null) {
 addClosureReturnType(getType(returnStatement.getExpression()));
 } else if (typeCheckingContext.getEnclosingMethod() != null) {
 } else {
 throw new GroovyBugError("Unexpected return statement at "
-+ 
returnStatement.getLineNumber()+":"+returnStatement.getColumnNumber()
-+ " "+returnStatement.getText());
++ returnStatement.getLineNumber() + ":" + 
returnStatement.getColumnNumber()
++ " " + returnStatement.getText());
 }
 }
 };
@@ -445,6 +445,7 @@ public class StaticTypeCheckingVisitor extends 
ClassCodeVisitorSupport {
 
 /**
  * Test if a node is an inner class node, and if it is, then checks if the 
enclosing method is skipped.
+ *
  * @param node
  * @return true if the inner class node should be skipped
  */
@@ -466,7 +467,7 @@ public class StaticTypeCheckingVisitor extends 
ClassCodeVisitorSupport {
 @SuppressWarnings("unchecked")
 private static void addPrivateFieldOrMethodAccess(Expression source, 
ClassNode cn, StaticTypesMarker type, ASTNode accessedMember) {
 Set set = (Set) cn.getNodeMetaData(type);
-if (set==null) {
+if (set == null) {
 set = new LinkedHashSet();
 cn.putNodeMetaData(type, set);
 }
@@ -478,9 +479,9 @@ public class StaticTypeCheckingVisitor extends 
ClassCodeVisitorSupport {
  * Given a field node, checks if we are accessing or setting a private 
field from an inner class.
  */
 private void checkOrMarkPrivateAccess(Expression source, FieldNode fn, 
boolean lhsOfAssignment) {
-if (fn!=null && Modifier.isPrivate(fn.getModifiers()) &&
-(fn.getDeclaringClass() != 
typeCheckingContext.getEnclosingClassNode() || 
typeCheckingContext.getEnclosingClosure()!=null) &&
-fn.getDeclaringClass().getModule() == 
typeCheckingContext.getEnclosingClassNode().getModule()) {
+if (fn != null && Modifier.isPrivate(fn.getModifiers()) &&
+(fn.getDeclaringClass() != 
typeCheckingContext.getEnclosingClassNode() || 
typeCheckingContext.getEnclosingClosure() != null) &&
+fn.getDeclaringClass().getModule() == 
typeCheckingContext.getEnclosingClassNode().getModule()) {
 StaticTypesMarker marker = lhsOfAssignment ? 
StaticTypesMarker.PV_FIELDS_MUTATION : StaticTypesMarker.PV_FIELDS_ACCESS;
 addPrivateFieldOrMethodAccess(source, fn.getDeclaringClass(), 
marker, fn);
 }
@@ -490,7 +491,7 @@ public class StaticTypeCheckingVisitor extends 
ClassCodeVisitorSupport {
  * Given a method node, checks if we are calling a private method from an 
inner class.
  */
 private void checkOrMarkPrivateAccess(Expression source, MethodNode mn) {
-if (mn==null) {
+if (mn == null) {
 return;
 }
 ClassNode declaringClass = mn.getDeclaringClass();
@@ -499,7 +500,7 @@ public class StaticTypeCheckingVisitor extends 
ClassCodeVisitorSupport {
 int mods = mn.getModifiers();
 boolean sameModule = declaringClass.getModule() == 
enclosingClassNode.getModule();
 String packageName = declaringClass.getPackageName();
-if (packageName==null) {
+if (packageName == null) {
 packageName = "";
 }
 if ((Modifier.isPrivate(mods) && sameModule)) {
@@ -519,7 +520,7 @@ public class StaticTypeCheckingVisitor extends 
ClassCodeVisitorSupport {
 
 private void checkSuperCallFromClosure(Expression call, MethodNode 
directCallTarget) {
 if (call instanceof MethodCallExpression && 
typeCheckingContext.getEnclosingClosure() != null) {
-Expression objectExpression = 
((MethodCallExpression)call).getObjectExpression();

[1/2] groovy git commit: formatting

2018-04-01 Thread paulk
Repository: groovy
Updated Branches:
  refs/heads/GROOVY_2_6_X a259ad3b1 -> cf6a6c7c5


formatting


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

Branch: refs/heads/GROOVY_2_6_X
Commit: 5748573b2dafd9664e5e79a0aeab0ea43d7628e6
Parents: a259ad3
Author: Paul King 
Authored: Sun Apr 1 23:09:29 2018 +1000
Committer: Paul King 
Committed: Sun Apr 1 23:41:19 2018 +1000

--
 .../runtime/metaclass/MetaClassRegistryImpl.java  | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/groovy/blob/5748573b/src/main/java/org/codehaus/groovy/runtime/metaclass/MetaClassRegistryImpl.java
--
diff --git 
a/src/main/java/org/codehaus/groovy/runtime/metaclass/MetaClassRegistryImpl.java
 
b/src/main/java/org/codehaus/groovy/runtime/metaclass/MetaClassRegistryImpl.java
index ff30a2b..2914d02 100644
--- 
a/src/main/java/org/codehaus/groovy/runtime/metaclass/MetaClassRegistryImpl.java
+++ 
b/src/main/java/org/codehaus/groovy/runtime/metaclass/MetaClassRegistryImpl.java
@@ -513,22 +513,22 @@ public class MetaClassRegistryImpl implements 
MetaClassRegistry{
 
 public void onModule(final ExtensionModule module) {
 if (moduleRegistry.hasModule(module.getName())) {
-ExtensionModule loadedModule = 
moduleRegistry.getModule(module.getName());
-if (loadedModule.getVersion().equals(module.getVersion())) {
-// already registered
-return;
-} else {
-throw new GroovyRuntimeException("Conflicting module versions. 
Module ["+module.getName()+" is loaded in version "+
-loadedModule.getVersion()+" and you are trying to load 
version "+module.getVersion());
+ExtensionModule loadedModule = 
moduleRegistry.getModule(module.getName());
+if (loadedModule.getVersion().equals(module.getVersion())) {
+// already registered
+return;
+} else {
+throw new GroovyRuntimeException("Conflicting module 
versions. Module [" + module.getName() + " is loaded in version " +
+loadedModule.getVersion() + " and you are trying 
to load version " + module.getVersion());
+}
 }
-}
 moduleRegistry.addModule(module);
 // register MetaMethods
 List metaMethods = module.getMetaMethods();
 for (MetaMethod metaMethod : metaMethods) {
 CachedClass cachedClass = metaMethod.getDeclaringClass();
 List methods = map.get(cachedClass);
-if (methods==null) {
+if (methods == null) {
 methods = new ArrayList(4);
 map.put(cachedClass, methods);
 }



[1/2] groovy git commit: formatting

2018-04-01 Thread paulk
Repository: groovy
Updated Branches:
  refs/heads/master 650c16c58 -> d4e792523


formatting


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

Branch: refs/heads/master
Commit: a3ed9d482381f8ea0e6a9efd16c35028c66791e0
Parents: 650c16c
Author: Paul King 
Authored: Sun Apr 1 23:09:29 2018 +1000
Committer: Paul King 
Committed: Sun Apr 1 23:40:33 2018 +1000

--
 .../runtime/metaclass/MetaClassRegistryImpl.java  | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/groovy/blob/a3ed9d48/src/main/java/org/codehaus/groovy/runtime/metaclass/MetaClassRegistryImpl.java
--
diff --git 
a/src/main/java/org/codehaus/groovy/runtime/metaclass/MetaClassRegistryImpl.java
 
b/src/main/java/org/codehaus/groovy/runtime/metaclass/MetaClassRegistryImpl.java
index ff30a2b..2914d02 100644
--- 
a/src/main/java/org/codehaus/groovy/runtime/metaclass/MetaClassRegistryImpl.java
+++ 
b/src/main/java/org/codehaus/groovy/runtime/metaclass/MetaClassRegistryImpl.java
@@ -513,22 +513,22 @@ public class MetaClassRegistryImpl implements 
MetaClassRegistry{
 
 public void onModule(final ExtensionModule module) {
 if (moduleRegistry.hasModule(module.getName())) {
-ExtensionModule loadedModule = 
moduleRegistry.getModule(module.getName());
-if (loadedModule.getVersion().equals(module.getVersion())) {
-// already registered
-return;
-} else {
-throw new GroovyRuntimeException("Conflicting module versions. 
Module ["+module.getName()+" is loaded in version "+
-loadedModule.getVersion()+" and you are trying to load 
version "+module.getVersion());
+ExtensionModule loadedModule = 
moduleRegistry.getModule(module.getName());
+if (loadedModule.getVersion().equals(module.getVersion())) {
+// already registered
+return;
+} else {
+throw new GroovyRuntimeException("Conflicting module 
versions. Module [" + module.getName() + " is loaded in version " +
+loadedModule.getVersion() + " and you are trying 
to load version " + module.getVersion());
+}
 }
-}
 moduleRegistry.addModule(module);
 // register MetaMethods
 List metaMethods = module.getMetaMethods();
 for (MetaMethod metaMethod : metaMethods) {
 CachedClass cachedClass = metaMethod.getDeclaringClass();
 List methods = map.get(cachedClass);
-if (methods==null) {
+if (methods == null) {
 methods = new ArrayList(4);
 map.put(cachedClass, methods);
 }



groovy git commit: formatting

2018-04-01 Thread paulk
Repository: groovy
Updated Branches:
  refs/heads/GROOVY_2_5_X d1d875387 -> 0f3ed8d6b


formatting


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

Branch: refs/heads/GROOVY_2_5_X
Commit: 0f3ed8d6bc03e78065907063083362b36b731ff7
Parents: d1d8753
Author: Paul King 
Authored: Sun Apr 1 23:09:29 2018 +1000
Committer: Paul King 
Committed: Sun Apr 1 23:09:29 2018 +1000

--
 .../runtime/metaclass/MetaClassRegistryImpl.java  | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/groovy/blob/0f3ed8d6/src/main/java/org/codehaus/groovy/runtime/metaclass/MetaClassRegistryImpl.java
--
diff --git 
a/src/main/java/org/codehaus/groovy/runtime/metaclass/MetaClassRegistryImpl.java
 
b/src/main/java/org/codehaus/groovy/runtime/metaclass/MetaClassRegistryImpl.java
index ff30a2b..2914d02 100644
--- 
a/src/main/java/org/codehaus/groovy/runtime/metaclass/MetaClassRegistryImpl.java
+++ 
b/src/main/java/org/codehaus/groovy/runtime/metaclass/MetaClassRegistryImpl.java
@@ -513,22 +513,22 @@ public class MetaClassRegistryImpl implements 
MetaClassRegistry{
 
 public void onModule(final ExtensionModule module) {
 if (moduleRegistry.hasModule(module.getName())) {
-ExtensionModule loadedModule = 
moduleRegistry.getModule(module.getName());
-if (loadedModule.getVersion().equals(module.getVersion())) {
-// already registered
-return;
-} else {
-throw new GroovyRuntimeException("Conflicting module versions. 
Module ["+module.getName()+" is loaded in version "+
-loadedModule.getVersion()+" and you are trying to load 
version "+module.getVersion());
+ExtensionModule loadedModule = 
moduleRegistry.getModule(module.getName());
+if (loadedModule.getVersion().equals(module.getVersion())) {
+// already registered
+return;
+} else {
+throw new GroovyRuntimeException("Conflicting module 
versions. Module [" + module.getName() + " is loaded in version " +
+loadedModule.getVersion() + " and you are trying 
to load version " + module.getVersion());
+}
 }
-}
 moduleRegistry.addModule(module);
 // register MetaMethods
 List metaMethods = module.getMetaMethods();
 for (MetaMethod metaMethod : metaMethods) {
 CachedClass cachedClass = metaMethod.getDeclaringClass();
 List methods = map.get(cachedClass);
-if (methods==null) {
+if (methods == null) {
 methods = new ArrayList(4);
 map.put(cachedClass, methods);
 }



[1/2] groovy git commit: formatting

2017-06-04 Thread jwagenleitner
Repository: groovy
Updated Branches:
  refs/heads/GROOVY_2_5_X d00a10f6d -> 1d34e01f2


formatting


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

Branch: refs/heads/GROOVY_2_5_X
Commit: 1d34e01f21905b20c84e42e09c1ffda57c164925
Parents: 0305a38
Author: John Wagenleitner 
Authored: Sun Jun 4 16:09:48 2017 -0700
Committer: John Wagenleitner 
Committed: Sun Jun 4 16:18:02 2017 -0700

--
 .../reflection/AccessPermissionChecker.java | 31 ++--
 .../reflection/CacheAccessControlException.java |  2 +-
 .../groovy/reflection/CachedMethod.java |  3 +-
 3 files changed, 18 insertions(+), 18 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/groovy/blob/1d34e01f/src/main/org/codehaus/groovy/reflection/AccessPermissionChecker.java
--
diff --git 
a/src/main/org/codehaus/groovy/reflection/AccessPermissionChecker.java 
b/src/main/org/codehaus/groovy/reflection/AccessPermissionChecker.java
index 73f35a9..4ad0373 100644
--- a/src/main/org/codehaus/groovy/reflection/AccessPermissionChecker.java
+++ b/src/main/org/codehaus/groovy/reflection/AccessPermissionChecker.java
@@ -26,23 +26,24 @@ import java.security.AccessControlException;
 
 import groovy.lang.GroovyObject;
 
-class AccessPermissionChecker {
+final class AccessPermissionChecker {
 
 private static final ReflectPermission REFLECT_PERMISSION = new 
ReflectPermission("suppressAccessChecks");
 
+private AccessPermissionChecker() {
+}
+
 private static void checkAccessPermission(Class declaringClass, final 
int modifiers, boolean isAccessible) {
 final SecurityManager securityManager = System.getSecurityManager();
 if (securityManager != null && isAccessible) {
-if (((modifiers & Modifier.PRIVATE) != 0
-|| ((modifiers & (Modifier.PUBLIC | 
Modifier.PROTECTED)) == 0
- && 
packageCanNotBeAddedAnotherClass(declaringClass)))
-&& 
!GroovyObject.class.isAssignableFrom(declaringClass)) {
-securityManager.checkPermission(REFLECT_PERMISSION);
-}
-else if ((modifiers & (Modifier.PROTECTED)) != 0
-&& declaringClass.equals(ClassLoader.class)){
-securityManager.checkCreateClassLoader();
-}
+if (((modifiers & Modifier.PRIVATE) != 0
+|| ((modifiers & (Modifier.PUBLIC | Modifier.PROTECTED)) 
== 0
+&& packageCanNotBeAddedAnotherClass(declaringClass)))
+&& !GroovyObject.class.isAssignableFrom(declaringClass)) {
+securityManager.checkPermission(REFLECT_PERMISSION);
+} else if ((modifiers & (Modifier.PROTECTED)) != 0 && 
declaringClass.equals(ClassLoader.class)) {
+securityManager.checkCreateClassLoader();
+}
 }
 }
 
@@ -60,7 +61,8 @@ class AccessPermissionChecker {
 
 private static CacheAccessControlException 
createCacheAccessControlExceptionOf(Method method, AccessControlException e) {
 return new CacheAccessControlException(
-"Groovy object can not access method " + method.getName()  + " 
cacheAccessControlExceptionOf class " + method.getDeclaringClass().getName()
+"Groovy object can not access method " + method.getName()
++ " cacheAccessControlExceptionOf class " + 
method.getDeclaringClass().getName()
 + " with modifiers \"" + 
Modifier.toString(method.getModifiers()) + "\"", e);
 }
 
@@ -74,10 +76,9 @@ class AccessPermissionChecker {
 
 private static CacheAccessControlException 
createCacheAccessControlExceptionOf(Field field, AccessControlException e) {
 return new CacheAccessControlException(
-"Groovy object can not access field " + field.getName()  + " 
cacheAccessControlExceptionOf class " + field.getDeclaringClass().getName()
+"Groovy object can not access field " + field.getName()
++ " cacheAccessControlExceptionOf class " + 
field.getDeclaringClass().getName()
 + " with modifiers \"" + 
Modifier.toString(field.getModifiers()) + "\"", e);
 }
 
-private AccessPermissionChecker() {}
-
 }

http://git-wip-us.apache.org/repos/asf/groovy/blob/1d34e01f/src/main/org/codehaus/groovy/reflection/CacheAccessControlException.java
--
diff --git 

[1/2] groovy git commit: formatting

2017-06-04 Thread jwagenleitner
Repository: groovy
Updated Branches:
  refs/heads/GROOVY_2_6_X 14b3d46c5 -> 0aeb0a773


formatting


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

Branch: refs/heads/GROOVY_2_6_X
Commit: 0aeb0a77329005c3c05a4be9a70dae0eae5a8a52
Parents: b039c35
Author: John Wagenleitner 
Authored: Sun Jun 4 16:09:48 2017 -0700
Committer: John Wagenleitner 
Committed: Sun Jun 4 16:16:32 2017 -0700

--
 .../reflection/AccessPermissionChecker.java | 31 ++--
 .../reflection/CacheAccessControlException.java |  2 +-
 .../groovy/reflection/CachedMethod.java |  3 +-
 3 files changed, 18 insertions(+), 18 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/groovy/blob/0aeb0a77/src/main/org/codehaus/groovy/reflection/AccessPermissionChecker.java
--
diff --git 
a/src/main/org/codehaus/groovy/reflection/AccessPermissionChecker.java 
b/src/main/org/codehaus/groovy/reflection/AccessPermissionChecker.java
index 73f35a9..4ad0373 100644
--- a/src/main/org/codehaus/groovy/reflection/AccessPermissionChecker.java
+++ b/src/main/org/codehaus/groovy/reflection/AccessPermissionChecker.java
@@ -26,23 +26,24 @@ import java.security.AccessControlException;
 
 import groovy.lang.GroovyObject;
 
-class AccessPermissionChecker {
+final class AccessPermissionChecker {
 
 private static final ReflectPermission REFLECT_PERMISSION = new 
ReflectPermission("suppressAccessChecks");
 
+private AccessPermissionChecker() {
+}
+
 private static void checkAccessPermission(Class declaringClass, final 
int modifiers, boolean isAccessible) {
 final SecurityManager securityManager = System.getSecurityManager();
 if (securityManager != null && isAccessible) {
-if (((modifiers & Modifier.PRIVATE) != 0
-|| ((modifiers & (Modifier.PUBLIC | 
Modifier.PROTECTED)) == 0
- && 
packageCanNotBeAddedAnotherClass(declaringClass)))
-&& 
!GroovyObject.class.isAssignableFrom(declaringClass)) {
-securityManager.checkPermission(REFLECT_PERMISSION);
-}
-else if ((modifiers & (Modifier.PROTECTED)) != 0
-&& declaringClass.equals(ClassLoader.class)){
-securityManager.checkCreateClassLoader();
-}
+if (((modifiers & Modifier.PRIVATE) != 0
+|| ((modifiers & (Modifier.PUBLIC | Modifier.PROTECTED)) 
== 0
+&& packageCanNotBeAddedAnotherClass(declaringClass)))
+&& !GroovyObject.class.isAssignableFrom(declaringClass)) {
+securityManager.checkPermission(REFLECT_PERMISSION);
+} else if ((modifiers & (Modifier.PROTECTED)) != 0 && 
declaringClass.equals(ClassLoader.class)) {
+securityManager.checkCreateClassLoader();
+}
 }
 }
 
@@ -60,7 +61,8 @@ class AccessPermissionChecker {
 
 private static CacheAccessControlException 
createCacheAccessControlExceptionOf(Method method, AccessControlException e) {
 return new CacheAccessControlException(
-"Groovy object can not access method " + method.getName()  + " 
cacheAccessControlExceptionOf class " + method.getDeclaringClass().getName()
+"Groovy object can not access method " + method.getName()
++ " cacheAccessControlExceptionOf class " + 
method.getDeclaringClass().getName()
 + " with modifiers \"" + 
Modifier.toString(method.getModifiers()) + "\"", e);
 }
 
@@ -74,10 +76,9 @@ class AccessPermissionChecker {
 
 private static CacheAccessControlException 
createCacheAccessControlExceptionOf(Field field, AccessControlException e) {
 return new CacheAccessControlException(
-"Groovy object can not access field " + field.getName()  + " 
cacheAccessControlExceptionOf class " + field.getDeclaringClass().getName()
+"Groovy object can not access field " + field.getName()
++ " cacheAccessControlExceptionOf class " + 
field.getDeclaringClass().getName()
 + " with modifiers \"" + 
Modifier.toString(field.getModifiers()) + "\"", e);
 }
 
-private AccessPermissionChecker() {}
-
 }

http://git-wip-us.apache.org/repos/asf/groovy/blob/0aeb0a77/src/main/org/codehaus/groovy/reflection/CacheAccessControlException.java
--
diff --git 

[03/50] [abbrv] groovy git commit: formatting and general tidy up of some tests

2016-11-10 Thread sunlan
formatting and general tidy up of some tests


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

Branch: refs/heads/parrot
Commit: 94137c91379b8152afe7e76e59c6537dc5a12ef3
Parents: 55c186f
Author: paulk 
Authored: Tue Oct 4 10:59:04 2016 +1000
Committer: paulk 
Committed: Tue Oct 4 10:59:32 2016 +1000

--
 gradle/pomconfigurer.gradle |  3 +++
 src/tck/test/gls/ch03/s01/Unicode1.groovy   | 11 +++-
 src/tck/test/gls/ch03/s01/Unicode2.groovy   | 18 +
 .../gls/ch03/s02/LexicalTranslation1.groovy |  4 +--
 src/tck/test/gls/ch03/s02/Longest1.groovy   |  2 --
 .../test/gls/ch03/s03/UnicodeEscapes1.groovy|  5 +---
 .../test/gls/ch03/s03/UnicodeEscapes2.groovy| 27 ++--
 7 files changed, 30 insertions(+), 40 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/groovy/blob/94137c91/gradle/pomconfigurer.gradle
--
diff --git a/gradle/pomconfigurer.gradle b/gradle/pomconfigurer.gradle
index 3f08f4a..2877e8a 100644
--- a/gradle/pomconfigurer.gradle
+++ b/gradle/pomconfigurer.gradle
@@ -576,6 +576,9 @@ project.ext.pomConfigureClosureWithoutTweaks = {
 contributor {
 name 'Santhosh Kumar T'
 }
+contributor {
+name 'Alan Green'
+}
 }
 mailingLists {
 mailingList {

http://git-wip-us.apache.org/repos/asf/groovy/blob/94137c91/src/tck/test/gls/ch03/s01/Unicode1.groovy
--
diff --git a/src/tck/test/gls/ch03/s01/Unicode1.groovy 
b/src/tck/test/gls/ch03/s01/Unicode1.groovy
index 45ab780..92984ab 100644
--- a/src/tck/test/gls/ch03/s01/Unicode1.groovy
+++ b/src/tck/test/gls/ch03/s01/Unicode1.groovy
@@ -17,17 +17,14 @@
  *  under the License.
  */
 package gls.ch03.s01;
+
 /**
  * Except for comments, identifiers and the contents of ... string 
  * literals, all input elements are formed from ASCII characters.
  *
  * TODO: Find a better way to test these things
  * Note that this is a little hard to test since the input file is ASCII.
- *
- * @author Alan Green
- * @author Jeremy Rayner
  */
-
 class Unicode1 extends GroovyTestCase {
 //TODO: find some way to assert that Unicode3.0 + is available
 
@@ -35,7 +32,7 @@ class Unicode1 extends GroovyTestCase {
   * This doc comment checks that Unicode is allowed in javadoc.
   * e.g. \u05D0\u2136\u05d3\u05d7
   */
-public void testComments() {
+void testComments() {
 // Unicode is allowed in comments
 // This is a comment \u0410\u0406\u0414\u0419
 /* Another comment \u05D0\u2136\u05d3\u05d7 */
@@ -44,12 +41,12 @@ class Unicode1 extends GroovyTestCase {
 /***/ // Also valid
 }
 
-public void testStringLiterals() {
+void testStringLiterals() {
 assert 1 == "\u0040".length()
 assert "A" == "\u0041"
 }
 
-public void testCharNotAvailableAsLiteral() {
+void testCharNotAvailableAsLiteral() {
 char a = 'x'
 char b = "x"
 def c = "x".charAt(0)

http://git-wip-us.apache.org/repos/asf/groovy/blob/94137c91/src/tck/test/gls/ch03/s01/Unicode2.groovy
--
diff --git a/src/tck/test/gls/ch03/s01/Unicode2.groovy 
b/src/tck/test/gls/ch03/s01/Unicode2.groovy
index be60ff6..35fbf72 100644
--- a/src/tck/test/gls/ch03/s01/Unicode2.groovy
+++ b/src/tck/test/gls/ch03/s01/Unicode2.groovy
@@ -17,24 +17,20 @@
  *  under the License.
  */
 package gls.ch03.s01;
+
 /**
  * Except for comments, identifiers and the contents of ... string 
  * literals, all input elements are formed from ASCII characters.
- *
- * TODO: Find a better way to test these things
- * Note that this is a little hard to test since the input file is ASCII.
- *
- * @author Jeremy Rayner
  */
-
 class Unicode2 extends GroovyTestCase {
 
-//todo - this doesn't seem to work in raw Java5.0 either
-//public void testUTF16SupplementaryCharacters() {
-//assert 1 == "\uD840\uDC00".length()
-//}
+void testUTF16SupplementaryCharacters() {
+def s = "\uD840\uDC00"
+assert 2 == s.length() // number of Unicode code units
+assert 1 == s.codePointCount(0, s.length()) // number of Unicode code 
points
+}
 
-public void testIdentifiers() {
+void testIdentifiers() {
 def foo\u0044 = 12
 assert 20 == foo\u0044 + 8
 }


[16/50] [abbrv] groovy git commit: formatting

2016-11-10 Thread sunlan
formatting


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

Branch: refs/heads/parrot
Commit: 2faa31baf0ba7c4afb947b152ee0830d0a60b34f
Parents: 597a8d5
Author: paulk 
Authored: Mon Oct 10 15:48:02 2016 +1000
Committer: paulk 
Committed: Mon Oct 10 15:48:02 2016 +1000

--
 .../groovy/classgen/asm/sc/bugs/Groovy6757Bug.groovy | 8 
 1 file changed, 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/groovy/blob/2faa31ba/src/test/org/codehaus/groovy/classgen/asm/sc/bugs/Groovy6757Bug.groovy
--
diff --git 
a/src/test/org/codehaus/groovy/classgen/asm/sc/bugs/Groovy6757Bug.groovy 
b/src/test/org/codehaus/groovy/classgen/asm/sc/bugs/Groovy6757Bug.groovy
index 0f67c6c..22a59de 100644
--- a/src/test/org/codehaus/groovy/classgen/asm/sc/bugs/Groovy6757Bug.groovy
+++ b/src/test/org/codehaus/groovy/classgen/asm/sc/bugs/Groovy6757Bug.groovy
@@ -16,14 +16,6 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-
-
-
-
-
-
-
-
 package org.codehaus.groovy.classgen.asm.sc.bugs
 
 import groovy.transform.stc.StaticTypeCheckingTestCase



groovy git commit: formatting

2016-10-09 Thread paulk
Repository: groovy
Updated Branches:
  refs/heads/GROOVY_2_4_X 6fd5c31df -> 4eadbde40


formatting


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

Branch: refs/heads/GROOVY_2_4_X
Commit: 4eadbde40c6d284c4054ca75bb3d1b8483b282fc
Parents: 6fd5c31
Author: paulk 
Authored: Mon Oct 10 15:48:02 2016 +1000
Committer: paulk 
Committed: Mon Oct 10 15:51:02 2016 +1000

--
 .../groovy/classgen/asm/sc/bugs/Groovy6757Bug.groovy | 8 
 1 file changed, 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/groovy/blob/4eadbde4/src/test/org/codehaus/groovy/classgen/asm/sc/bugs/Groovy6757Bug.groovy
--
diff --git 
a/src/test/org/codehaus/groovy/classgen/asm/sc/bugs/Groovy6757Bug.groovy 
b/src/test/org/codehaus/groovy/classgen/asm/sc/bugs/Groovy6757Bug.groovy
index 0f67c6c..22a59de 100644
--- a/src/test/org/codehaus/groovy/classgen/asm/sc/bugs/Groovy6757Bug.groovy
+++ b/src/test/org/codehaus/groovy/classgen/asm/sc/bugs/Groovy6757Bug.groovy
@@ -16,14 +16,6 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-
-
-
-
-
-
-
-
 package org.codehaus.groovy.classgen.asm.sc.bugs
 
 import groovy.transform.stc.StaticTypeCheckingTestCase



groovy git commit: formatting

2016-10-09 Thread paulk
Repository: groovy
Updated Branches:
  refs/heads/master 597a8d563 -> 2faa31baf


formatting


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

Branch: refs/heads/master
Commit: 2faa31baf0ba7c4afb947b152ee0830d0a60b34f
Parents: 597a8d5
Author: paulk 
Authored: Mon Oct 10 15:48:02 2016 +1000
Committer: paulk 
Committed: Mon Oct 10 15:48:02 2016 +1000

--
 .../groovy/classgen/asm/sc/bugs/Groovy6757Bug.groovy | 8 
 1 file changed, 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/groovy/blob/2faa31ba/src/test/org/codehaus/groovy/classgen/asm/sc/bugs/Groovy6757Bug.groovy
--
diff --git 
a/src/test/org/codehaus/groovy/classgen/asm/sc/bugs/Groovy6757Bug.groovy 
b/src/test/org/codehaus/groovy/classgen/asm/sc/bugs/Groovy6757Bug.groovy
index 0f67c6c..22a59de 100644
--- a/src/test/org/codehaus/groovy/classgen/asm/sc/bugs/Groovy6757Bug.groovy
+++ b/src/test/org/codehaus/groovy/classgen/asm/sc/bugs/Groovy6757Bug.groovy
@@ -16,14 +16,6 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-
-
-
-
-
-
-
-
 package org.codehaus.groovy.classgen.asm.sc.bugs
 
 import groovy.transform.stc.StaticTypeCheckingTestCase



groovy git commit: formatting and general tidy up of some tests

2016-10-04 Thread paulk
Repository: groovy
Updated Branches:
  refs/heads/GROOVY_2_4_X 13d1abe80 -> 331a2c524


formatting and general tidy up of some tests


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

Branch: refs/heads/GROOVY_2_4_X
Commit: 331a2c52479b44ffd931e0f4d623bf1327324f14
Parents: 13d1abe
Author: paulk 
Authored: Tue Oct 4 10:59:04 2016 +1000
Committer: paulk 
Committed: Tue Oct 4 11:01:55 2016 +1000

--
 gradle/pomconfigurer.gradle | 12 +
 src/tck/test/gls/ch03/s01/Unicode1.groovy   | 11 +++-
 src/tck/test/gls/ch03/s01/Unicode2.groovy   | 18 +
 .../gls/ch03/s02/LexicalTranslation1.groovy |  4 +--
 src/tck/test/gls/ch03/s02/Longest1.groovy   |  2 --
 .../test/gls/ch03/s03/UnicodeEscapes1.groovy|  5 +---
 .../test/gls/ch03/s03/UnicodeEscapes2.groovy| 27 ++--
 7 files changed, 39 insertions(+), 40 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/groovy/blob/331a2c52/gradle/pomconfigurer.gradle
--
diff --git a/gradle/pomconfigurer.gradle b/gradle/pomconfigurer.gradle
index c105f15..2877e8a 100644
--- a/gradle/pomconfigurer.gradle
+++ b/gradle/pomconfigurer.gradle
@@ -567,6 +567,18 @@ project.ext.pomConfigureClosureWithoutTweaks = {
 contributor {
 name 'Marcin Grzejszczak'
 }
+contributor {
+name 'Pap Lőrinc'
+}
+contributor {
+name 'Guillaume Balaine'
+}
+contributor {
+name 'Santhosh Kumar T'
+}
+contributor {
+name 'Alan Green'
+}
 }
 mailingLists {
 mailingList {

http://git-wip-us.apache.org/repos/asf/groovy/blob/331a2c52/src/tck/test/gls/ch03/s01/Unicode1.groovy
--
diff --git a/src/tck/test/gls/ch03/s01/Unicode1.groovy 
b/src/tck/test/gls/ch03/s01/Unicode1.groovy
index 45ab780..92984ab 100644
--- a/src/tck/test/gls/ch03/s01/Unicode1.groovy
+++ b/src/tck/test/gls/ch03/s01/Unicode1.groovy
@@ -17,17 +17,14 @@
  *  under the License.
  */
 package gls.ch03.s01;
+
 /**
  * Except for comments, identifiers and the contents of ... string 
  * literals, all input elements are formed from ASCII characters.
  *
  * TODO: Find a better way to test these things
  * Note that this is a little hard to test since the input file is ASCII.
- *
- * @author Alan Green
- * @author Jeremy Rayner
  */
-
 class Unicode1 extends GroovyTestCase {
 //TODO: find some way to assert that Unicode3.0 + is available
 
@@ -35,7 +32,7 @@ class Unicode1 extends GroovyTestCase {
   * This doc comment checks that Unicode is allowed in javadoc.
   * e.g. \u05D0\u2136\u05d3\u05d7
   */
-public void testComments() {
+void testComments() {
 // Unicode is allowed in comments
 // This is a comment \u0410\u0406\u0414\u0419
 /* Another comment \u05D0\u2136\u05d3\u05d7 */
@@ -44,12 +41,12 @@ class Unicode1 extends GroovyTestCase {
 /***/ // Also valid
 }
 
-public void testStringLiterals() {
+void testStringLiterals() {
 assert 1 == "\u0040".length()
 assert "A" == "\u0041"
 }
 
-public void testCharNotAvailableAsLiteral() {
+void testCharNotAvailableAsLiteral() {
 char a = 'x'
 char b = "x"
 def c = "x".charAt(0)

http://git-wip-us.apache.org/repos/asf/groovy/blob/331a2c52/src/tck/test/gls/ch03/s01/Unicode2.groovy
--
diff --git a/src/tck/test/gls/ch03/s01/Unicode2.groovy 
b/src/tck/test/gls/ch03/s01/Unicode2.groovy
index be60ff6..35fbf72 100644
--- a/src/tck/test/gls/ch03/s01/Unicode2.groovy
+++ b/src/tck/test/gls/ch03/s01/Unicode2.groovy
@@ -17,24 +17,20 @@
  *  under the License.
  */
 package gls.ch03.s01;
+
 /**
  * Except for comments, identifiers and the contents of ... string 
  * literals, all input elements are formed from ASCII characters.
- *
- * TODO: Find a better way to test these things
- * Note that this is a little hard to test since the input file is ASCII.
- *
- * @author Jeremy Rayner
  */
-
 class Unicode2 extends GroovyTestCase {
 
-//todo - this doesn't seem to work in raw Java5.0 either
-//public void testUTF16SupplementaryCharacters() {
-//assert 1 == "\uD840\uDC00".length()
-//}
+void testUTF16SupplementaryCharacters() {
+def s = "\uD840\uDC00"
+assert 2 == s.length() // number 

groovy git commit: formatting and general tidy up of some tests

2016-10-03 Thread paulk
Repository: groovy
Updated Branches:
  refs/heads/master 55c186f42 -> 94137c913


formatting and general tidy up of some tests


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

Branch: refs/heads/master
Commit: 94137c91379b8152afe7e76e59c6537dc5a12ef3
Parents: 55c186f
Author: paulk 
Authored: Tue Oct 4 10:59:04 2016 +1000
Committer: paulk 
Committed: Tue Oct 4 10:59:32 2016 +1000

--
 gradle/pomconfigurer.gradle |  3 +++
 src/tck/test/gls/ch03/s01/Unicode1.groovy   | 11 +++-
 src/tck/test/gls/ch03/s01/Unicode2.groovy   | 18 +
 .../gls/ch03/s02/LexicalTranslation1.groovy |  4 +--
 src/tck/test/gls/ch03/s02/Longest1.groovy   |  2 --
 .../test/gls/ch03/s03/UnicodeEscapes1.groovy|  5 +---
 .../test/gls/ch03/s03/UnicodeEscapes2.groovy| 27 ++--
 7 files changed, 30 insertions(+), 40 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/groovy/blob/94137c91/gradle/pomconfigurer.gradle
--
diff --git a/gradle/pomconfigurer.gradle b/gradle/pomconfigurer.gradle
index 3f08f4a..2877e8a 100644
--- a/gradle/pomconfigurer.gradle
+++ b/gradle/pomconfigurer.gradle
@@ -576,6 +576,9 @@ project.ext.pomConfigureClosureWithoutTweaks = {
 contributor {
 name 'Santhosh Kumar T'
 }
+contributor {
+name 'Alan Green'
+}
 }
 mailingLists {
 mailingList {

http://git-wip-us.apache.org/repos/asf/groovy/blob/94137c91/src/tck/test/gls/ch03/s01/Unicode1.groovy
--
diff --git a/src/tck/test/gls/ch03/s01/Unicode1.groovy 
b/src/tck/test/gls/ch03/s01/Unicode1.groovy
index 45ab780..92984ab 100644
--- a/src/tck/test/gls/ch03/s01/Unicode1.groovy
+++ b/src/tck/test/gls/ch03/s01/Unicode1.groovy
@@ -17,17 +17,14 @@
  *  under the License.
  */
 package gls.ch03.s01;
+
 /**
  * Except for comments, identifiers and the contents of ... string 
  * literals, all input elements are formed from ASCII characters.
  *
  * TODO: Find a better way to test these things
  * Note that this is a little hard to test since the input file is ASCII.
- *
- * @author Alan Green
- * @author Jeremy Rayner
  */
-
 class Unicode1 extends GroovyTestCase {
 //TODO: find some way to assert that Unicode3.0 + is available
 
@@ -35,7 +32,7 @@ class Unicode1 extends GroovyTestCase {
   * This doc comment checks that Unicode is allowed in javadoc.
   * e.g. \u05D0\u2136\u05d3\u05d7
   */
-public void testComments() {
+void testComments() {
 // Unicode is allowed in comments
 // This is a comment \u0410\u0406\u0414\u0419
 /* Another comment \u05D0\u2136\u05d3\u05d7 */
@@ -44,12 +41,12 @@ class Unicode1 extends GroovyTestCase {
 /***/ // Also valid
 }
 
-public void testStringLiterals() {
+void testStringLiterals() {
 assert 1 == "\u0040".length()
 assert "A" == "\u0041"
 }
 
-public void testCharNotAvailableAsLiteral() {
+void testCharNotAvailableAsLiteral() {
 char a = 'x'
 char b = "x"
 def c = "x".charAt(0)

http://git-wip-us.apache.org/repos/asf/groovy/blob/94137c91/src/tck/test/gls/ch03/s01/Unicode2.groovy
--
diff --git a/src/tck/test/gls/ch03/s01/Unicode2.groovy 
b/src/tck/test/gls/ch03/s01/Unicode2.groovy
index be60ff6..35fbf72 100644
--- a/src/tck/test/gls/ch03/s01/Unicode2.groovy
+++ b/src/tck/test/gls/ch03/s01/Unicode2.groovy
@@ -17,24 +17,20 @@
  *  under the License.
  */
 package gls.ch03.s01;
+
 /**
  * Except for comments, identifiers and the contents of ... string 
  * literals, all input elements are formed from ASCII characters.
- *
- * TODO: Find a better way to test these things
- * Note that this is a little hard to test since the input file is ASCII.
- *
- * @author Jeremy Rayner
  */
-
 class Unicode2 extends GroovyTestCase {
 
-//todo - this doesn't seem to work in raw Java5.0 either
-//public void testUTF16SupplementaryCharacters() {
-//assert 1 == "\uD840\uDC00".length()
-//}
+void testUTF16SupplementaryCharacters() {
+def s = "\uD840\uDC00"
+assert 2 == s.length() // number of Unicode code units
+assert 1 == s.codePointCount(0, s.length()) // number of Unicode code 
points
+}
 
-public void testIdentifiers() {
+void testIdentifiers() {
 def foo\u0044 = 12
 assert 20 == foo\u0044 + 8
 }


groovy git commit: formatting

2016-07-25 Thread paulk
Repository: groovy
Updated Branches:
  refs/heads/master 0d86565c5 -> 6f6735356


formatting


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

Branch: refs/heads/master
Commit: 6f67353565e98c3c8c707f355974ff1296231275
Parents: 0d86565
Author: paulk 
Authored: Mon Jul 25 18:15:13 2016 +1000
Committer: paulk 
Committed: Mon Jul 25 18:15:13 2016 +1000

--
 .../typehandling/DefaultTypeTransformation.java | 167 +--
 1 file changed, 80 insertions(+), 87 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/groovy/blob/6f673535/src/main/org/codehaus/groovy/runtime/typehandling/DefaultTypeTransformation.java
--
diff --git 
a/src/main/org/codehaus/groovy/runtime/typehandling/DefaultTypeTransformation.java
 
b/src/main/org/codehaus/groovy/runtime/typehandling/DefaultTypeTransformation.java
index 94e0084..e55b574 100644
--- 
a/src/main/org/codehaus/groovy/runtime/typehandling/DefaultTypeTransformation.java
+++ 
b/src/main/org/codehaus/groovy/runtime/typehandling/DefaultTypeTransformation.java
@@ -24,7 +24,14 @@ import groovy.lang.GroovyRuntimeException;
 
 import org.codehaus.groovy.reflection.ReflectionCache;
 import org.codehaus.groovy.reflection.stdclasses.CachedSAMClass;
-import org.codehaus.groovy.runtime.*;
+import org.codehaus.groovy.runtime.DefaultGroovyMethods;
+import org.codehaus.groovy.runtime.InvokerHelper;
+import org.codehaus.groovy.runtime.InvokerInvocationException;
+import org.codehaus.groovy.runtime.IteratorClosureAdapter;
+import org.codehaus.groovy.runtime.MethodClosure;
+import org.codehaus.groovy.runtime.NullObject;
+import org.codehaus.groovy.runtime.ResourceGroovyMethods;
+import org.codehaus.groovy.runtime.StringGroovyMethods;
 
 import java.io.File;
 import java.io.IOException;
@@ -34,12 +41,17 @@ import java.lang.reflect.Modifier;
 import java.math.BigDecimal;
 import java.math.BigInteger;
 import java.text.MessageFormat;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
 
 /**
  * Class providing various type conversions, coercions and boxing/unboxing 
operations.
- *
- * @author Guillaume Laforge
  */
 public class DefaultTypeTransformation {
 
@@ -50,7 +62,7 @@ public class DefaultTypeTransformation {
 //  
 //  unboxing methods
 //     
-
+
 public static byte byteUnbox(Object value) {
 Number n = castToNumber(value, byte.class);
 return n.byteValue();
@@ -87,7 +99,7 @@ public class DefaultTypeTransformation {
 public static double doubleUnbox(Object value) {
 Number n = castToNumber(value, double.class);
 return n.doubleValue();
-} 
+}
 
 //  
 //  boxing methods
@@ -132,12 +144,12 @@ public class DefaultTypeTransformation {
 public static Object box(double value) {
 return Double.valueOf(value);
 }
-
+
 public static Number castToNumber(Object object) {
 // default to Number class in exception details, else use the 
specified Number subtype.
 return castToNumber(object, Number.class);
 }
-
+
 public static Number castToNumber(Object object, Class type) {
 if (object instanceof Number)
 return (Number) object;
@@ -165,7 +177,7 @@ public class DefaultTypeTransformation {
 
 /**
  * Method used for coercing an object to a boolean value,
- * thanks to an asBoolean() method added on types. 
+ * thanks to an asBoolean() method added on types.
  *
  * @param object to coerce to a boolean value
  * @return a boolean value
@@ -175,16 +187,16 @@ public class DefaultTypeTransformation {
 if (object == null) {
 return false;
 }
-
+
 // equality check is enough and faster than instanceof check, no need 
to check superclasses since Boolean is final
-if (object.getClass() == Boolean.class) {   
-return ((Boolean)object).booleanValue();
+if (object.getClass() == Boolean.class) {
+return ((Boolean) object).booleanValue();
 }
-
+
 // if the object is not null and no Boolean, try to call an 
asBoolean() method on the object
-return