This is an automated email from the ASF dual-hosted git repository. elharo pushed a commit to branch xml in repository https://gitbox.apache.org/repos/asf/maven-checkstyle-plugin.git
commit 96df0f725dee102fb7fd95f0ad25a40a3def2fbc Author: Elliotte Rusty Harold <[email protected]> AuthorDate: Wed Jan 7 08:37:25 2026 -0500 Remove use of deprecated class --- .../maven/plugins/checkstyle/CheckstyleViolationCheckMojo.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) 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 a86a1f2..82cf830 100644 --- a/src/main/java/org/apache/maven/plugins/checkstyle/CheckstyleViolationCheckMojo.java +++ b/src/main/java/org/apache/maven/plugins/checkstyle/CheckstyleViolationCheckMojo.java @@ -18,17 +18,15 @@ */ package org.apache.maven.plugins.checkstyle; -import java.io.InputStream; import javax.inject.Inject; import javax.inject.Named; -import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; +import java.io.InputStream; import java.io.OutputStream; -import java.io.Reader; import java.nio.file.Files; import java.nio.file.Path; import java.util.ArrayList; @@ -62,7 +60,6 @@ import org.apache.maven.project.MavenProject; import org.codehaus.plexus.configuration.PlexusConfiguration; import org.codehaus.plexus.util.FileUtils; import org.codehaus.plexus.util.PathTool; -import org.codehaus.plexus.util.ReaderFactory; import org.codehaus.plexus.util.xml.pull.MXParser; import org.codehaus.plexus.util.xml.pull.XmlPullParser; import org.codehaus.plexus.util.xml.pull.XmlPullParserException; @@ -582,7 +579,7 @@ public class CheckstyleViolationCheckMojo extends AbstractMojo { try (InputStream in = Files.newInputStream(outputXmlFile.toPath())) { XmlPullParser xpp = new MXParser(); - xpp.se(in); + xpp.setInput(in, null); // null tells the parser to detect the encoding final List<Violation> violationsList = getViolations(xpp); long violationCount = countViolations(violationsList);
