package annotator.find;

import java.util.ArrayList;
import java.util.List;

import annotations.el.InnerTypeLocation;

import com.sun.source.tree.ArrayTypeTree;
import com.sun.source.tree.IdentifierTree;
import com.sun.source.tree.MethodTree;
import com.sun.source.tree.ParameterizedTypeTree;
import com.sun.source.tree.Tree;
import com.sun.source.tree.VariableTree;
import com.sun.source.util.TreePath;

public class ParamCriterion implements Criterion {

  private String methodName;
  private Criterion parentCriterion;
  private Integer paramPos;

  public ParamCriterion(String methodName, Integer pos) {
    this.methodName = methodName.substring(0, methodName.indexOf(")") + 1);
    this.paramPos = pos;
  }

  /** {@inheritDoc} */
  @Override
  public boolean isSatisfiedBy(TreePath path, Tree leaf) {
    assert path == null || path.getLeaf() == leaf;
    return isSatisfiedBy(path);
  }

  /** {@inheritDoc} */
  @Override
  public boolean isSatisfiedBy(TreePath path) {

    if (path == null) {
      return false;
    }

    // no inner type location, want to annotate outermost type
    // i.e.   @Readonly List list;
    //        @Readonly List<String> list;
    Tree leaf = path.getLeaf();
    if (leaf instanceof VariableTree) {
      Tree parent = path.getParentPath().getLeaf();
      if (parent.getKind() == Tree.Kind.METHOD) {
        MethodTree mt = (MethodTree) parent;
        if (mt.getParameters().size() > paramPos) {
          if (mt.getParameters().get(paramPos).equals(leaf)) {
            return true;
          }
        }
      }
    } else {
      return this.isSatisfiedBy(path.getParentPath());
    }
    return false;
  }

  public Kind getKind() {
    return Kind.PARAM;
  }

  public String toString() {
    return "ParamCriterion for method: " + methodName + " at position: " +
    paramPos;
  }
}

@@ -29,263 +29,34 @@
 ort 
-java.util.ArrayList;%0Aimport java.util.List;%0A%0Aimport annotations.el.InnerTypeLocation;%0A%0Aimport com.sun.source.tree.ArrayTypeTree;%0Aimport com.sun.source.tree.IdentifierTree;%0Aimport com.sun.source.tree.MethodTree;%0Aimport com.sun.source.tree.ParameterizedType
+com.sun.source.tree.Method
 Tree
@@ -221,16 +221,16 @@
 rion %7B%0A%0A
+
   privat
@@ -254,45 +254,8 @@
 me;%0A
-  private Criterion parentCriterion;%0A
   pr

Remove dead code/imports.