{@inheritDoc}

@see org.jboss.shrinkwrap.resolver.api.maven.filter.MavenResolutionFilter#accepts(org.jboss.shrinkwrap.resolver.api.maven.coordinate.MavenDependency,
java.util.List, java.util.List)
161545
@Override
    public boolean accepts(final MavenDependency dependency, final List<MavenDependency> dependenciesForResolution,
            final List<MavenDependency> dependencyAncestors) {
        if (bannedDependencies.contains(dependency)) {
            return false;
        }

        if (rejectTransitives) {
            if (dependencyAncestors != null && dependencyAncestors.size() != 0) {
                return dependencyAncestors.get(0).equals(dependency);
            }
        }

        return true;
    }
176969
private List<MavenDependencyDescriptor> addManagedDependencies(MavenDependentDescriptor pomDescriptor, DependencyManagement dependencyManagement,
            ScannerContext scannerContext, Class<? extends AbstractDependencyDescriptor> relationClass) {
        if (dependencyManagement == null) {
            return Collections.emptyList();
        }
        List<Dependency> dependencies = dependencyManagement.getDependencies();
        return getDependencies(pomDescriptor, dependencies, relationClass, scannerContext);
    }
339669
public void setAccept(List<String> accepts) {
        this.accepts = Collections.unmodifiableList(accepts);
        setHeaders(Collections.singletonMap("accept", this.accepts));
    }
117659
public static void accept(SARLQuickfixProvider provider, Issue issue, IssueResolutionAcceptor acceptor) {
		final String[] data = issue.getData();
		if (data != null && data.length > 1) {
			final String actionName = data[1];
			final ActionAddModification modification = new ActionAddModification(actionName);
			modification.setIssue(issue);
			modification.setTools(provider);
			acceptor.accept(issue,
					MessageFormat.format(Messages.SARLQuickfixProvider_2, actionName),
					MessageFormat.format(Messages.SARLQuickfixProvider_3, actionName),
					JavaPluginImages.IMG_CORRECTION_ADD,
					modification,
					IProposalRelevance.ADD_UNIMPLEMENTED_METHODS);
		}
	}
282254
@Override
	public void accept(Visitor<PlanNode> visitor) {
		for (SinkPlanNode node : this.dataSinks) {
			node.accept(visitor);
		}
	}
1300238
public void accept(final MethodVisitor mv) {
        mv.visitTryCatchBlock(start.getLabel(), end.getLabel(),
                handler == null ? null : handler.getLabel(), type);
        int n = visibleTypeAnnotations == null ? 0 : visibleTypeAnnotations
                .size();
        for (int i = 0; i < n; ++i) {
            TypeAnnotationNode an = visibleTypeAnnotations.get(i);
            an.accept(mv.visitTryCatchAnnotation(an.typeRef, an.typePath,
                    an.desc, true));
        }
        n = invisibleTypeAnnotations == null ? 0 : invisibleTypeAnnotations
                .size();
        for (int i = 0; i < n; ++i) {
            TypeAnnotationNode an = invisibleTypeAnnotations.get(i);
            an.accept(mv.visitTryCatchAnnotation(an.typeRef, an.typePath,
                    an.desc, false));
        }
    }
1299338
private MavenArtifactDescriptor getMavenArtifactDescriptor(Dependency dependency, ScannerContext context) {
        DependencyCoordinates coordinates = new DependencyCoordinates(dependency);
        return getArtifactResolver(context).resolve(coordinates, context);
    }
196461
public void addDependency(org.apache.maven.model.Dependency projectDependency) {
        log.debug( "Adding dependency: {}", projectDependency );
        
        DefaultArtifact artifact = null;
        
        if ( Const.TEST.equals( projectDependency.getType() ) || Const.TEST_JAR.equals( projectDependency.getType() ) ) {
            
            ArtifactType artifactType = new DefaultArtifactType( Const.TEST_JAR, Const.JAR, Const.TEST_JAR, null );
            
            artifact = new DefaultArtifact( projectDependency.getGroupId(), projectDependency.getArtifactId(),
                    null, Const.JAR, projectDependency.getVersion(), artifactType );
        } else {
            artifact = new DefaultArtifact( projectDependency.getGroupId(), projectDependency.getArtifactId(),
                    null, Const.JAR, projectDependency.getVersion() );
        }
        
        Dependency dependency = new Dependency( artifact , projectDependency.getScope());
        dependency.setOptional( projectDependency.isOptional() );
        
        List<Exclusion> exclusions = new ArrayList<Exclusion>();
        for ( org.apache.maven.model.Exclusion projectExclusion : projectDependency.getExclusions() ) {
            exclusions.add( new Exclusion(projectExclusion.getGroupId(), projectExclusion.getArtifactId(), "*", "*") );            
        }
        log.debug( "Exclusion: {}", exclusions );
        dependency = dependency.setExclusions( exclusions );
        
        dependencies.add( dependency );
    }
602387
@Override
    public String execute(MavenWorkingSession session) {
        final String declaredVersion = dependency.getVersion();
        String resolvedVersion = declaredVersion;

        // is not able to infer anything, it was not configured
        if (Validate.isNullOrEmptyOrQuestionMark(resolvedVersion)) {

            // version is ignored here, so we have to iterate to get the dependency we are looking for
            if (session.getDependencyManagement().contains(dependency)) {

                // get the dependency from internal dependencyManagement
                MavenDependency resolved = null;
                Iterator<MavenDependency> it = session.getDependencyManagement().iterator();
                while (it.hasNext()) {
                    resolved = it.next();
                    if (resolved.equals(dependency)) {
                        break;
                    }
                }
                // we have resolved a version from dependency management
                resolvedVersion = resolved.getVersion();
                log.log(Level.FINE, "Resolved version {0} from the POM file for the artifact {1}", new Object[] {
                        resolved.getVersion(), dependency.toCanonicalForm() });

            }

        }

        // SHRINKRES-102 test-jar has special behavior
        if (Validate.isNullOrEmptyOrQuestionMark(resolvedVersion) && dependency.getPackaging().equals(PackagingType.JAR) && dependency.getClassifier().equals(PackagingType.TEST_JAR.getClassifier())) {
            MavenCoordinate coordinate = MavenCoordinates.createCoordinate(dependency.getGroupId(), dependency.getArtifactId(), dependency.getVersion(), PackagingType.TEST_JAR, PackagingType.TEST_JAR.getClassifier());
            MavenDependency newDependency = new MavenDependencyImpl(coordinate, dependency.getScope(), dependency.isOptional(), dependency.getExclusions().toArray(new MavenDependencyExclusion[0]));

            // version is ignored here, so we have to iterate to get the dependency we are looking for
            if (session.getDependencyManagement().contains(newDependency)) {

                // get the dependency from internal dependencyManagement
                MavenDependency resolved = null;
                Iterator<MavenDependency> it = session.getDependencyManagement().iterator();
                while (it.hasNext()) {
                    resolved = it.next();
                    if (resolved.equals(newDependency)) {
                        break;
                    }
                }
                // we have resolved a version from dependency management
                resolvedVersion = resolved.getVersion();
                log.log(Level.FINE, "Resolved version {0} from the POM file for the artifact {1} via {2}", new Object[] {
                        resolved.getVersion(), dependency.toCanonicalForm() , newDependency.toCanonicalForm()});

            }
        }

        // Still unresolved?
        if (Validate.isNullOrEmptyOrQuestionMark(resolvedVersion)) {

            // log available version management
            if (log.isLoggable(Level.FINER)) {
                StringBuilder sb = new StringBuilder("Available version management: \n");
                for (final MavenDependency depmgmt : session.getDependencyManagement()) {
                    sb.append(depmgmt).append("\n");
                }
                log.log(Level.FINER, sb.toString());
            }

            throw new ResolutionException(
                    MessageFormat
                            .format(
                                    "Unable to get version for dependency specified by {0}, it was not provided in neither <dependencyManagement> nor <dependencies> sections.",
                                    dependency.toCanonicalForm()));
        }

        // Return
        return resolvedVersion;
    }
558526
private static void resolveDependencies(Collection<ArtifactSpec> collection, ShrinkwrapArtifactResolvingHelper helper) {
        // Identify the artifact specs that need resolution.
        // Ideally, there should be none at this point.
        collection.forEach(spec -> {
            if (spec.file == null) {
                // Resolve it.
                ArtifactSpec resolved = helper.resolve(spec);
                if (resolved != null) {
                    spec.file = resolved.file;
                } else {
                    throw new IllegalStateException("Unable to resolve artifact: " + spec.toString());
                }
            }
        });
    }
367917
public boolean accept(ClassInfo classInfo, ClassHierarchyResolver hierarchyResolver) {
    Map<String, ClassInfo> superClasses;
    if (baseClass.isInterface())
      superClasses = hierarchyResolver.findAllInterfaces(classInfo);
    else
      superClasses = hierarchyResolver.findAllSuperClasses(classInfo);

    return superClasses.keySet().contains(baseClass.getName());
  }
1176286
@Override
	public boolean accept(final ConnectionSupplier supplier) {
		if (supplier == null) {
			return false;
		}

		String[] parts = supplier.getDatabaseName().split("-", 2);
		String databaseName = parts[0];

		if (!databaseName.startsWith(getDatabaseName())) {
			return false;
		}

		String databaseVersion = parts[1];

		try {
			int majorVersion = Integer.parseInt(databaseVersion.substring(0, databaseVersion.indexOf(".")));
			return isTargetVersion(majorVersion);
		} catch (NumberFormatException e) {
			return false;
		}
	}
790356
@Override
	protected List<File> resolve(String fqtn) throws Exception {
		StringTokenizer tokenizer = new StringTokenizer(fqtn, ":", false);
		String groupId = tokenizer.nextToken();
		String templateId = tokenizer.nextToken();
		String version = tokenizer.nextToken();

		Dependency dependency = new Dependency(new DefaultArtifact(groupId + ':' + templateId + ':' + version), null);

		CollectRequest collectRequest = new CollectRequest();
		collectRequest.setRoot(dependency);
		collectRequest.addRepository(local);
		collectRequest.addRepository(central);

		RepositorySystemSession session = newSession(repoSystem);

		DependencyNode node = repoSystem.collectDependencies(session, collectRequest).getRoot();
		DependencyRequest dependencyRequest = new DependencyRequest(node, null);

		repoSystem.resolveDependencies(session, dependencyRequest);

		PreorderNodeListGenerator nlg = new PreorderNodeListGenerator();
		node.accept(nlg);
		return nlg.getFiles();
	}
937680
private OrderedMap<String, Pom> sortSubmodulesToReflectDependencies(Pom pom)
    {
        Set<MavenCoord> dependenciesMet = new HashSet();
        dependenciesMet.add(pom.coord);

        SortedSet<MavenCoord> dependenciesSatisfied = new TreeSet<>();

        for (Dependency dep : pom.dependencies)
        {
            // Traverse the tree, depth-first, take items at node exit.
        }

        throw new UnsupportedOperationException("Not implemented yet.");
    }
1117318
private void updateDependencies(Element configuration, boolean pAddJsr160Proxy) {
        List<Element> dependencyElements =
                XmlUtils.findElements("/configuration/jolokia/dependencies/dependency", configuration);
        addJsr160Dependencies(configuration,dependencyElements, pAddJsr160Proxy);

        List<Dependency> dependencies = new ArrayList<Dependency>();
        for (Element dependencyElement : dependencyElements) {
            dependencies.add(new Dependency(dependencyElement));
        }
        projectOperations.addDependencies(projectOperations.getFocusedModuleName(), dependencies);
	}
204739
@Override
    public void accept(ClassWriterOutputVisitor outputVisitor) throws IOException {
        if (annotationMetadataWriter != null) {
            annotationMetadataWriter.accept(outputVisitor);
        }
        try (OutputStream outputStream = outputVisitor.visitClass(getBeanDefinitionQualifiedClassName())) {
            ClassWriter classWriter = generateClassBytes();
            outputStream.write(classWriter.toByteArray());
        }
        outputVisitor.visitServiceDescriptor(
            BeanDefinitionReference.class,
            beanDefinitionReferenceClassName
        );
    }
521344
public static void accept(SARLQuickfixProvider provider, Issue issue, IssueResolutionAcceptor acceptor) {
		final CapacityReferenceRemoveModification modification = new CapacityReferenceRemoveModification();
		modification.setIssue(issue);
		modification.setTools(provider);
		acceptor.accept(issue,
				Messages.SARLQuickfixProvider_0,
				Messages.SARLQuickfixProvider_5,
				JavaPluginImages.IMG_CORRECTION_REMOVE,
				modification,
				IProposalRelevance.REMOVE_ARGUMENTS);
	}