@@ -35,7 +35,7 @@ interface Visitor<T> {
3535
3636
3737public class APISanitation {
38- private final static TreeSet <Class > classes = new TreeSet <>(new Comparator <Class >() {
38+ private final static TreeSet <Class > CLASSES = new TreeSet <>(new Comparator <Class >() {
3939 @ Override
4040 public int compare (Class o1 , Class o2 ) {
4141 return o1 .getName ().compareTo (o2 .getName ());
@@ -75,10 +75,10 @@ private static String createClassName(File root, File file) {
7575 StringBuffer sb = new StringBuffer ();
7676 String fileName = file .getName ();
7777 sb .append (fileName .substring (0 , fileName .lastIndexOf (".class" )));
78- file = file .getParentFile ();
79- while (file != null && !file .equals (root )) {
80- sb .insert (0 , '.' ).insert (0 , file .getName ());
81- file = file .getParentFile ();
78+ File file1 = file .getParentFile ();
79+ while (file1 != null && !file1 .equals (root )) {
80+ sb .insert (0 , '.' ).insert (0 , file1 .getName ());
81+ file1 = file1 .getParentFile ();
8282 }
8383 return sb .toString ();
8484 }
@@ -102,7 +102,7 @@ public boolean visit(String clazz) {
102102 if (!(className .toLowerCase ().startsWith ("test" )
103103 || className .toLowerCase ().endsWith ("test" ))) {
104104 try {
105- classes .add (Class .forName (clazz ));
105+ CLASSES .add (Class .forName (clazz ));
106106 } catch (ClassNotFoundException e ) {
107107 LOGGER .log (Level .SEVERE , "Class not found" , e );
108108 }
@@ -128,7 +128,7 @@ public int compare(Field o1, Field o2) {
128128 }
129129 });
130130
131- for (Class <?> clazz : classes ) {
131+ for (Class <?> clazz : CLASSES ) {
132132 // no enums
133133 if (!clazz .isEnum ()) {
134134 for (Field field : clazz .getDeclaredFields ()) {
@@ -165,10 +165,10 @@ void testFieldAccess(Field field) throws MethodNamingException {
165165 foundGetter |= ("get" + fieldName ).equalsIgnoreCase (methodName )
166166 | (isBooleanType && ("is" + fieldName ).equalsIgnoreCase (methodName ))
167167 | (isBooleanType && fieldName .startsWith ("is" )
168- && ( fieldName ) .equalsIgnoreCase (methodName ))
168+ && fieldName .equalsIgnoreCase (methodName ))
169169 | (isBooleanType && ("has" + fieldName ).equalsIgnoreCase (methodName ))
170170 | (isBooleanType && fieldName .startsWith ("has" )
171- && ( fieldName ) .equalsIgnoreCase (methodName ))
171+ && fieldName .equalsIgnoreCase (methodName ))
172172 | (isBooleanType && fieldName .startsWith ("use" )
173173 && ("isUsing" + fieldName .substring ("use" .length ()))
174174 .equalsIgnoreCase (methodName ));
@@ -275,8 +275,9 @@ boolean testGenericType(Field field, Class boundClass) {
275275 final TypeVariable <Class <List >> typeVariable =
276276 (TypeVariable <Class <List >>) actualTypeArgument ;
277277 for (Type type : typeVariable .getBounds ()) {
278- if (type .getTypeName ().equals (boundClass .getTypeName ()))
278+ if (type .getTypeName ().equals (boundClass .getTypeName ())) {
279279 return true ;
280+ }
280281 }
281282 }
282283 }
0 commit comments