test_class.declarator: validator
test_class.modifier: private
test_class.original_string: private DependencyValidator validator;
test_class.type: DependencyValidator
test_class.var_name: validator
test_class.declarator: properties
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private PackageProperties properties;
test_class.type: PackageProperties
test_class.var_name: properties
test_class.declarator: resolvedPackageInfos
test_class.modifier: private
test_class.original_string: private Collection<PackageInfo> resolvedPackageInfos;
test_class.type: Collection<PackageInfo>
test_class.var_name: resolvedPackageInfos
test_class.file: vault-validation/src/test/java/org/apache/jackrabbit/vault/validation/spi/impl/DependencyValidatorTest.java
test_class.identifier: DependencyValidatorTest
test_case.body: @Test
      public void testValidateWithDependenciesWithOverlappingFilterRoots() {
          resolvedPackageInfos.add(getPackageInfo("group1:package1:0.1", "/simple-package/META-INF/vault/filter.xml", null));
          resolvedPackageInfos.add(getPackageInfo("group2:package2:2.9", "/simple-package/META-INF/vault/filter.xml", null));
          Assert.assertThat(validator.validate(properties), 
                  Matchers.contains(new ValidationMessage(ValidationMessageSeverity.ERROR, String.format(String.format(String.format(DependencyValidator.MESSAGE_DEPENDENCIES_WITH_OVERLAPPING_FILTERS,
                          "group2:package2:2.9", "/etc/project1", "group1:package1:0.1"))))));
      }
test_case.class_method_signature: DependencyValidatorTest.testValidateWithDependenciesWithOverlappingFilterRoots()
test_case.full_signature: @Test public void testValidateWithDependenciesWithOverlappingFilterRoots()
test_case.identifier: testValidateWithDependenciesWithOverlappingFilterRoots
test_case.invocations: add getPackageInfo add getPackageInfo assertThat validate contains format format format
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testValidateWithDependenciesWithOverlappingFilterRoots()
focal_class.declarator: MESSAGE_DEPENDENCIES_WITH_OVERLAPPING_FILTERS = "Dependency '%s' defines same filter root '%s' as dependency '%s'"
focal_class.modifier: static final
focal_class.original_string: static final String MESSAGE_DEPENDENCIES_WITH_OVERLAPPING_FILTERS = "Dependency '%s' defines same filter root '%s' as dependency '%s'";
focal_class.type: String
focal_class.var_name: MESSAGE_DEPENDENCIES_WITH_OVERLAPPING_FILTERS
focal_class.declarator: MESSAGE_UNRESOLVED_DEPENDENCY = "Dependency '%s'was not successfully resolved and can therefore not be used for analysis."
focal_class.modifier: static final
focal_class.original_string: static final String MESSAGE_UNRESOLVED_DEPENDENCY = "Dependency '%s'was not successfully resolved and can therefore not be used for analysis.";
focal_class.type: String
focal_class.var_name: MESSAGE_UNRESOLVED_DEPENDENCY
focal_class.declarator: dependenciesMetaInfo
focal_class.modifier: private final
focal_class.original_string: private final Collection<PackageInfo> dependenciesMetaInfo;
focal_class.type: Collection<PackageInfo>
focal_class.var_name: dependenciesMetaInfo
focal_class.declarator: severity
focal_class.modifier: private final
focal_class.original_string: private final ValidationMessageSeverity severity;
focal_class.type: ValidationMessageSeverity
focal_class.var_name: severity
focal_class.declarator: severityForUnresolvedDependencies
focal_class.modifier: private final
focal_class.original_string: private final ValidationMessageSeverity severityForUnresolvedDependencies;
focal_class.type: ValidationMessageSeverity
focal_class.var_name: severityForUnresolvedDependencies
focal_class.file: vault-validation/src/main/java/org/apache/jackrabbit/vault/validation/spi/impl/DependencyValidator.java
focal_class.identifier: DependencyValidator
focal_class.interfaces: implements PropertiesValidator
focal_class.class_method_signature: DependencyValidator.DependencyValidator(@NotNull ValidationMessageSeverity severity, ValidationMessageSeverity severityForUnresolvedDependencies, Collection<PackageInfo> dependenciesMetaInfo)
focal_class.full_signature: public  DependencyValidator(@NotNull ValidationMessageSeverity severity, ValidationMessageSeverity severityForUnresolvedDependencies, Collection<PackageInfo> dependenciesMetaInfo)
focal_class.identifier: DependencyValidator
focal_class.modifiers: public
focal_class.parameters: (@NotNull ValidationMessageSeverity severity, ValidationMessageSeverity severityForUnresolvedDependencies, Collection<PackageInfo> dependenciesMetaInfo)
focal_class.signature:  DependencyValidator(@NotNull ValidationMessageSeverity severity, ValidationMessageSeverity severityForUnresolvedDependencies, Collection<PackageInfo> dependenciesMetaInfo)
focal_class.class_method_signature: DependencyValidator.done()
focal_class.full_signature: @Override public Collection<ValidationMessage> done()
focal_class.identifier: done
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Collection<ValidationMessage>
focal_class.signature: Collection<ValidationMessage> done()
focal_class.class_method_signature: DependencyValidator.validate(@NotNull PackageProperties properties)
focal_class.full_signature: @Override public Collection<ValidationMessage> validate(@NotNull PackageProperties properties)
focal_class.identifier: validate
focal_class.modifiers: @Override public
focal_class.parameters: (@NotNull PackageProperties properties)
focal_class.return: Collection<ValidationMessage>
focal_class.signature: Collection<ValidationMessage> validate(@NotNull PackageProperties properties)
focal_method.body: @Override
      public Collection<ValidationMessage> validate(@NotNull PackageProperties properties) {
          
          // use resolved dependencies
          Collection<ValidationMessage> messages = new LinkedList<>();
          
          Map<String, PackageInfo> roots = new HashMap<>();
          
          // check for unresolved dependencies!
          for (Dependency dependency : properties.getDependencies()) {
              boolean isDependencyResolved = false;
              for (PackageInfo resolvedDependency : dependenciesMetaInfo) {
                  if (dependency.matches(resolvedDependency.getId())) {
                      for (PathFilterSet set : resolvedDependency.getFilter().getFilterSets()) {
                          String root = set.getRoot();
                          PackageInfo existing = roots.get(root);
                          if (existing != null) {
                              String msg = String.format(MESSAGE_DEPENDENCIES_WITH_OVERLAPPING_FILTERS,
                                      resolvedDependency.getId(), root, existing.getId());
                              messages.add(new ValidationMessage(severity, msg));
                          }
                          roots.put(root, resolvedDependency);
                      }
                      isDependencyResolved = true;
                      break;
                  }
              }
              if (!isDependencyResolved) {
                  String msg = String.format(MESSAGE_UNRESOLVED_DEPENDENCY, dependency);
                  messages.add(new ValidationMessage(severityForUnresolvedDependencies, msg));
                  continue;
              }
              // TODO: check for overlapping roots with current filter.xml
          }
          return messages;
      }
focal_method.class_method_signature: DependencyValidator.validate(@NotNull PackageProperties properties)
focal_method.full_signature: @Override public Collection<ValidationMessage> validate(@NotNull PackageProperties properties)
focal_method.identifier: validate
focal_method.invocations: getDependencies matches getId getFilterSets getFilter getRoot get format getId getId add put format add
focal_method.modifiers: @Override public
focal_method.parameters: (@NotNull PackageProperties properties)
focal_method.return: Collection<ValidationMessage>
focal_method.signature: Collection<ValidationMessage> validate(@NotNull PackageProperties properties)