diff options
author | Michael Ernst <mernst@cs.washington.edu> | 2017-05-06 12:02:17 -0700 |
---|---|---|
committer | Michael Ernst <mernst@cs.washington.edu> | 2017-05-06 12:02:17 -0700 |
commit | 52e8495fa4d3730f1ae8e4d97c01dbc24a7ea4a2 (patch) | |
tree | eba160ed9d09daa861f4143b3610f0f607f0884e | |
parent | 77c5c01e3abf96e65edacbe71520e8b56eae423f (diff) | |
download | annotation-tools-52e8495fa4d3730f1ae8e4d97c01dbc24a7ea4a2.tar.gz |
Whitespace fixes
26 files changed, 123 insertions, 121 deletions
diff --git a/annotation-file-utilities/src/annotator/Main.java b/annotation-file-utilities/src/annotator/Main.java index e0c4c4c..ae49953 100644 --- a/annotation-file-utilities/src/annotator/Main.java +++ b/annotation-file-utilities/src/annotator/Main.java @@ -233,7 +233,7 @@ public class Main { ASTPath p = entry.getKey(); ATypeElement e = entry.getValue(); insertAnnotations.put(p, e); - //visitTypeElement(e, insertAnnotations.vivify(p)); + // visitTypeElement(e, insertAnnotations.vivify(p)); } for (Map.Entry<ASTPath, ATypeElementWithType> entry : el0.insertTypecasts.entrySet()) { @@ -243,10 +243,10 @@ public class Main { if (type instanceof type.DeclaredType && ((type.DeclaredType) type).getName().isEmpty()) { insertAnnotations.put(p, e); - //visitTypeElement(e, insertAnnotations.vivify(p)); + // visitTypeElement(e, insertAnnotations.vivify(p)); } else { insertTypecasts.put(p, e); - //visitTypeElementWithType(e, insertTypecasts.vivify(p)); + // visitTypeElementWithType(e, insertTypecasts.vivify(p)); } } return null; @@ -461,7 +461,7 @@ public class Main { if (ins instanceof TypedInsertion) { TypedInsertion ti = (TypedInsertion) ins; if (!rec.astPath.isEmpty()) { - //addInnerTypePaths(decl, rec, ti, insertionSources); + // addInnerTypePaths(decl, rec, ti, insertionSources); } for (Insertion inner : ti.getInnerTypeInsertions()) { Tree t = ASTIndex.getNode(tree, rec); @@ -705,7 +705,7 @@ public class Main { AScene scene = scenes.get(arg); Multimap<Insertion, Annotation> insertionSources = insertionIndex.get(arg); - //String text = + // String text = // ins.getText(comments, abbreviate, false, 0, '\0'); // TODO: adjust for missing end of path (?) diff --git a/annotation-file-utilities/src/annotator/Source.java b/annotation-file-utilities/src/annotator/Source.java index 828be8c..742f674 100644 --- a/annotation-file-utilities/src/annotator/Source.java +++ b/annotation-file-utilities/src/annotator/Source.java @@ -69,7 +69,7 @@ public final class Source { // "target value 1.8 is obsolete and will be removed in a future release" final String[] stringOpts = new String[] { "-g", "-Xlint:-options" }; // "-XDTA:noannotationsincomments" - //TODO: figure out if these options are necessary? "-source", "1.6x" + // TODO: figure out if these options are necessary? "-source", "1.6x" List<String> optsList = Arrays.asList(stringOpts); // Create a task. diff --git a/annotation-file-utilities/src/annotator/find/ASTPathCriterion.java b/annotation-file-utilities/src/annotator/find/ASTPathCriterion.java index 793f9fa..d30844f 100644 --- a/annotation-file-utilities/src/annotator/find/ASTPathCriterion.java +++ b/annotation-file-utilities/src/annotator/find/ASTPathCriterion.java @@ -141,9 +141,9 @@ public class ASTPathCriterion implements Criterion { int astPathLen = astPath.size(); int actualPathLen = actualPath.size(); if (astPathLen == 0 || actualPathLen == 0) { return false; } - //if (actualPathLen != astPathLen + (isOnNewArrayType ? 0 : 1)) { + // if (actualPathLen != astPathLen + (isOnNewArrayType ? 0 : 1)) { // return false; - //} + // } Tree next = null; int i = 0; @@ -180,7 +180,7 @@ public class ASTPathCriterion implements Criterion { System.out.println("next: " + next); } - //if (++i >= astPathLen || i >= actualPathLen) { break; } + // if (++i >= astPathLen || i >= actualPathLen) { break; } if (++i >= astPathLen) { break; } if (i >= actualPathLen) { return checkNull(actualPath, i-1); @@ -226,8 +226,8 @@ public class ASTPathCriterion implements Criterion { public Boolean visitIdentifier(IdentifierTree v, Tree t) { return v == t; - //IdentifierTree i2 = (IdentifierTree) t; - //return i1.getName().toString() + // IdentifierTree i2 = (IdentifierTree) t; + // return i1.getName().toString() // .equals(i2.getName().toString()); } @@ -239,12 +239,12 @@ public class ASTPathCriterion implements Criterion { a2.getUnderlyingType()); } - //@Override - //public Boolean - //visitArrayType(ArrayTypeTree b1, Tree t) { + // @Override + // public Boolean + // visitArrayType(ArrayTypeTree b1, Tree t) { // ArrayTypeTree b2 = (ArrayTypeTree) t; // return matchNext(b1.getType(), b2.getType()); - //} + // } @Override public Boolean @@ -260,10 +260,10 @@ public class ASTPathCriterion implements Criterion { public Boolean visitWildcard(WildcardTree d1, Tree t) { return d1 == (WildcardTree) t; - //WildcardTree d2 = (WildcardTree) t; - //Tree bound2 = d2.getBound(); - //Tree bound1 = d1.getBound(); - //return bound1 == bound2 || matchNext(bound1, bound2); + // WildcardTree d2 = (WildcardTree) t; + // Tree bound2 = d2.getBound(); + // Tree bound1 = d1.getBound(); + // return bound1 == bound2 || matchNext(bound1, bound2); } @Override @@ -539,10 +539,10 @@ public class ASTPathCriterion implements Criterion { int arg = astNode.getArgument(); if (arg == 0 && astPath.size() == ix+1) { return newArray; - //if (astPath.size() != ix+1) { return null; } - //return typeTree; - //return ((ArrayTypeTree) typeTree).getType(); - //return newArray; + // if (astPath.size() != ix+1) { return null; } + // return typeTree; + // return ((ArrayTypeTree) typeTree).getType(); + // return newArray; } typeTree = ((NewArrayTree) typeTree).getType(); while (--arg > 0) { @@ -737,8 +737,8 @@ public class ASTPathCriterion implements Criterion { Tree.Kind kind = entry.getTreeKind(); switch (kind) { - //case ANNOTATION: - //case INTERFACE: + // case ANNOTATION: + // case INTERFACE: case CLASS: // "extends" clause? return ASTPath.isClassEquiv(kind) && ix == last && entry.getArgument() == -1 @@ -767,8 +767,8 @@ public class ASTPathCriterion implements Criterion { if (ix == last) { return true; } VariableTree rcvrParam = method.getReceiverParameter(); if (rcvrParam == null) { // TODO - //ClassTree clazz = methodReceiverType(path); - //return checkReceiverType(ix, + // ClassTree clazz = methodReceiverType(path); + // return checkReceiverType(ix, // ((JCTree.JCClassDecl) clazz).type); } else { return checkTypePath(ix+1, rcvrParam.getType()); @@ -781,12 +781,12 @@ public class ASTPathCriterion implements Criterion { int arg = entry.getArgument(); if (entry.childSelectorIs(ASTPath.TYPE)) { if (ix == last) { return true; } - //Tree t = newArray.getType(); - //int depth = 1; - //while (t.getKind() == Tree.Kind.ARRAY_TYPE) { + // Tree t = newArray.getType(); + // int depth = 1; + // while (t.getKind() == Tree.Kind.ARRAY_TYPE) { // t = ((ArrayTypeTree) t).getType(); // ++depth; - //} + // } return arg == arrayDepth(newArray); } else { List<? extends ExpressionTree> typeTrees = diff --git a/annotation-file-utilities/src/annotator/find/ConstructorInsertion.java b/annotation-file-utilities/src/annotator/find/ConstructorInsertion.java index 85a8764..e43c61e 100644 --- a/annotation-file-utilities/src/annotator/find/ConstructorInsertion.java +++ b/annotation-file-utilities/src/annotator/find/ConstructorInsertion.java @@ -32,13 +32,13 @@ public class ConstructorInsertion extends TypedInsertion { protected String getText(boolean comments, boolean abbreviate) { StringBuilder b = new StringBuilder(); if (annotationsOnly) { - //List<String> annotations = type.getAnnotations(); - //if (annotations.isEmpty()) { return ""; } - //for (String a : annotations) { + // List<String> annotations = type.getAnnotations(); + // if (annotations.isEmpty()) { return ""; } + // for (String a : annotations) { // b.append(a); // b.append(' '); - //} - //return new AnnotationInsertion(b.toString(), getCriteria(), + // } + // return new AnnotationInsertion(b.toString(), getCriteria(), // getSeparateLine()).getText(comments, abbreviate); return ""; } else { diff --git a/annotation-file-utilities/src/annotator/find/GenericArrayLocationCriterion.java b/annotation-file-utilities/src/annotator/find/GenericArrayLocationCriterion.java index 79920a7..4595df2 100644 --- a/annotation-file-utilities/src/annotator/find/GenericArrayLocationCriterion.java +++ b/annotation-file-utilities/src/annotator/find/GenericArrayLocationCriterion.java @@ -255,7 +255,7 @@ public class GenericArrayLocationCriterion implements Criterion { locationRemaining.remove(locationRemaining.size()-1); leaf = fieldAccess.selected; pathRemaining = parentPath; - //TreePath.getPath(pathRemaining.getCompilationUnit(), leaf); + // TreePath.getPath(pathRemaining.getCompilationUnit(), leaf); } else if (loc.tag == TypePathEntryKind.WILDCARD && leaf.getKind() == Tree.Kind.UNBOUNDED_WILDCARD) { // Check if the leaf is an unbounded wildcard instead of the parent, since unbounded @@ -299,8 +299,8 @@ public class GenericArrayLocationCriterion implements Criterion { locationRemaining.remove(i--); while (inner.getKind() == Tree.Kind.MEMBER_SELECT && !isStatic((JCFieldAccess) inner)) { - //fieldAccess.type != null && fieldAccess.type.getKind() == TypeKind.DECLARED - //&& fieldAccess.type.tsym.isStatic() + // fieldAccess.type != null && fieldAccess.type.getKind() == TypeKind.DECLARED + // && fieldAccess.type.tsym.isStatic() // TODO: check whether MEMBER_SELECT indicates inner or qualifier? if (i < 0) { break; } if (locationRemaining.get(i).tag != TypePathEntryKind.INNER_TYPE) { diff --git a/annotation-file-utilities/src/annotator/find/InClassCriterion.java b/annotation-file-utilities/src/annotator/find/InClassCriterion.java index 18d3c79..ee418bf 100644 --- a/annotation-file-utilities/src/annotator/find/InClassCriterion.java +++ b/annotation-file-utilities/src/annotator/find/InClassCriterion.java @@ -67,7 +67,7 @@ public final class InClassCriterion implements Criterion { static Pattern anonclassPattern; static Pattern localClassPattern; static { - //for JDK 7: anonclassPattern = Pattern.compile("^(?<num>[0-9]+)(\\$(?<remaining>.*))?$"); + // for JDK 7: anonclassPattern = Pattern.compile("^(?<num>[0-9]+)(\\$(?<remaining>.*))?$"); anonclassPattern = Pattern.compile("^([0-9]+)(\\$(.*))?$"); localClassPattern = Pattern.compile("^([0-9]+)([^$]+)(\\$(.*))?$"); } @@ -193,8 +193,8 @@ public final class InClassCriterion implements Criterion { debug("false[anonclassMatcher] InClassCriterion.isSatisfiedBy:%n cname=%s%n tree=%s%n", cname, tree); return false; } - //for JDK 7: String anonclassNumString = anonclassMatcher.group("num"); - //for JDK 7: cname = anonclassMatcher.group("remaining"); + // for JDK 7: String anonclassNumString = anonclassMatcher.group("num"); + // for JDK 7: cname = anonclassMatcher.group("remaining"); String anonclassNumString = anonclassMatcher.group(1); cname = anonclassMatcher.group(3); if (cname == null) { diff --git a/annotation-file-utilities/src/annotator/find/Insertion.java b/annotation-file-utilities/src/annotator/find/Insertion.java index 12ba329..68a1b2f 100644 --- a/annotation-file-utilities/src/annotator/find/Insertion.java +++ b/annotation-file-utilities/src/annotator/find/Insertion.java @@ -483,7 +483,7 @@ public abstract class Insertion { private static void decorateType(ASTPath astPath, String annos, Type type, ASTPath outerPath) { - //type.addAnnotation(annos); // TODO + // type.addAnnotation(annos); // TODO Iterator<ASTPath.ASTEntry> ii = astPath.iterator(); Iterator<ASTPath.ASTEntry> oi = outerPath.iterator(); diff --git a/annotation-file-utilities/src/annotator/find/Insertions.java b/annotation-file-utilities/src/annotator/find/Insertions.java index 2dec089..0f70e2a 100644 --- a/annotation-file-utilities/src/annotator/find/Insertions.java +++ b/annotation-file-utilities/src/annotator/find/Insertions.java @@ -82,8 +82,8 @@ public class Insertions implements Iterable<Insertion> { return 2; case CAST: return 1; - //case ANNOTATION: - //case CLOSE_PARENTHESIS: + // case ANNOTATION: + // case CLOSE_PARENTHESIS: default: return 0; } @@ -105,7 +105,7 @@ public class Insertions implements Iterable<Insertion> { p2 == null ? ASTPath.empty() : p2); int c = r1.compareTo(r2); if (c == 0) { - //c = o1.getKind().compareTo(o2.getKind()); + // c = o1.getKind().compareTo(o2.getKind()); c = Integer.compare(kindLevel(o2), kindLevel(o1)); // descending if (c == 0) { c = o1.toString().compareTo(o2.toString()); } } @@ -363,11 +363,11 @@ public class Insertions implements Iterable<Insertion> { rec = rec.replacePath(p.getParentPath()); Collections.fill(loc0, TypePathEntry.ARRAY); - //irec = rec; - //if (node.getKind() == Tree.Kind.NEW_ARRAY) { + // irec = rec; + // if (node.getKind() == Tree.Kind.NEW_ARRAY) { rec0 = rec.extend(Tree.Kind.NEW_ARRAY, ASTPath.TYPE, 0); - //} + // } } } @@ -449,10 +449,10 @@ public class Insertions implements Iterable<Insertion> { } } } - //if (map.isEmpty()) { + // if (map.isEmpty()) { // organized.addAll(unorganized); // return organized; - //} + // } Collections.sort(list, byASTRecord); unorganized.addAll(list); @@ -787,9 +787,9 @@ public class Insertions implements Iterable<Insertion> { organized.add(ins); if (tpes.isEmpty()) { - //assert ap1.equals(ap0) && !map.containsKey(ap0); + // assert ap1.equals(ap0) && !map.containsKey(ap0); // organized.add(ins); - //map.put(rec, (TypedInsertion) ins); + // map.put(rec, (TypedInsertion) ins); } else { criteria.add(new ASTPathCriterion(ap0)); criteria.add(new GenericArrayLocationCriterion( @@ -1411,13 +1411,13 @@ loop: case INT: type = new DeclaredType(jtype.tsym.name.toString()); break; - //case ERROR: - //case EXECUTABLE: - //case NONE: - //case NULL: - //case OTHER: - //case PACKAGE: - //case VOID: + // case ERROR: + // case EXECUTABLE: + // case NONE: + // case NULL: + // case OTHER: + // case PACKAGE: + // case VOID: default: break; } @@ -1557,8 +1557,8 @@ loop: case INT: return "int"; case LONG: return "long"; case SHORT: return "short"; - //case VOID: return "void"; - //case WILDCARD: return "?"; + // case VOID: return "void"; + // case WILDCARD: return "?"; default: throw new IllegalArgumentException("unexpected type kind " + typeKind); diff --git a/annotation-file-utilities/src/annotator/find/IsCriterion.java b/annotation-file-utilities/src/annotator/find/IsCriterion.java index 838ebe3..bcd48cb 100644 --- a/annotation-file-utilities/src/annotator/find/IsCriterion.java +++ b/annotation-file-utilities/src/annotator/find/IsCriterion.java @@ -54,7 +54,7 @@ final class IsCriterion implements Criterion { case METHOD: String methodName = ((MethodTree)tree).getName().toString(); return methodName.equals(name); - //case CLASS: + // case CLASS: // return InClassCriterion.isSatisfiedBy(path, name, /*exactMatch=*/ true); default: throw new Error("unknown tree kind " + kind); diff --git a/annotation-file-utilities/src/annotator/find/IsSigMethodCriterion.java b/annotation-file-utilities/src/annotator/find/IsSigMethodCriterion.java index c22b27b..62bf373 100644 --- a/annotation-file-utilities/src/annotator/find/IsSigMethodCriterion.java +++ b/annotation-file-utilities/src/annotator/find/IsSigMethodCriterion.java @@ -230,7 +230,7 @@ public class IsSigMethodCriterion implements Criterion { if (someImport.contains("*")) { // don't include the * in the prefix, should end in . // TODO: this is a real bug due to nonnull, though I discovered it manually - //importPrefix = someImport.substring(0, importPrefix.indexOf("*")); + // importPrefix = someImport.substring(0, importPrefix.indexOf("*")); importPrefix = someImport.substring(0, someImport.indexOf("*")); } else { // if you imported a specific class, you can only use that import @@ -314,12 +314,12 @@ public class IsSigMethodCriterion implements Criterion { Main.pathToString(path)); return false; } - //else if ((((JCMethodDecl) leaf).mods.flags & Flags.GENERATEDCONSTR) != 0) { + // else if ((((JCMethodDecl) leaf).mods.flags & Flags.GENERATEDCONSTR) != 0) { // Criteria.dbug.debug( // "IsSigMethodCriterion.isSatisfiedBy(%s) => false: generated constructor%n", // Main.pathToString(path)); // return false; - //} + // } MethodTree mt = (MethodTree) leaf; diff --git a/annotation-file-utilities/src/annotator/find/LambdaCriterion.java b/annotation-file-utilities/src/annotator/find/LambdaCriterion.java index 69d5ff5..a81ab70 100644 --- a/annotation-file-utilities/src/annotator/find/LambdaCriterion.java +++ b/annotation-file-utilities/src/annotator/find/LambdaCriterion.java @@ -52,7 +52,7 @@ public class LambdaCriterion implements Criterion { } if (parent.getKind() == Tree.Kind.LAMBDA_EXPRESSION) { - //LambdaExpressionTree lambdaTree = (LambdaExpressionTree) parent; + // LambdaExpressionTree lambdaTree = (LambdaExpressionTree) parent; int indexInSource = LambdaScanner.indexOfLambdaExpressionTree(path, parent); Criteria.dbug.debug("return source: %d%n", indexInSource); diff --git a/annotation-file-utilities/src/annotator/scanner/AnonymousClassScanner.java b/annotation-file-utilities/src/annotator/scanner/AnonymousClassScanner.java index 59bf9cf..13d5afd 100644 --- a/annotation-file-utilities/src/annotator/scanner/AnonymousClassScanner.java +++ b/annotation-file-utilities/src/annotator/scanner/AnonymousClassScanner.java @@ -86,7 +86,7 @@ public class AnonymousClassScanner extends TreePathScanner<Void, Integer> { @Override public Void visitNewClass(NewClassTree node, Integer level) { - //if (level < 2) { + // if (level < 2) { if (!found && anonclass.getKind() == Tree.Kind.NEW_CLASS) { if (anonclass == node) { found = true; @@ -99,7 +99,7 @@ public class AnonymousClassScanner extends TreePathScanner<Void, Integer> { } } super.visitNewClass(node, level + 1); - //} + // } return null; } } diff --git a/annotation-file-utilities/src/annotator/scanner/MethodOffsetClassVisitor.java b/annotation-file-utilities/src/annotator/scanner/MethodOffsetClassVisitor.java index 6a60cc3..7834ca6 100644 --- a/annotation-file-utilities/src/annotator/scanner/MethodOffsetClassVisitor.java +++ b/annotation-file-utilities/src/annotator/scanner/MethodOffsetClassVisitor.java @@ -96,7 +96,7 @@ public class MethodOffsetClassVisitor extends ClassWriter { super.visitTypeInsn(opcode, desc); switch (opcode) { case Opcodes.CHECKCAST: - //CastScanner.addCastToMethod(methodName, labelOffset() + 1); + // CastScanner.addCastToMethod(methodName, labelOffset() + 1); CastScanner.addCastToMethod(methodName, coa.getMethodCodeOffset()); break; diff --git a/annotation-file-utilities/src/annotator/specification/IndexFileSpecification.java b/annotation-file-utilities/src/annotator/specification/IndexFileSpecification.java index b64e255..79c1583 100644 --- a/annotation-file-utilities/src/annotator/specification/IndexFileSpecification.java +++ b/annotation-file-utilities/src/annotator/specification/IndexFileSpecification.java @@ -422,7 +422,7 @@ public class IndexFileSpecification implements Specification { if (!isCastInsertion) { // Annotations on compound types of a cast insertion will be // inserted directly on the cast insertion. - //this.insertions.add(ins); + // this.insertions.add(ins); elementInsertions.add(ins); } annotationInsertions.add(ins); @@ -634,7 +634,7 @@ public class IndexFileSpecification implements Specification { AField param = entry.getValue(); CriterionList paramClist = clist.add(Criteria.param(methodName, index)); // parse declaration annotations - //parseField(paramClist, index.toString(), param); + // parseField(paramClist, index.toString(), param); parseInnerAndOuterElements(paramClist, param.type); } diff --git a/scene-lib/src/annotations/el/DefCollector.java b/scene-lib/src/annotations/el/DefCollector.java index b05c51f..8769d2b 100644 --- a/scene-lib/src/annotations/el/DefCollector.java +++ b/scene-lib/src/annotations/el/DefCollector.java @@ -100,7 +100,7 @@ public abstract class DefCollector { // circular references (e.g. Documented and Retention). When it is // fixed, uncomment it // - //collect((AElement)d); + // collect((AElement)d); } private void collect(AElement e) diff --git a/scene-lib/src/annotations/field/ClassTokenAFT.java b/scene-lib/src/annotations/field/ClassTokenAFT.java index a70e1fa..0b6916f 100644 --- a/scene-lib/src/annotations/field/ClassTokenAFT.java +++ b/scene-lib/src/annotations/field/ClassTokenAFT.java @@ -29,9 +29,9 @@ public final class ClassTokenAFT extends ScalarAFT { */ public static final ClassTokenAFT ctaft = new ClassTokenAFT(); - //public ClassTokenAFT(/* String parameterization */) { + // public ClassTokenAFT(/* String parameterization */) { // /* this.parameterization = parameterization; */ - //} + // } /** * {@inheritDoc} diff --git a/scene-lib/src/annotations/io/ASTIndex.java b/scene-lib/src/annotations/io/ASTIndex.java index 13f10e3..049a350 100644 --- a/scene-lib/src/annotations/io/ASTIndex.java +++ b/scene-lib/src/annotations/io/ASTIndex.java @@ -382,8 +382,8 @@ public class ASTIndex extends WrapperMap<Tree, ASTRecord> { } save(node.getReturnType(), rec, kind, ASTPath.TYPE); saveAll(node.getTypeParameters(), rec, kind, ASTPath.TYPE_PARAMETER); - //save(node.getReceiverParameter(), rec, kind, ASTPath.PARAMETER, -1); - //saveAll(node.getParameters(), rec, kind, ASTPath.PARAMETER); + // save(node.getReceiverParameter(), rec, kind, ASTPath.PARAMETER, -1); + // saveAll(node.getParameters(), rec, kind, ASTPath.PARAMETER); saveAll(node.getThrows(), rec, kind, ASTPath.THROWS); save(node.getBody(), rec, kind, ASTPath.BODY); inMethod = outMethod; diff --git a/scene-lib/src/annotations/io/ASTPath.java b/scene-lib/src/annotations/io/ASTPath.java index 35677a9..17a13f0 100644 --- a/scene-lib/src/annotations/io/ASTPath.java +++ b/scene-lib/src/annotations/io/ASTPath.java @@ -1560,7 +1560,7 @@ implements Comparable<ASTPath>, Iterable<ASTPath.ASTEntry> { case ARRAY_TYPE: case IDENTIFIER: case INTERSECTION_TYPE: - //case MEMBER_SELECT: + // case MEMBER_SELECT: case PARAMETERIZED_TYPE: case PRIMITIVE_TYPE: case UNION_TYPE: diff --git a/scene-lib/src/annotations/io/IndexFileParser.java b/scene-lib/src/annotations/io/IndexFileParser.java index 330e202..d8c4de8 100644 --- a/scene-lib/src/annotations/io/IndexFileParser.java +++ b/scene-lib/src/annotations/io/IndexFileParser.java @@ -503,11 +503,11 @@ public final class IndexFileParser { String name = expectQualifiedName(); AnnotationDef d = defs.get(name); if (d == null) { - //System.err.println("No definition for annotation type " + name); - //System.err.printf(" defs contains %d entries%n", defs.size()); - //for (Map.Entry<String,AnnotationDef> entry : defs.entrySet()) { + // System.err.println("No definition for annotation type " + name); + // System.err.printf(" defs contains %d entries%n", defs.size()); + // for (Map.Entry<String,AnnotationDef> entry : defs.entrySet()) { // System.err.printf(" defs entry: %s => %s%n", entry.getKey(), entry.getValue()); - //} + // } throw new ParseException("No definition for annotation type " + name); } return d; @@ -902,7 +902,7 @@ public final class IndexFileParser { } } - //parseBlock(m.body, true); + // parseBlock(m.body, true); parseASTInsertions(m); } @@ -1108,9 +1108,9 @@ public final class IndexFileParser { } AMethod m = exp.funs.vivify(loc); expectChar(':'); - //parseAnnotations(m); + // parseAnnotations(m); parseLambda(m); - //parseMethod(m); + // parseMethod(m); } } return evermatched; @@ -1148,10 +1148,10 @@ public final class IndexFileParser { i.setType(new DeclaredType()); parseInnerTypes(i); } else { - //astPath = fixNewArrayType(astPath); // handle special case - //ATypeElement i = decl.insertAnnotations.vivify(astPath); - //parseAnnotations(i); - //parseInnerTypes(i); + // astPath = fixNewArrayType(astPath); // handle special case + // ATypeElement i = decl.insertAnnotations.vivify(astPath); + // parseAnnotations(i); + // parseInnerTypes(i); int offset = 0; Pair<ASTPath, InnerTypeLocation> pair = splitNewArrayType(astPath); // handle special case @@ -1515,7 +1515,7 @@ public final class IndexFileParser { matchChar(':'); } else { pkg = expectQualifiedName(); - //AElement p = scene.packages.vivify(pkg); + // AElement p = scene.packages.vivify(pkg); AClass p = scene.classes.vivify(pkg + ".package-info"); expectChar(':'); p = scene.classes.vivify(pkg + ".package-info"); diff --git a/scene-lib/src/annotations/io/IndexFileWriter.java b/scene-lib/src/annotations/io/IndexFileWriter.java index 9cf46f4..0ca0912 100644 --- a/scene-lib/src/annotations/io/IndexFileWriter.java +++ b/scene-lib/src/annotations/io/IndexFileWriter.java @@ -393,9 +393,9 @@ public final class IndexFileWriter { if (!d.isWildcard()) { type.DeclaredType inner = d.getInnerType(); Iterator<type.Type> iter = d.getTypeParameters().iterator(); - //for (String s : d.getAnnotations()) { + // for (String s : d.getAnnotations()) { // pw.print(s + " "); - //} + // } if (iter.hasNext()) { pw.print("<"); printType(iter.next()); diff --git a/scene-lib/src/annotations/io/JavapParser.java b/scene-lib/src/annotations/io/JavapParser.java index 0f4c30c..a07ae0d 100644 --- a/scene-lib/src/annotations/io/JavapParser.java +++ b/scene-lib/src/annotations/io/JavapParser.java @@ -200,7 +200,9 @@ public final class JavapParser { TargetType tt = TargetType.valueOf(targetTypeName); if (tt != null) { targetType = tt; - } else throw new RuntimeException("null target type"); + } else { + throw new RuntimeException("null target type"); + } nextLine(); ATypeElement subOuterType; AElement subElement; @@ -259,7 +261,7 @@ public final class JavapParser { List<Integer> location = parseInnerTypeLocationNums(); InnerTypeLocation itl = new InnerTypeLocation(TypeAnnotationPosition.getTypePathFromBinary(location)); subElement = subOuterType.innerTypes.vivify(itl); - //} else + // } else // subElement = subOuterType; return subElement; default: diff --git a/scene-lib/src/annotations/io/classfile/ClassAnnotationSceneReader.java b/scene-lib/src/annotations/io/classfile/ClassAnnotationSceneReader.java index a426105..d1de0cc 100644 --- a/scene-lib/src/annotations/io/classfile/ClassAnnotationSceneReader.java +++ b/scene-lib/src/annotations/io/classfile/ClassAnnotationSceneReader.java @@ -730,7 +730,7 @@ extends EmptyVisitor { if (xLocationsArgs.isEmpty()) { // TODO: resolve issue once classfile format is finalized if (aElement instanceof AClass) { - //handleFieldOnClass((AClass) aElement); + // handleFieldOnClass((AClass) aElement); if (strict) { System.err.println("Unhandled FIELD annotation for " + aElement); } } else if (aElement instanceof ATypeElement) { aElement.tlAnnotationsHere.add(makeAnnotation()); @@ -740,7 +740,7 @@ extends EmptyVisitor { } else { // TODO: resolve issue once classfile format is finalized if (aElement instanceof AClass) { - //handleFieldGenericArrayOnClass((AClass) aElement); + // handleFieldGenericArrayOnClass((AClass) aElement); if (strict) { System.err.println("Unhandled FIELD_COMPONENT annotation for " + aElement); } } else if (aElement instanceof ATypeElement) { ATypeElement aTypeElement = (ATypeElement) aElement; @@ -909,8 +909,8 @@ extends EmptyVisitor { private void handleNewTypeArgument(AMethod aMethod) { if (xLocationsArgs.isEmpty()) { - //aMethod.news.vivify(makeOffset()).innerTypes.vivify(); - //makeInnerTypeLocation()).tlAnnotationsHere.add(makeAnnotation()); + // aMethod.news.vivify(makeOffset()).innerTypes.vivify(); + // makeInnerTypeLocation()).tlAnnotationsHere.add(makeAnnotation()); if (strict) { System.err.println("Unhandled handleNewTypeArgument on aMethod: " + aMethod); } } else { // if (strict) { System.err.println("Unhandled handleNewTypeArgumentGenericArray on aMethod: " + aMethod); } @@ -951,7 +951,7 @@ extends EmptyVisitor { } private void handleMethodTypeParameter(AMethod aMethod) { - //TODO: throw new RuntimeException("METHOD_TYPE_PARAMETER: to do"); + // TODO: throw new RuntimeException("METHOD_TYPE_PARAMETER: to do"); } /* @@ -1065,7 +1065,7 @@ extends EmptyVisitor { } else { Class<?> vc = value.getClass(); aft = BasicAFT.forType(vc); - //or: aft = (ScalarAFT) AnnotationFieldType.fromClass(vc, null); + // or: aft = (ScalarAFT) AnnotationFieldType.fromClass(vc, null); } assert aft != null; prepareForElement(aft); diff --git a/scene-lib/src/annotations/io/classfile/ClassAnnotationSceneWriter.java b/scene-lib/src/annotations/io/classfile/ClassAnnotationSceneWriter.java index 057c83b..fe87095 100644 --- a/scene-lib/src/annotations/io/classfile/ClassAnnotationSceneWriter.java +++ b/scene-lib/src/annotations/io/classfile/ClassAnnotationSceneWriter.java @@ -1,6 +1,6 @@ -//This class is a complete ClassVisitor with many hidden classes that do -//the work of parsing an AScene and inserting them into a class file, as -//the original class file is being read. +// This class is a complete ClassVisitor with many hidden classes that do +// the work of parsing an AScene and inserting them into a class file, as +// the original class file is being read. package annotations.io.classfile; @@ -1009,7 +1009,7 @@ public class ClassAnnotationSceneWriter extends ClassAdapter { private void ensureVisitReceiverAnnotations() { AField aReceiver = aMethod.receiver; - //for (Annotation tla : aReceiver.tlAnnotationsHere) { + // for (Annotation tla : aReceiver.tlAnnotationsHere) { // if (shouldSkip(tla)) continue; // // AnnotationVisitor av = visitTypeAnnotation(tla, false); // FIXME @@ -1017,7 +1017,7 @@ public class ClassAnnotationSceneWriter extends ClassAdapter { // visitLocations(av, InnerTypeLocation.EMPTY_INNER_TYPE_LOCATION); // visitFields(av, tla); // av.visitEnd(); - //} + // } for (Annotation tla : aReceiver.type.tlAnnotationsHere) { if (shouldSkip(tla)) { @@ -1165,8 +1165,8 @@ public class ClassAnnotationSceneWriter extends ClassAdapter { if (strict) { System.err.println("ClassAnnotationSceneWriter.ensureMemberReferenceAnnotations: no bytecode offset found!"); } continue; } - //int offset = entry.getKey().offset; - //int typeIndex = entry.getKey().type_index; + // int offset = entry.getKey().offset; + // int typeIndex = entry.getKey().type_index; AMethod aLambda = entry.getValue(); for (Map.Entry<Integer, AField> e0 : aLambda.parameters.entrySet()) { @@ -1190,8 +1190,8 @@ public class ClassAnnotationSceneWriter extends ClassAdapter { TypeAnnotationVisitor xav = visitTypeAnnotation(tla, false); visitTargetType(xav, TargetType.METHOD_FORMAL_PARAMETER); - //visitOffset(xav, offset); - //visitTypeIndex(xav, typeIndex); + // visitOffset(xav, offset); + // visitTypeIndex(xav, typeIndex); visitParameterIndex(xav, index); visitLocations(xav, InnerTypeLocation.EMPTY_INNER_TYPE_LOCATION); visitFields(xav, tla); @@ -1209,8 +1209,8 @@ public class ClassAnnotationSceneWriter extends ClassAdapter { TypeAnnotationVisitor xav = visitTypeAnnotation(tla, false); visitTargetType(xav, TargetType.METHOD_FORMAL_PARAMETER); - //visitOffset(xav, offset); - //visitTypeIndex(xav, typeIndex); + // visitOffset(xav, offset); + // visitTypeIndex(xav, typeIndex); visitParameterIndex(xav, index); visitLocations(xav, aParameterLocation); visitFields(xav, tla); diff --git a/scene-lib/src/annotations/io/classfile/SafeTypeAnnotationVisitor.java b/scene-lib/src/annotations/io/classfile/SafeTypeAnnotationVisitor.java index 959747e..6ef910b 100644 --- a/scene-lib/src/annotations/io/classfile/SafeTypeAnnotationVisitor.java +++ b/scene-lib/src/annotations/io/classfile/SafeTypeAnnotationVisitor.java @@ -1,5 +1,5 @@ -//This is a wrapper class around an TypeAnnotationVisitor that can be used -//to verify the information it visits specifies a valid [extended] annotation. +// This is a wrapper class around an TypeAnnotationVisitor that can be used +// to verify the information it visits specifies a valid [extended] annotation. package annotations.io.classfile; diff --git a/scene-lib/src/annotations/tools/IndexFileMerger.java b/scene-lib/src/annotations/tools/IndexFileMerger.java index c9f7574..1fea1e4 100644 --- a/scene-lib/src/annotations/tools/IndexFileMerger.java +++ b/scene-lib/src/annotations/tools/IndexFileMerger.java @@ -125,12 +125,12 @@ public class IndexFileMerger { */ for (Map.Entry<String, AClass> entry : scene.classes.entrySet()) { - //final String classname = entry.getKey(); + // final String classname = entry.getKey(); entry.getValue().accept(new ElementVisitor<Void, Void>() { - //Map<String, String> annoPkgs = new HashMap<String, String>(); + // Map<String, String> annoPkgs = new HashMap<String, String>(); - //Void process(AElement el) { + // Void process(AElement el) { // for (Annotation anno : el.tlAnnotationsHere) { // AnnotationDef def = anno.def(); // String[] a = def.name.split("\\."); @@ -146,7 +146,7 @@ public class IndexFileMerger { // } // } // return null; - //} + // } Void visit(AElement el) { if (el != null) { el.accept(this, null); } @@ -162,11 +162,11 @@ public class IndexFileMerger { @Override public Void visitAnnotationDef(AnnotationDef d, Void v) { - //String[] a = d.name.split("\\."); - //if (a.length > 2 && a[a.length-2].matches("quals?")) { + // String[] a = d.name.split("\\."); + // if (a.length > 2 && a[a.length-2].matches("quals?")) { // String s = a[a.length-1]; // annoPkgs.put(s, d.name.substring(0)); - //} + // } return null; // process(d); } diff --git a/scene-lib/test/annotations/tests/classfile/AnnotationVerifier.java b/scene-lib/test/annotations/tests/classfile/AnnotationVerifier.java index d75ebfb..543c05c 100644 --- a/scene-lib/test/annotations/tests/classfile/AnnotationVerifier.java +++ b/scene-lib/test/annotations/tests/classfile/AnnotationVerifier.java @@ -118,7 +118,7 @@ public class AnnotationVerifier { private Map<String, AnnotationRecorder> anns; private Map<String, AnnotationRecorder> xanns; - //method specific annotations + // method specific annotations private Set<AnnotationRecorder> danns; // default annotations private Map<ParameterDescription, AnnotationRecorder> panns; // parameter annotations |