sort & format Re-formatted the rest of apichecker files so that assignments do not line wrap immediately after "=" sign, which seems to be consistent with Scott's reformatting (r3357). git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@3366 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/tools/api-checker/src/com/google/gwt/tools/apichecker/ApiChange.java b/tools/api-checker/src/com/google/gwt/tools/apichecker/ApiChange.java index 323454f..8c967c2 100644 --- a/tools/api-checker/src/com/google/gwt/tools/apichecker/ApiChange.java +++ b/tools/api-checker/src/com/google/gwt/tools/apichecker/ApiChange.java
@@ -16,7 +16,6 @@ package com.google.gwt.tools.apichecker; - import java.util.HashMap; import java.util.Map; @@ -108,9 +107,8 @@ @Override public String toString() { if (stringRepresentation == null) { - stringRepresentation = - element.getRelativeSignature() + ApiDiffGenerator.DELIMITER - + status.name(); + stringRepresentation = element.getRelativeSignature() + + ApiDiffGenerator.DELIMITER + status.name(); } return stringRepresentation; }
diff --git a/tools/api-checker/src/com/google/gwt/tools/apichecker/ApiClass.java b/tools/api-checker/src/com/google/gwt/tools/apichecker/ApiClass.java index c883930..7525380 100644 --- a/tools/api-checker/src/com/google/gwt/tools/apichecker/ApiClass.java +++ b/tools/api-checker/src/com/google/gwt/tools/apichecker/ApiClass.java
@@ -61,8 +61,7 @@ * 2 entries in the list: one for CONSTRUCTOR, and the other for METHOD. Each * entry is a mapping from MethodName#args to a set of ApiAbstractMethod */ - private EnumMap<MethodType, Map<String, Set<ApiAbstractMethod>>> apiMembersByName = - null; + private EnumMap<MethodType, Map<String, Set<ApiAbstractMethod>>> apiMembersByName = null; private final ApiPackage apiPackage; private final JClassType classType; @@ -78,8 +77,7 @@ logger = apiPackage.getApiContainer().getLogger(); ApiContainer apiContainer = apiPackage.getApiContainer(); isSubclassableApiClass = apiContainer.isSubclassableApiClass(classType); - isNotsubclassableApiClass = - apiContainer.isNotsubclassableApiClass(classType); + isNotsubclassableApiClass = apiContainer.isNotsubclassableApiClass(classType); isInstantiableApiClass = apiContainer.isInstantiableApiClass(classType); } @@ -100,8 +98,8 @@ StringBuffer sb = new StringBuffer(); sb.append("\t" + getName() + "\n"); if (apiFields != null) { - ArrayList<ApiField> apiFieldsList = - new ArrayList<ApiField>(apiFields.values()); + ArrayList<ApiField> apiFieldsList = new ArrayList<ApiField>( + apiFields.values()); Collections.sort(apiFieldsList); for (ApiField apiField : apiFieldsList) { sb.append("\t\t" + apiField.getRelativeSignature() + "\n"); @@ -110,13 +108,12 @@ if (apiMembersByName != null && apiMembersByName.get(MethodType.METHOD) != null) { for (MethodType method : MethodType.values()) { - HashSet<ApiAbstractMethod> apiMethodsSet = - new HashSet<ApiAbstractMethod>(); + HashSet<ApiAbstractMethod> apiMethodsSet = new HashSet<ApiAbstractMethod>(); for (Set<ApiAbstractMethod> methodsSets : apiMembersByName.get(method).values()) { apiMethodsSet.addAll(methodsSets); } - ArrayList<ApiAbstractMethod> apiMethodsList = - new ArrayList<ApiAbstractMethod>(apiMethodsSet); + ArrayList<ApiAbstractMethod> apiMethodsList = new ArrayList<ApiAbstractMethod>( + apiMethodsSet); Collections.sort(apiMethodsList); for (ApiAbstractMethod apiMethod : apiMethodsList) { sb.append("\t\t" + apiMethod.getRelativeSignature() + "\n"); @@ -308,14 +305,12 @@ } private void initializeApiConstructorsAndMethods() { - apiMembersByName = - new EnumMap<MethodType, Map<String, Set<ApiAbstractMethod>>>( - MethodType.class); + apiMembersByName = new EnumMap<MethodType, Map<String, Set<ApiAbstractMethod>>>( + MethodType.class); for (MethodType method : MethodType.values()) { apiMembersByName.put(method, new HashMap<String, Set<ApiAbstractMethod>>()); - Map<String, Set<ApiAbstractMethod>> pointer = - apiMembersByName.get(method); + Map<String, Set<ApiAbstractMethod>> pointer = apiMembersByName.get(method); List<String> notAddedMembers = new ArrayList<String>(); JAbstractMethod jams[] = getAccessibleMethods(method); for (JAbstractMethod jam : jams) {
diff --git a/tools/api-checker/src/com/google/gwt/tools/apichecker/ApiCompatibilityChecker.java b/tools/api-checker/src/com/google/gwt/tools/apichecker/ApiCompatibilityChecker.java index bae6c0d..3d01fd0 100644 --- a/tools/api-checker/src/com/google/gwt/tools/apichecker/ApiCompatibilityChecker.java +++ b/tools/api-checker/src/com/google/gwt/tools/apichecker/ApiCompatibilityChecker.java
@@ -98,8 +98,7 @@ public static final boolean PROCESS_NEW_API = true; // true by default - public static final boolean REMOVE_NON_SUBCLASSABLE_ABSTRACT_CLASS_FROM_API = - true; + public static final boolean REMOVE_NON_SUBCLASSABLE_ABSTRACT_CLASS_FROM_API = true; // Tweak for log output. public static final TreeLogger.Type type = TreeLogger.ERROR; @@ -138,8 +137,8 @@ } if (PROCESS_NEW_API && PROCESS_EXISTING_API) { - Collection<ApiChange> apiDifferences = - getApiDiff(newApi, existingApi, readWhiteListFromFile(args[0])); + Collection<ApiChange> apiDifferences = getApiDiff(newApi, existingApi, + readWhiteListFromFile(args[0])); for (ApiChange apiChange : apiDifferences) { System.out.println(apiChange); }
diff --git a/tools/api-checker/src/com/google/gwt/tools/apichecker/ApiDiffGenerator.java b/tools/api-checker/src/com/google/gwt/tools/apichecker/ApiDiffGenerator.java index 0593887..60afc44 100644 --- a/tools/api-checker/src/com/google/gwt/tools/apichecker/ApiDiffGenerator.java +++ b/tools/api-checker/src/com/google/gwt/tools/apichecker/ApiDiffGenerator.java
@@ -52,10 +52,8 @@ } TypeOracle newApiTypeOracle = classType2.getOracle(); // get the appropriate classObject in the newApi - JClassType firstClassType = - newApiTypeOracle.findType(classType1.getQualifiedSourceName()); - JClassType secondClassType = - newApiTypeOracle.findType(classType2.getQualifiedSourceName()); + JClassType firstClassType = newApiTypeOracle.findType(classType1.getQualifiedSourceName()); + JClassType secondClassType = newApiTypeOracle.findType(classType2.getQualifiedSourceName()); // The types might not necessarily exist in the newApi if (firstClassType == null || secondClassType == null) { return false; @@ -72,8 +70,7 @@ return intersection; } - Map<String, ApiPackageDiffGenerator> intersectingPackages = - new HashMap<String, ApiPackageDiffGenerator>(); + Map<String, ApiPackageDiffGenerator> intersectingPackages = new HashMap<String, ApiPackageDiffGenerator>(); Set<String> missingPackageNames; final ApiContainer newApi; final ApiContainer oldApi; @@ -90,8 +87,7 @@ cleanApiDiff(); } Collection<ApiChange> collection = new ArrayList<ApiChange>(); - Set<ApiPackage> missingPackages = - oldApi.getApiPackagesBySet(missingPackageNames); + Set<ApiPackage> missingPackages = oldApi.getApiPackagesBySet(missingPackageNames); for (ApiPackage missingPackage : missingPackages) { collection.add(new ApiChange(missingPackage, ApiChange.Status.MISSING)); } @@ -114,8 +110,8 @@ } else { i = -1; } - ApiClassDiffGenerator result = - findApiClassDiffGenerator(pkgName, typeName); + ApiClassDiffGenerator result = findApiClassDiffGenerator(pkgName, + typeName); if (result != null) { return result; } @@ -135,8 +131,8 @@ String typeName) { ApiPackageDiffGenerator pkg = findApiPackageDiffGenerator(pkgName); if (pkg != null) { - ApiClassDiffGenerator type = - pkg.findApiClassDiffGenerator(pkgName + "." + typeName); + ApiClassDiffGenerator type = pkg.findApiClassDiffGenerator(pkgName + "." + + typeName); if (type != null) { return type; } @@ -171,12 +167,12 @@ private void computeApiDiff() throws NotFoundException { Set<String> newApiPackageNames = newApi.getApiPackageNames(); missingPackageNames = oldApi.getApiPackageNames(); - Set<String> intersection = - removeIntersection(newApiPackageNames, missingPackageNames); + Set<String> intersection = removeIntersection(newApiPackageNames, + missingPackageNames); // Inspect each of the classes in each of the packages in the intersection for (String packageName : intersection) { - ApiPackageDiffGenerator tempPackageDiffGenerator = - new ApiPackageDiffGenerator(packageName, this); + ApiPackageDiffGenerator tempPackageDiffGenerator = new ApiPackageDiffGenerator( + packageName, this); intersectingPackages.put(packageName, tempPackageDiffGenerator); tempPackageDiffGenerator.computeApiDiff(); }
diff --git a/tools/api-checker/src/com/google/gwt/tools/apichecker/ApiMethod.java b/tools/api-checker/src/com/google/gwt/tools/apichecker/ApiMethod.java index c3df50e..f49d232 100644 --- a/tools/api-checker/src/com/google/gwt/tools/apichecker/ApiMethod.java +++ b/tools/api-checker/src/com/google/gwt/tools/apichecker/ApiMethod.java
@@ -48,8 +48,8 @@ if (firstType.getSimpleSourceName().indexOf("void") != -1) { return null; } - boolean compatible = - ApiDiffGenerator.isFirstTypeAssignableToSecond(secondType, firstType); + boolean compatible = ApiDiffGenerator.isFirstTypeAssignableToSecond( + secondType, firstType); if (compatible) { return null; }
diff --git a/tools/api-checker/src/com/google/gwt/tools/apichecker/ApiPackage.java b/tools/api-checker/src/com/google/gwt/tools/apichecker/ApiPackage.java index f1af3ac..58ea221 100644 --- a/tools/api-checker/src/com/google/gwt/tools/apichecker/ApiPackage.java +++ b/tools/api-checker/src/com/google/gwt/tools/apichecker/ApiPackage.java
@@ -62,8 +62,8 @@ } List<JClassType> getAllClasses() { - List<JClassType> allClasses = - new ArrayList<JClassType>(Arrays.asList(packageObject.getTypes())); + List<JClassType> allClasses = new ArrayList<JClassType>( + Arrays.asList(packageObject.getTypes())); logger.log(TreeLogger.SPAM, "API " + packageObject + " has " + allClasses.size() + " outer classes", null); int index = 0; @@ -80,8 +80,8 @@ String getApiAsString() { StringBuffer sb = new StringBuffer(); sb.append(name + "\n"); - ArrayList<ApiClass> apiClassesList = - new ArrayList<ApiClass>(apiClasses.values()); + ArrayList<ApiClass> apiClassesList = new ArrayList<ApiClass>( + apiClasses.values()); Collections.sort(apiClassesList); for (ApiClass apiClass : apiClassesList) { sb.append(apiClass.getApiAsString());
diff --git a/tools/api-checker/src/com/google/gwt/tools/apichecker/ApiPackageDiffGenerator.java b/tools/api-checker/src/com/google/gwt/tools/apichecker/ApiPackageDiffGenerator.java index c2353cf..c48e06e 100644 --- a/tools/api-checker/src/com/google/gwt/tools/apichecker/ApiPackageDiffGenerator.java +++ b/tools/api-checker/src/com/google/gwt/tools/apichecker/ApiPackageDiffGenerator.java
@@ -32,8 +32,7 @@ final class ApiPackageDiffGenerator implements Comparable<ApiPackageDiffGenerator> { private final ApiDiffGenerator apiDiffGenerator; - private Map<String, ApiClassDiffGenerator> intersectingClasses = - new HashMap<String, ApiClassDiffGenerator>(); + private Map<String, ApiClassDiffGenerator> intersectingClasses = new HashMap<String, ApiClassDiffGenerator>(); private Set<String> missingClassNames = null; private final String name; private final ApiPackage newPackage; @@ -43,10 +42,10 @@ throws NotFoundException { this.apiDiffGenerator = apiDiffGenerator; name = packageName; - newPackage = - apiDiffGenerator.getNewApiContainer().getApiPackage(packageName); - oldPackage = - apiDiffGenerator.getOldApiContainer().getApiPackage(packageName); + newPackage = apiDiffGenerator.getNewApiContainer().getApiPackage( + packageName); + oldPackage = apiDiffGenerator.getOldApiContainer().getApiPackage( + packageName); if (newPackage == null || oldPackage == null) { throw new NotFoundException("for package " + packageName + ", one of the package objects is null"); @@ -66,13 +65,13 @@ void computeApiDiff() throws NotFoundException { Set<String> newClassNames = newPackage.getApiClassNames(); missingClassNames = oldPackage.getApiClassNames(); - Set<String> intersection = - ApiDiffGenerator.removeIntersection(newClassNames, missingClassNames); + Set<String> intersection = ApiDiffGenerator.removeIntersection( + newClassNames, missingClassNames); /* Inspect each of the classes in each of the packages in the intersection */ for (String className : intersection) { - ApiClassDiffGenerator tempClassDiffGenerator = - new ApiClassDiffGenerator(className, this); + ApiClassDiffGenerator tempClassDiffGenerator = new ApiClassDiffGenerator( + className, this); intersectingClasses.put(className, tempClassDiffGenerator); tempClassDiffGenerator.computeApiDiff(); } @@ -84,13 +83,12 @@ Collection<ApiChange> getApiDiff() { Collection<ApiChange> collection = new ArrayList<ApiChange>(); - Collection<ApiClass> missingClasses = - oldPackage.getApiClassesBySet(missingClassNames); + Collection<ApiClass> missingClasses = oldPackage.getApiClassesBySet(missingClassNames); for (ApiClass missingClass : missingClasses) { collection.add(new ApiChange(missingClass, ApiChange.Status.MISSING)); } - List<ApiClassDiffGenerator> intersectingClassesList = - new ArrayList<ApiClassDiffGenerator>(intersectingClasses.values()); + List<ApiClassDiffGenerator> intersectingClassesList = new ArrayList<ApiClassDiffGenerator>( + intersectingClasses.values()); Collections.sort(intersectingClassesList); for (ApiClassDiffGenerator intersectingClass : intersectingClasses.values()) { collection.addAll(intersectingClass.getApiDiff());