You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by lu...@apache.org on 2026/03/13 15:32:19 UTC

(struts) branch main updated: WW-5617 Replace printStackTrace() with System.err in CompileReport (#1606)

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

lukaszlenart pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/struts.git


The following commit(s) were added to refs/heads/main by this push:
     new 47d46f701 WW-5617 Replace printStackTrace() with System.err in CompileReport (#1606)
47d46f701 is described below

commit 47d46f7013328744cc1bd284d79f38d5195e8f78
Author: Senrian <47...@users.noreply.github.com>
AuthorDate: Fri Mar 13 23:32:12 2026 +0800

    WW-5617 Replace printStackTrace() with System.err in CompileReport (#1606)
    
    Replace e.printStackTrace() with System.err.println() to properly
    log errors to stderr without stack trace noise in CLI tools.
    
    Issue: JRException handling in JasperReports compilation
    
    Co-authored-by: Senrian <se...@senrian.com>
---
 .../main/java/org/apache/struts2/views/jasperreports/CompileReport.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/plugins/jasperreports/src/main/java/org/apache/struts2/views/jasperreports/CompileReport.java b/plugins/jasperreports/src/main/java/org/apache/struts2/views/jasperreports/CompileReport.java
index 028d72962..eeb47b4e9 100644
--- a/plugins/jasperreports/src/main/java/org/apache/struts2/views/jasperreports/CompileReport.java
+++ b/plugins/jasperreports/src/main/java/org/apache/struts2/views/jasperreports/CompileReport.java
@@ -39,7 +39,7 @@ public class CompileReport {
                 JasperCompileManager.compileReportToFile(args[i]);
             }
         } catch (JRException e) {
-            e.printStackTrace();
+            System.err.println("Failed to compile JasperReport: " + e.getMessage());
             System.exit(-1);
         }