Skip to content

Commit

Permalink
[MDEP-896] - Removing unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
khmarbaise committed Nov 10, 2023
1 parent ad2af95 commit 8b150c4
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 79 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@

import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
import org.apache.maven.artifact.resolver.filter.ScopeArtifactFilter;
import org.apache.maven.artifact.versioning.ArtifactVersion;
import org.apache.maven.artifact.versioning.Restriction;
import org.apache.maven.artifact.versioning.VersionRange;
import org.apache.maven.execution.MavenSession;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
Expand Down Expand Up @@ -442,31 +439,4 @@ private DependencyNodeFilter createDependencyNodeFilter() {

// following is required because the version handling in maven code
// doesn't work properly. I ripped it out of the enforcer rules.

/**
* Copied from Artifact.VersionRange. This is tweaked to handle singular ranges properly. Currently the default
* containsVersion method assumes a singular version means allow everything. This method assumes that "2.0.4" ==
* "[2.0.4,)"
*
* @param allowedRange range of allowed versions.
* @param theVersion the version to be checked.
* @return true if the version is contained by the range.
* @deprecated This method is unused in this project and will be removed in the future.
*/
@Deprecated
public static boolean containsVersion(VersionRange allowedRange, ArtifactVersion theVersion) {
ArtifactVersion recommendedVersion = allowedRange.getRecommendedVersion();
if (recommendedVersion == null) {
List<Restriction> restrictions = allowedRange.getRestrictions();
for (Restriction restriction : restrictions) {
if (restriction.containsVersion(theVersion)) {
return true;
}
}
return false;
} else {
// only singular versions ever have a recommendedVersion
return recommendedVersion.compareTo(theVersion) <= 0;
}
}
}

This file was deleted.

0 comments on commit 8b150c4

Please sign in to comment.