This is an automated email from the ASF dual-hosted git repository.

elharo pushed a commit to branch redun
in repository https://gitbox.apache.org/repos/asf/maven-pmd-plugin.git

commit 748d3c6710553fd1e00636ecc5934ca32aa946ca
Author: Elliotte Rusty Harold <elh...@ibiblio.org>
AuthorDate: Sun Apr 20 15:55:54 2025 -0400

    remove redundant code
---
 .../java/org/apache/maven/plugins/pmd/ExcludeViolationsFromFile.java    | 2 +-
 src/main/java/org/apache/maven/plugins/pmd/exec/PmdResult.java          | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/src/main/java/org/apache/maven/plugins/pmd/ExcludeViolationsFromFile.java 
b/src/main/java/org/apache/maven/plugins/pmd/ExcludeViolationsFromFile.java
index da5a7db..cdff7a0 100644
--- a/src/main/java/org/apache/maven/plugins/pmd/ExcludeViolationsFromFile.java
+++ b/src/main/java/org/apache/maven/plugins/pmd/ExcludeViolationsFromFile.java
@@ -53,7 +53,7 @@ public class ExcludeViolationsFromFile implements 
ExcludeFromFile<Violation> {
             return;
         }
         final Properties props = new Properties();
-        try (FileInputStream fileInputStream = new FileInputStream(new 
File(excludeFromFailureFile))) {
+        try (FileInputStream fileInputStream = new 
FileInputStream(excludeFromFailureFile)) {
             props.load(fileInputStream);
         } catch (final IOException e) {
             throw new MojoExecutionException("Cannot load properties file " + 
excludeFromFailureFile, e);
diff --git a/src/main/java/org/apache/maven/plugins/pmd/exec/PmdResult.java 
b/src/main/java/org/apache/maven/plugins/pmd/exec/PmdResult.java
index 15cbe58..4cebf0c 100644
--- a/src/main/java/org/apache/maven/plugins/pmd/exec/PmdResult.java
+++ b/src/main/java/org/apache/maven/plugins/pmd/exec/PmdResult.java
@@ -95,7 +95,7 @@ public class PmdResult {
                 return c;
             }
 
-            while (c != -1 && c == BOM) {
+            while (c == BOM) {
                 c = super.read();
             }
             return c;

Reply via email to