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

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

commit bad86227ecc0120c507b8f8935bfede6e2491b14
Author: Elliotte Rusty Harold <elh...@ibiblio.org>
AuthorDate: Tue Dec 10 08:14:29 2024 -0500

    Small clarification to test CI
---
 .../plugins/jdeprscan/AbstractJDeprScanMojo.java   | 33 +++++++++++-----------
 1 file changed, 17 insertions(+), 16 deletions(-)

diff --git 
a/src/main/java/org/apache/maven/plugins/jdeprscan/AbstractJDeprScanMojo.java 
b/src/main/java/org/apache/maven/plugins/jdeprscan/AbstractJDeprScanMojo.java
index 9225e0b..df14142 100644
--- 
a/src/main/java/org/apache/maven/plugins/jdeprscan/AbstractJDeprScanMojo.java
+++ 
b/src/main/java/org/apache/maven/plugins/jdeprscan/AbstractJDeprScanMojo.java
@@ -56,23 +56,22 @@ public abstract class AbstractJDeprScanMojo extends 
AbstractMojo {
 
     @Override
     public void execute() throws MojoExecutionException, MojoFailureException {
-        String jExecutable;
         try {
-            jExecutable = getJDeprScanExecutable();
-        } catch (IOException e) {
-            throw new MojoFailureException("Unable to find jdeprscan command: 
" + e.getMessage(), e);
-        }
+            String jExecutable = getJDeprScanExecutable();
 
-        // Synopsis
-        // jdeprscan [options] {dir|jar|class} ...
-        Commandline cmd = new Commandline();
-        cmd.setExecutable(jExecutable);
+            // Synopsis
+            // jdeprscan [options] {dir|jar|class} ...
+            Commandline cmd = new Commandline();
+            cmd.setExecutable(jExecutable);
 
-        addJDeprScanOptions(cmd);
+            addJDeprScanOptions(cmd);
 
-        executeJDeprScanCommandLine(cmd, getConsumer());
+            executeJDeprScanCommandLine(cmd, getConsumer());
 
-        verify();
+            verify();
+        } catch (IOException e) {
+            throw new MojoFailureException("Unable to find jdeprscan command: 
" + e.getMessage(), e);
+        }
     }
 
     protected CommandLineUtils.StringStreamConsumer getConsumer() {
@@ -168,11 +167,13 @@ public abstract class AbstractJDeprScanMojo extends 
AbstractMojo {
         try {
             int exitCode = CommandLineUtils.executeCommandLine(cmd, out, err);
 
-            String output = (StringUtils.isEmpty(out.getOutput())
-                    ? null
-                    : '\n' + out.getOutput().trim());
+            String output = out.getOutput();
+            if (output != null) {
+                output = '\n' + out.getOutput().trim();
+            }
+            // at this point output is null or non-empty
 
-            if (StringUtils.isNotEmpty(output)) {
+            if (output != null) {
                 getLog().info(output);
             }
 

Reply via email to