This is an automated email from the ASF dual-hosted git repository. elharo pushed a commit to branch guice in repository https://gitbox.apache.org/repos/asf/maven-checkstyle-plugin.git
commit 9c23bfb19e82d7057b5d86dda81e2c58d6622b50 Author: Elliotte Rusty Harold <elh...@ibiblio.org> AuthorDate: Thu Nov 21 05:04:39 2024 -0500 Remove unused code --- .../plugins/checkstyle/AbstractCheckstyleReport.java | 15 ++++----------- .../plugins/checkstyle/CheckstyleViolationCheckMojo.java | 3 +-- .../maven/plugins/checkstyle/CheckstyleReportTest.java | 2 -- 3 files changed, 5 insertions(+), 15 deletions(-) diff --git a/src/main/java/org/apache/maven/plugins/checkstyle/AbstractCheckstyleReport.java b/src/main/java/org/apache/maven/plugins/checkstyle/AbstractCheckstyleReport.java index 4ab9e05..d5f01ea 100644 --- a/src/main/java/org/apache/maven/plugins/checkstyle/AbstractCheckstyleReport.java +++ b/src/main/java/org/apache/maven/plugins/checkstyle/AbstractCheckstyleReport.java @@ -58,7 +58,6 @@ import org.codehaus.plexus.i18n.I18N; import org.codehaus.plexus.resource.ResourceManager; import org.codehaus.plexus.resource.loader.FileResourceLoader; import org.codehaus.plexus.util.FileUtils; -import org.codehaus.plexus.util.PathTool; /** * Base abstract class for Checkstyle reports. @@ -461,11 +460,13 @@ public abstract class AbstractCheckstyleReport extends AbstractMavenReport { protected ByteArrayOutputStream stringOutputStream; /** {@inheritDoc} */ + @Override public String getName(Locale locale) { return getI18nString(locale, "name"); } /** {@inheritDoc} */ + @Override public String getDescription(Locale locale) { return getI18nString(locale, "description"); } @@ -479,6 +480,7 @@ public abstract class AbstractCheckstyleReport extends AbstractMavenReport { return i18n.getString("checkstyle-report", locale, "report.checkstyle." + key); } + @Override protected MavenProject getProject() { return project; } @@ -488,6 +490,7 @@ public abstract class AbstractCheckstyleReport extends AbstractMavenReport { } /** {@inheritDoc} */ + @Override public void executeReport(Locale locale) throws MavenReportException { checkDeprecatedParameterUsage(sourceDirectory, "sourceDirectory", "sourceDirectories"); checkDeprecatedParameterUsage(testSourceDirectory, "testSourceDirectory", "testSourceDirectories"); @@ -675,16 +678,6 @@ public abstract class AbstractCheckstyleReport extends AbstractMavenReport { return consoleListener; } - private String determineRelativePath(File location) { - String relativePath = - PathTool.getRelativePath(getReportOutputDirectory().getAbsolutePath(), location.getAbsolutePath()); - if (relativePath == null || relativePath.trim().isEmpty()) { - relativePath = "."; - } - - return relativePath + "/" + location.getName(); - } - protected List<File> getSourceDirectories() { if (sourceDirectories == null) { sourceDirectories = filterBuildTarget(project.getCompileSourceRoots()); diff --git a/src/main/java/org/apache/maven/plugins/checkstyle/CheckstyleViolationCheckMojo.java b/src/main/java/org/apache/maven/plugins/checkstyle/CheckstyleViolationCheckMojo.java index 21a9802..218fc27 100644 --- a/src/main/java/org/apache/maven/plugins/checkstyle/CheckstyleViolationCheckMojo.java +++ b/src/main/java/org/apache/maven/plugins/checkstyle/CheckstyleViolationCheckMojo.java @@ -485,11 +485,10 @@ public class CheckstyleViolationCheckMojo extends AbstractMojo { @Parameter(property = "checkstyle.excludeGeneratedSources", defaultValue = "false") private boolean excludeGeneratedSources; - private AuditListener auditListener; - private File outputXmlFile; /** {@inheritDoc} */ + @Override public void execute() throws MojoExecutionException, MojoFailureException { checkDeprecatedParameterUsage(sourceDirectory, "sourceDirectory", "sourceDirectories"); checkDeprecatedParameterUsage(testSourceDirectory, "testSourceDirectory", "testSourceDirectories"); diff --git a/src/test/java/org/apache/maven/plugins/checkstyle/CheckstyleReportTest.java b/src/test/java/org/apache/maven/plugins/checkstyle/CheckstyleReportTest.java index 038839b..a2009aa 100644 --- a/src/test/java/org/apache/maven/plugins/checkstyle/CheckstyleReportTest.java +++ b/src/test/java/org/apache/maven/plugins/checkstyle/CheckstyleReportTest.java @@ -135,8 +135,6 @@ public class CheckstyleReportTest extends AbstractCheckstyleTestCase { assertTrue("Test cache file exists", new File(cacheFile).exists()); } - File outputDir = mojo.getReportOutputDirectory(); - File useFile = (File) getVariableValueFromObject(mojo, "useFile"); if (useFile != null) { assertTrue("Test useFile exists", useFile.exists());