Ejemplo n.º 1
0
  public Map getCandidateCls() {
    Collection<JavaCriticalSection> result =
        JavaCriticalSectionFinder.getInstance(_srcpath, _classpath).getAllSyncs();

    Set<String> classes = new HashSet<String>();
    Map<String, Map<String, Integer>> candidate = new HashMap<String, Map<String, Integer>>();
    for (JavaCriticalSection cs : result) {
      String classname = cs.getClassNameOfSourceFile();
      if ((!cs.getLockName().equals("this")) || !refactorableClass.containsKey(classname)) continue;
      if (!classes.contains(classname)) {
        classes.add(classname);
        candidate.put(classname, new HashMap<String, Integer>());
      }
      String method = cs.getMethodName();
      Integer line = new Integer(cs.getStartLine());
      candidate.get(classname).put(method, line);
    }
    return candidate;
  }
Ejemplo n.º 2
0
 public void getAllSyncs() {
   results = JavaCriticalSectionFinder.getInstance(_srcpath, _classpath).getAllSyncs();
 }