コード例 #1
0
ファイル: DefaultIndex.java プロジェクト: eSh3m4/sonarqube
 Set<Dependency> getDependenciesBetweenProjects() {
   Set<Dependency> result = Sets.newLinkedHashSet();
   for (Dependency dependency : dependencies) {
     if (ResourceUtils.isSet(dependency.getFrom()) || ResourceUtils.isSet(dependency.getTo())) {
       result.add(dependency);
     }
   }
   return result;
 }
コード例 #2
0
ファイル: DefaultIndex.java プロジェクト: eSh3m4/sonarqube
  /** Keep only project stuff */
  public void clear() {
    Iterator<Map.Entry<Resource, Bucket>> it = buckets.entrySet().iterator();
    while (it.hasNext()) {
      Map.Entry<Resource, Bucket> entry = it.next();
      Resource resource = entry.getKey();
      if (!ResourceUtils.isSet(resource)) {
        entry.getValue().clear();
        it.remove();
      }
    }

    // store dependencies
    for (Dependency dep : dependencies) {
      dependencyPersister.saveDependency(currentProject, dep);
    }

    // Keep only inter module dependencies
    Set<Dependency> projectDependencies = getDependenciesBetweenProjects();
    dependencies.clear();
    incomingDependenciesByResource.clear();
    outgoingDependenciesByResource.clear();
    for (Dependency projectDependency : projectDependencies) {
      projectDependency.setId(null);
      registerDependency(projectDependency);
    }
  }
コード例 #3
0
ファイル: DefaultIndex.java プロジェクト: ratlsun/view_sonar
  /** Keep only project stuff */
  public void clear() {
    Iterator<Map.Entry<Resource, Bucket>> it = buckets.entrySet().iterator();
    while (it.hasNext()) {
      Map.Entry<Resource, Bucket> entry = it.next();
      Resource resource = entry.getKey();
      if (!ResourceUtils.isSet(resource)) {
        entry.getValue().clear();
        it.remove();
      }
    }

    Set<Dependency> projectDependencies = getDependenciesBetweenProjects();
    dependencies.clear();
    incomingDependenciesByResource.clear();
    outgoingDependenciesByResource.clear();
    for (Dependency projectDependency : projectDependencies) {
      projectDependency.setId(null);
      registerDependency(projectDependency);
    }

    lock.unlock();
  }