File: 07-fix-xjc-task.patch

package info (click to toggle)
jaxb 2.3.0.1-10.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 19,388 kB
  • sloc: java: 108,759; xml: 16,672; sh: 654; jsp: 384; makefile: 17
file content (35 lines) | stat: -rw-r--r-- 1,549 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
Description: Fix XJC ant task to work without fork
Origin, backport, https://github.com/javaee/jaxb-v2/pull/1170/commits/dad8495f19078cb05302132f83dafda5b3dfa98b
Bug: https://github.com/javaee/jaxb-v2/issues/1144
Bug-Debian: https://bugs.debian.org/882525
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/XJCBase.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/XJCBase.java
@@ -667,13 +667,15 @@
             return;
         }
 
-        boolean ok = false;
         try {
             if (getFork()) {
                 setupCommand();
                 setupForkCommand("com.sun.tools.xjc.XJCFacade");
                 int status = run(getCommandline().getCommandline());
-                ok = (status == 0);
+                if (status != 0) {
+                    log("Command invoked: " + "xjc" + getCommandline().toString());
+                    throw new BuildException("xjc" + " failed", getLocation());
+                }
             } else {
                 if (getCommandline().getVmCommand().size() > 1) {
                     log("JVM args ignored when same JVM is used.", Project.MSG_WARN);
@@ -726,10 +728,6 @@
                     }
                 }
             }
-            if (!ok) {
-                log("Command invoked: " + "xjc" + getCommandline().toString());
-                throw new BuildException("xjc" + " failed", getLocation());
-            }
         } catch (BuildException e) {
             log("failure in the XJC task. Use the Ant -verbose switch for more details");
             if (failonerror)