Skip to content

Commit

Permalink
Polish
Browse files Browse the repository at this point in the history
  • Loading branch information
sambsnyd committed Mar 16, 2024
1 parent a1c88db commit 98efffd
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public String getDescription() {
return "Add a managed Maven dependency to a `pom.xml` file.";
}

static class Scanned {
public static class Scanned {
boolean usingType;
List<SourceFile> rootPoms = new ArrayList<>();
}
Expand All @@ -164,7 +164,7 @@ public Xml.Document visitDocument(Xml.Document document, ExecutionContext ctx) {
acc.rootPoms.add(document);
}
});
if(acc.usingType) {
if (acc.usingType) {
return SearchResult.found(document);
}

Expand Down Expand Up @@ -201,6 +201,9 @@ public Xml visitDocument(Xml.Document document, ExecutionContext ctx) {
if (!Boolean.TRUE.equals(addToRootPom) || acc.rootPoms.contains(document)) {
ResolvedPom pom = getResolutionResult().getPom();
String convertedVersion = pom.getValue(version);
if (convertedVersion == null) {
return maven;
}
Validated<VersionComparator> versionValidation = Semver.validate(convertedVersion, versionPattern);
if (versionValidation.isValid()) {
VersionComparator versionComparator = requireNonNull(versionValidation.getValue());
Expand Down

0 comments on commit 98efffd

Please sign in to comment.