From 5a6afd41cff36eb92f7214031926a38898eca523 Mon Sep 17 00:00:00 2001 From: Tim Walters Date: Sun, 8 Mar 2026 17:46:39 +0000 Subject: [PATCH 1/3] Apply suggested fix to src/main/java/com/solubris/enforcer/VersionPropertyRule.java from Copilot Autofix Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> --- src/main/java/com/solubris/enforcer/VersionPropertyRule.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/solubris/enforcer/VersionPropertyRule.java b/src/main/java/com/solubris/enforcer/VersionPropertyRule.java index 3944a67..84de3bc 100644 --- a/src/main/java/com/solubris/enforcer/VersionPropertyRule.java +++ b/src/main/java/com/solubris/enforcer/VersionPropertyRule.java @@ -131,14 +131,14 @@ private static String unusedProperty(String effectiveVersion, List art private String missingProperty(String version, List artifacts) { if (!requirePropertiesForDuplicates) return null; - String unused = artifacts.stream() + String locationsWithoutProperty = artifacts.stream() .filter(a -> Objects.equals(a.getVersion(), a.getEffectiveVersion())) .map(Artifact::key) .collect(joining(", ")); return String.format( "Version '%s' exists in multiple locations, please extract a version property. " + "Unused locations: %s", - version, unused); + version, locationsWithoutProperty); } /** From 7501aefe47bf3854dcbd6323e42fc8bf9e74e644 Mon Sep 17 00:00:00 2001 From: Tim Walters Date: Sun, 8 Mar 2026 17:46:40 +0000 Subject: [PATCH 2/3] Apply suggested fix to src/main/java/com/solubris/enforcer/VersionPropertyRule.java from Copilot Autofix Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> --- src/main/java/com/solubris/enforcer/VersionPropertyRule.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/solubris/enforcer/VersionPropertyRule.java b/src/main/java/com/solubris/enforcer/VersionPropertyRule.java index 84de3bc..8e9ad06 100644 --- a/src/main/java/com/solubris/enforcer/VersionPropertyRule.java +++ b/src/main/java/com/solubris/enforcer/VersionPropertyRule.java @@ -114,7 +114,7 @@ private String redundantProperty(Artifact artifact) { * That's possible due to coincidental properties - another edge case to consider. */ private static String unusedProperty(String effectiveVersion, List artifacts) { - String unused = artifacts.stream() + String explicitVersionLocations = artifacts.stream() .filter(Artifact::hasExplicitVersion) .map(Artifact::key) .collect(joining(", ")); @@ -125,7 +125,7 @@ private static String unusedProperty(String effectiveVersion, List art .findAny().orElse("unknown"); return String.format( "Version property %s=%s exists but is not used everywhere. Unused locations: %s", - propertyName, effectiveVersion, unused); + propertyName, effectiveVersion, explicitVersionLocations); } private String missingProperty(String version, List artifacts) { From af2c6687e4c7774f45fc8f088d72490d90889c24 Mon Sep 17 00:00:00 2001 From: Tim Walters Date: Sun, 8 Mar 2026 17:46:40 +0000 Subject: [PATCH 3/3] Apply suggested fix to src/main/java/com/solubris/enforcer/VersionPropertyRule.java from Copilot Autofix Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> --- .../java/com/solubris/enforcer/VersionPropertyRule.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/solubris/enforcer/VersionPropertyRule.java b/src/main/java/com/solubris/enforcer/VersionPropertyRule.java index 8e9ad06..e800b0c 100644 --- a/src/main/java/com/solubris/enforcer/VersionPropertyRule.java +++ b/src/main/java/com/solubris/enforcer/VersionPropertyRule.java @@ -76,14 +76,14 @@ protected Stream scan() { .map(e -> { String effectiveVersion = e.getKey(); List artifacts = e.getValue(); - long propertyCount = artifacts.stream() + long implicitVersionCount = artifacts.stream() .filter(Artifact::hasImplicitVersion) .count(); if (artifacts.size() > 1) { - if (propertyCount == 0) return missingProperty(effectiveVersion, artifacts); - if (propertyCount < artifacts.size()) return unusedProperty(effectiveVersion, artifacts); + if (implicitVersionCount == 0) return missingProperty(effectiveVersion, artifacts); + if (implicitVersionCount < artifacts.size()) return unusedProperty(effectiveVersion, artifacts); } else if (artifacts.size() == 1) { - if (propertyCount == 1) return redundantProperty(artifacts.get(0)); + if (implicitVersionCount == 1) return redundantProperty(artifacts.get(0)); } return null; }).filter(Objects::nonNull);