This is an automated email from the ASF dual-hosted git repository.
elharo pushed a commit to branch the
in repository https://gitbox.apache.org/repos/asf/maven-enforcer.git
The following commit(s) were added to refs/heads/the by this push:
new b3c9e3d9 More conventional variable names
b3c9e3d9 is described below
commit b3c9e3d97ca546784dbbf05f9bd8a134c2aa1f8a
Author: Elliotte Rusty Harold <[email protected]>
AuthorDate: Mon Jun 30 06:35:53 2025 -0400
More conventional variable names
---
.../maven/enforcer/rules/RequireJavaVendor.java | 12 ++---
.../enforcer/rules/RequirePluginVersions.java | 30 +++++------
.../rules/dependency/BannedDependenciesBase.java | 18 +++----
.../enforcer/rules/utils/ArtifactMatcher.java | 14 ++---
.../rules/ReactorModuleConvergenceTest.java | 60 +++++++++++-----------
.../enforcer/rules/TestRequirePluginVersions.java | 24 ++++-----
.../utils/MockEnforcerExpressionEvaluator.java | 14 ++---
.../apache/maven/plugins/enforcer/EnforceMojo.java | 18 +++----
8 files changed, 95 insertions(+), 95 deletions(-)
diff --git
a/enforcer-rules/src/main/java/org/apache/maven/enforcer/rules/RequireJavaVendor.java
b/enforcer-rules/src/main/java/org/apache/maven/enforcer/rules/RequireJavaVendor.java
index f31b7965..e5ebf061 100644
---
a/enforcer-rules/src/main/java/org/apache/maven/enforcer/rules/RequireJavaVendor.java
+++
b/enforcer-rules/src/main/java/org/apache/maven/enforcer/rules/RequireJavaVendor.java
@@ -96,10 +96,10 @@ public final class RequireJavaVendor extends
AbstractStandardEnforcerRule {
* java.vendor, which you can also see with mvn --version. <br>
* Excludes override the include rules.
*
- * @param theExcludes the vendors to exclude from the include list
+ * @param excludes the vendors to exclude from the include list
*/
- public void setExcludes(List<String> theExcludes) {
- this.excludes = theExcludes;
+ public void setExcludes(List<String> excludes) {
+ this.excludes = excludes;
}
/**
@@ -114,12 +114,12 @@ public final class RequireJavaVendor extends
AbstractStandardEnforcerRule {
* <li><code>Amazon</code> prohibits vendor name Amazon </li>
* </ul>
*
- * @param theIncludes the list of required vendors
+ * @param includes the list of required vendors
*
* @see #setExcludes(List)
*/
- public void setIncludes(List<String> theIncludes) {
- this.includes = theIncludes;
+ public void setIncludes(List<String> includes) {
+ this.includes = includes;
}
@Override
diff --git
a/enforcer-rules/src/main/java/org/apache/maven/enforcer/rules/RequirePluginVersions.java
b/enforcer-rules/src/main/java/org/apache/maven/enforcer/rules/RequirePluginVersions.java
index 324749aa..f5125615 100644
---
a/enforcer-rules/src/main/java/org/apache/maven/enforcer/rules/RequirePluginVersions.java
+++
b/enforcer-rules/src/main/java/org/apache/maven/enforcer/rules/RequirePluginVersions.java
@@ -475,18 +475,18 @@ public final class RequirePluginVersions extends
AbstractStandardEnforcerRule {
* later than the plugin is executing.
*
* @param project the project
- * @param thePhases the phases
+ * @param phases the phases
* @return the bound plugins
* @throws PluginNotFoundException the plugin not found exception
* @throws LifecycleExecutionException the lifecycle execution exception
*/
- private Set<Plugin> getBoundPlugins(MavenProject project, String thePhases)
+ private Set<Plugin> getBoundPlugins(MavenProject project, String phases)
throws PluginNotFoundException, LifecycleExecutionException {
Set<Plugin> allPlugins = new HashSet<>();
// lookup the bindings for all the passed in phases
- String[] lifecyclePhases = thePhases.split(",");
+ String[] lifecyclePhases = phases.split(",");
for (int i = 0; i < lifecyclePhases.length; i++) {
String lifecyclePhase = lifecyclePhases[i];
if (lifecyclePhase != null && !lifecyclePhase.isEmpty()) {
@@ -884,19 +884,19 @@ public final class RequirePluginVersions extends
AbstractStandardEnforcerRule {
/**
* Sets the ban latest.
*
- * @param theBanLatest the banLatest to set
+ * @param banLatest the banLatest to set
*/
- public void setBanLatest(boolean theBanLatest) {
- this.banLatest = theBanLatest;
+ public void setBanLatest(boolean banLatest) {
+ this.banLatest = banLatest;
}
/**
* Sets the ban release.
*
- * @param theBanRelease the banRelease to set
+ * @param banRelease the banRelease to set
*/
- public void setBanRelease(boolean theBanRelease) {
- this.banRelease = theBanRelease;
+ public void setBanRelease(boolean banRelease) {
+ this.banRelease = banRelease;
}
/**
@@ -911,19 +911,19 @@ public final class RequirePluginVersions extends
AbstractStandardEnforcerRule {
/**
* Sets the ban snapshots.
*
- * @param theBanSnapshots the banSnapshots to set
+ * @param banSnapshots the banSnapshots to set
*/
- public void setBanSnapshots(boolean theBanSnapshots) {
- this.banSnapshots = theBanSnapshots;
+ public void setBanSnapshots(boolean banSnapshots) {
+ this.banSnapshots = banSnapshots;
}
/**
* Sets the ban timestamps.
*
- * @param theBanTimestamps the banTimestamps to set
+ * @param banTimestamps the banTimestamps to set
*/
- public void setBanTimestamps(boolean theBanTimestamps) {
- this.banTimestamps = theBanTimestamps;
+ public void setBanTimestamps(boolean banTimestamps) {
+ this.banTimestamps = banTimestamps;
}
@Override
diff --git
a/enforcer-rules/src/main/java/org/apache/maven/enforcer/rules/dependency/BannedDependenciesBase.java
b/enforcer-rules/src/main/java/org/apache/maven/enforcer/rules/dependency/BannedDependenciesBase.java
index cc8af237..1bf3fa3b 100644
---
a/enforcer-rules/src/main/java/org/apache/maven/enforcer/rules/dependency/BannedDependenciesBase.java
+++
b/enforcer-rules/src/main/java/org/apache/maven/enforcer/rules/dependency/BannedDependenciesBase.java
@@ -147,10 +147,10 @@ abstract class BannedDependenciesBase extends
AbstractStandardEnforcerRule {
/**
* Sets the search transitive.
*
- * @param theSearchTransitive the searchTransitive to set
+ * @param searchTransitive the searchTransitive to set
*/
- public void setSearchTransitive(boolean theSearchTransitive) {
- this.searchTransitive = theSearchTransitive;
+ public void setSearchTransitive(boolean searchTransitive) {
+ this.searchTransitive = searchTransitive;
}
/**
@@ -170,10 +170,10 @@ abstract class BannedDependenciesBase extends
AbstractStandardEnforcerRule {
* include rule.
*
* @see #getExcludes()
- * @param theExcludes the excludes to set
+ * @param excludes the excludes to set
*/
- public void setExcludes(List<String> theExcludes) {
- this.excludes = theExcludes;
+ public void setExcludes(List<String> excludes) {
+ this.excludes = excludes;
}
/**
@@ -196,10 +196,10 @@ abstract class BannedDependenciesBase extends
AbstractStandardEnforcerRule {
* include "xerces:xerces-api"
*
* @see #setIncludes(List)
- * @param theIncludes the includes to set
+ * @param includes the includes to set
*/
- public void setIncludes(List<String> theIncludes) {
- this.includes = theIncludes;
+ public void setIncludes(List<String> includes) {
+ this.includes = includes;
}
public boolean isSearchTransitive() {
diff --git
a/enforcer-rules/src/main/java/org/apache/maven/enforcer/rules/utils/ArtifactMatcher.java
b/enforcer-rules/src/main/java/org/apache/maven/enforcer/rules/utils/ArtifactMatcher.java
index 7d900396..fc6c1934 100644
---
a/enforcer-rules/src/main/java/org/apache/maven/enforcer/rules/utils/ArtifactMatcher.java
+++
b/enforcer-rules/src/main/java/org/apache/maven/enforcer/rules/utils/ArtifactMatcher.java
@@ -222,21 +222,21 @@ public final class ArtifactMatcher {
}
/**
- * Copied from Artifact.VersionRange. This is tweaked to handle singular
ranges properly. Currently the default
+ * Copied from Artifact.VersionRange. This is tweaked to handle singular
ranges properly. 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.
+ * @param allowedRange range of allowed versions
+ * @param version the version to be checked
+ * @return true if the version is contained by the range
*/
- public static boolean containsVersion(VersionRange allowedRange,
ArtifactVersion theVersion) {
+ public static boolean containsVersion(VersionRange allowedRange,
ArtifactVersion version) {
ArtifactVersion recommendedVersion =
allowedRange.getRecommendedVersion();
if (recommendedVersion == null) {
- return allowedRange.containsVersion(theVersion);
+ return allowedRange.containsVersion(version);
} else {
// only singular versions ever have a recommendedVersion
- int compareTo = recommendedVersion.compareTo(theVersion);
+ int compareTo = recommendedVersion.compareTo(version);
return compareTo <= 0;
}
}
diff --git
a/enforcer-rules/src/test/java/org/apache/maven/enforcer/rules/ReactorModuleConvergenceTest.java
b/enforcer-rules/src/test/java/org/apache/maven/enforcer/rules/ReactorModuleConvergenceTest.java
index 95497edc..2b71806f 100644
---
a/enforcer-rules/src/test/java/org/apache/maven/enforcer/rules/ReactorModuleConvergenceTest.java
+++
b/enforcer-rules/src/test/java/org/apache/maven/enforcer/rules/ReactorModuleConvergenceTest.java
@@ -73,8 +73,8 @@ class ReactorModuleConvergenceTest {
MavenProject mp2 = createProjectChild1(mp1);
MavenProject mp3 = createProjectChild2(mp1);
- List<MavenProject> theList = Arrays.asList(mp1, mp2, mp3);
- setupSortedProjects(theList);
+ List<MavenProject> projects = Arrays.asList(mp1, mp2, mp3);
+ setupSortedProjects(projects);
rule.execute();
}
@@ -86,8 +86,8 @@ class ReactorModuleConvergenceTest {
MavenProject mp2 = createProjectChild1(mp1);
MavenProject mp3 = createProjectChild2WithWrongVersion(mp1);
- List<MavenProject> theList = Arrays.asList(mp1, mp2, mp3);
- setupSortedProjects(theList);
+ List<MavenProject> projects = Arrays.asList(mp1, mp2, mp3);
+ setupSortedProjects(projects);
rule.execute();
@@ -102,18 +102,18 @@ class ReactorModuleConvergenceTest {
assertThrows(EnforcerRuleException.class, () -> {
MavenProject mp1 = createProjectParent();
- MavenProject wrongParentVerison = mock(MavenProject.class);
-
when(wrongParentVerison.getGroupId()).thenReturn("org.apache.enforcer");
- when(wrongParentVerison.getArtifactId()).thenReturn("m1");
- when(wrongParentVerison.getVersion()).thenReturn("1.1-SNAPSHOT");
-
when(wrongParentVerison.getId()).thenReturn("org.apache.enforcer:m1:jar:1.1-SNAPSHOT");
-
when(wrongParentVerison.getDependencies()).thenReturn(Collections.emptyList());
+ MavenProject wrongParentVersion = mock(MavenProject.class);
+
when(wrongParentVersion.getGroupId()).thenReturn("org.apache.enforcer");
+ when(wrongParentVersion.getArtifactId()).thenReturn("m1");
+ when(wrongParentVersion.getVersion()).thenReturn("1.1-SNAPSHOT");
+
when(wrongParentVersion.getId()).thenReturn("org.apache.enforcer:m1:jar:1.1-SNAPSHOT");
+
when(wrongParentVersion.getDependencies()).thenReturn(Collections.emptyList());
- MavenProject mp2 = createProjectChild2(wrongParentVerison);
+ MavenProject mp2 = createProjectChild2(wrongParentVersion);
MavenProject mp3 = createProjectChild2(mp1);
- List<MavenProject> theList = Arrays.asList(mp1, mp2, mp3);
- setupSortedProjects(theList);
+ List<MavenProject> projects = Arrays.asList(mp1, mp2, mp3);
+ setupSortedProjects(projects);
rule.execute();
@@ -131,8 +131,8 @@ class ReactorModuleConvergenceTest {
MavenProject mp2 = createProjectChild1(mp1);
MavenProject mp3 = createProjectChild2(mp1);
- List<MavenProject> theList = Arrays.asList(mp1, mp2, mp3);
- setupSortedProjects(theList);
+ List<MavenProject> projects = Arrays.asList(mp1, mp2, mp3);
+ setupSortedProjects(projects);
rule.execute();
}
@@ -144,8 +144,8 @@ class ReactorModuleConvergenceTest {
MavenProject mp2 = createProjectChild1(mp1);
MavenProject mp3 = createProjectChild2(null);
- List<MavenProject> theList = Arrays.asList(mp1, mp2, mp3);
- setupSortedProjects(theList);
+ List<MavenProject> projects = Arrays.asList(mp1, mp2, mp3);
+ setupSortedProjects(projects);
rule.execute();
});
@@ -156,18 +156,18 @@ class ReactorModuleConvergenceTest {
assertThrows(EnforcerRuleException.class, () -> {
MavenProject mp1 = createProjectParent();
- MavenProject wrongParentVerison = mock(MavenProject.class);
- when(wrongParentVerison.getGroupId()).thenReturn("org.apache");
- when(wrongParentVerison.getArtifactId()).thenReturn("m1");
- when(wrongParentVerison.getVersion()).thenReturn("1.0-SNAPSHOT");
-
when(wrongParentVerison.getId()).thenReturn("org.apache.enforcer:m1:jar:1.0-SNAPSHOT");
-
when(wrongParentVerison.getDependencies()).thenReturn(Collections.emptyList());
+ MavenProject wrongParentVersion = mock(MavenProject.class);
+ when(wrongParentVersion.getGroupId()).thenReturn("org.apache");
+ when(wrongParentVersion.getArtifactId()).thenReturn("m1");
+ when(wrongParentVersion.getVersion()).thenReturn("1.0-SNAPSHOT");
+
when(wrongParentVersion.getId()).thenReturn("org.apache.enforcer:m1:jar:1.0-SNAPSHOT");
+
when(wrongParentVersion.getDependencies()).thenReturn(Collections.emptyList());
- MavenProject mp2 = createProjectChild2(wrongParentVerison);
+ MavenProject mp2 = createProjectChild2(wrongParentVersion);
MavenProject mp3 = createProjectChild2(mp1);
- List<MavenProject> theList = Arrays.asList(mp1, mp2, mp3);
- setupSortedProjects(theList);
+ List<MavenProject> projects = Arrays.asList(mp1, mp2, mp3);
+ setupSortedProjects(projects);
rule.execute();
@@ -191,8 +191,8 @@ class ReactorModuleConvergenceTest {
List<Dependency> depListMP3 = Arrays.asList(dep1Mp3);
when(mp3.getDependencies()).thenReturn(depListMP3);
- List<MavenProject> theList = Arrays.asList(mp1, mp2, mp3);
- setupSortedProjects(theList);
+ List<MavenProject> projects = Arrays.asList(mp1, mp2, mp3);
+ setupSortedProjects(projects);
rule.execute();
}
@@ -211,8 +211,8 @@ class ReactorModuleConvergenceTest {
MavenProject mp3 = createProjectChild2(mp1);
- List<MavenProject> theList = Arrays.asList(mp1, mp2, mp3);
- setupSortedProjects(theList);
+ List<MavenProject> projects = Arrays.asList(mp1, mp2, mp3);
+ setupSortedProjects(projects);
rule.execute();
diff --git
a/enforcer-rules/src/test/java/org/apache/maven/enforcer/rules/TestRequirePluginVersions.java
b/enforcer-rules/src/test/java/org/apache/maven/enforcer/rules/TestRequirePluginVersions.java
index 511ca40c..bd093f8d 100644
---
a/enforcer-rules/src/test/java/org/apache/maven/enforcer/rules/TestRequirePluginVersions.java
+++
b/enforcer-rules/src/test/java/org/apache/maven/enforcer/rules/TestRequirePluginVersions.java
@@ -471,13 +471,13 @@ class TestRequirePluginVersions {
*
* @param group the group
* @param artifact the artifact
- * @param theSet the set
+ * @param plugins the set
*/
- private void assertContainsPlugin(String group, String artifact,
Collection<Plugin> theSet) {
- Plugin p = new Plugin();
- p.setGroupId(group);
- p.setArtifactId(artifact);
- assertTrue(theSet.contains(p));
+ private void assertContainsPlugin(String group, String artifact,
Collection<Plugin> plugins) {
+ Plugin plugin = new Plugin();
+ plugin.setGroupId(group);
+ plugin.setArtifactId(artifact);
+ assertTrue(plugins.contains(plugin));
}
/**
@@ -485,13 +485,13 @@ class TestRequirePluginVersions {
*
* @param group the group
* @param artifact the artifact
- * @param theSet the the set
+ * @param plugins the set
*/
- private void assertNotContainPlugin(String group, String artifact,
Collection<Plugin> theSet) {
- Plugin p = new Plugin();
- p.setGroupId(group);
- p.setArtifactId(artifact);
- assertFalse(theSet.contains(p));
+ private void assertNotContainPlugin(String group, String artifact,
Collection<Plugin> plugins) {
+ Plugin plugin = new Plugin();
+ plugin.setGroupId(group);
+ plugin.setArtifactId(artifact);
+ assertFalse(plugins.contains(plugin));
}
/**
diff --git
a/enforcer-rules/src/test/java/org/apache/maven/enforcer/rules/utils/MockEnforcerExpressionEvaluator.java
b/enforcer-rules/src/test/java/org/apache/maven/enforcer/rules/utils/MockEnforcerExpressionEvaluator.java
index 80f47bfe..9e93e695 100644
---
a/enforcer-rules/src/test/java/org/apache/maven/enforcer/rules/utils/MockEnforcerExpressionEvaluator.java
+++
b/enforcer-rules/src/test/java/org/apache/maven/enforcer/rules/utils/MockEnforcerExpressionEvaluator.java
@@ -30,19 +30,19 @@ public class MockEnforcerExpressionEvaluator extends
PluginParameterExpressionEv
/**
* Instantiates a new mock enforcer expression evaluator.
*
- * @param theContext the context
+ * @param context the context
*/
- public MockEnforcerExpressionEvaluator(MavenSession theContext) {
- super(theContext, new MojoExecution(new MojoDescriptor()));
+ public MockEnforcerExpressionEvaluator(MavenSession context) {
+ super(context, new MojoExecution(new MojoDescriptor()));
}
@Override
- public Object evaluate(String expr) {
- if (expr != null) {
+ public Object evaluate(String expression) {
+ if (expression != null) {
// just remove the ${ } and return the name as the value
- return expr.replaceAll("\\$\\{|}", "");
+ return expression.replaceAll("\\$\\{|}", "");
} else {
- return expr;
+ return expression;
}
}
}
diff --git
a/maven-enforcer-plugin/src/main/java/org/apache/maven/plugins/enforcer/EnforceMojo.java
b/maven-enforcer-plugin/src/main/java/org/apache/maven/plugins/enforcer/EnforceMojo.java
index 4f2eb796..78be5fd2 100644
---
a/maven-enforcer-plugin/src/main/java/org/apache/maven/plugins/enforcer/EnforceMojo.java
+++
b/maven-enforcer-plugin/src/main/java/org/apache/maven/plugins/enforcer/EnforceMojo.java
@@ -444,17 +444,17 @@ public class EnforceMojo extends AbstractMojo {
}
/**
- * @param theFail the fail to set
+ * @param fail whether to fail
*/
- public void setFail(boolean theFail) {
- this.fail = theFail;
+ public void setFail(boolean fail) {
+ this.fail = fail;
}
/**
- * @param theFailFast the failFast to set
+ * @param failFast whether to fail fast
*/
- public void setFailFast(boolean theFailFast) {
- this.failFast = theFailFast;
+ public void setFailFast(boolean failFast) {
+ this.failFast = failFast;
}
private String createRuleMessage(
@@ -492,9 +492,9 @@ public class EnforceMojo extends AbstractMojo {
}
/**
- * @param thefailIfNoRules the failIfNoRules to set
+ * @param failIfNoRules whether to fsail if there are no rules
*/
- public void setFailIfNoRules(boolean thefailIfNoRules) {
- this.failIfNoRules = thefailIfNoRules;
+ public void setFailIfNoRules(boolean failIfNoRules) {
+ this.failIfNoRules = failIfNoRules;
}
}