[2/2] groovy git commit: formatting only
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 KingAuthored: 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
[2/2] groovy git commit: formatting only
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 KingAuthored: 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 =