コード例 #1
0
 public JavaClass findJavaClass(String classname) {
   JavaClass clazz = findClass(classname);
   if (clazz == null) {
     clazz = builder.getClass(classname);
     if (clazz.locatedInClassFile()) {
       addToIndex(clazz);
     }
   }
   return clazz;
 }
コード例 #2
0
  public Set<JavaClass> findClasses(Collection<File> changedFiles) {
    // First update class index
    List<String> changedClassesNames = new ArrayList<String>();
    for (File changedFile : changedFiles) {
      String changedClassname = builder.classFileChanged(changedFile);
      if (changedClassname != null) {
        changedClassesNames.add(changedClassname);
      }
    }

    // Then find dependencies
    Set<JavaClass> changedClasses = newHashSet();
    for (String changedClassesName : changedClassesNames) {
      JavaClass javaClass = builder.getClass(changedClassesName);
      if (javaClass != null) {
        addToIndex(javaClass);
        changedClasses.add(javaClass);
      }
    }
    builder.clear();
    return changedClasses;
  }