1.1 --- a/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/Options.java Thu Sep 26 10:43:28 2013 -0700 1.2 +++ b/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/Options.java Fri Oct 04 16:21:34 2013 +0100 1.3 @@ -87,6 +87,13 @@ 1.4 1.5 public String classpath = System.getProperty("java.class.path"); 1.6 1.7 + /** 1.8 + * -javacOptions 1.9 + * 1.10 + * @since 2.2.9 1.11 + */ 1.12 + public List<String> javacOptions; 1.13 + 1.14 1.15 /** 1.16 * -Xnocompile 1.17 @@ -94,10 +101,13 @@ 1.18 public boolean nocompile; 1.19 1.20 /** 1.21 - * Disable secure xml processing. 1.22 - * -XdisableSecureXmlProcessing 1.23 + * If true XML security features when parsing XML documents will be disabled. 1.24 + * The default value is false. 1.25 + * 1.26 + * Boolean 1.27 + * @since 2.2.9 1.28 */ 1.29 - public boolean disableSecureXmlProcessing = false; 1.30 + public boolean disableXmlSecurity; 1.31 1.32 public enum Target { 1.33 V2_0, V2_1, V2_2; 1.34 @@ -354,13 +364,24 @@ 1.35 throw new BadCommandLineException(WscompileMessages.WSCOMPILE_UNSUPPORTED_ENCODING(encoding)); 1.36 } 1.37 return 2; 1.38 - } else if (args[i].equals("-XdisableSecureXmlProcessing")) { 1.39 - disableSecureXmlProcessing= true; 1.40 + } else if (args[i].equals("-disableXmlSecurity")) { 1.41 + disableXmlSecurity(); 1.42 + return 1; 1.43 + } else if (args[i].startsWith("-J")) { 1.44 + if (javacOptions == null) { 1.45 + javacOptions = new ArrayList<String>(); 1.46 + } 1.47 + javacOptions.add(args[i].substring(2)); 1.48 return 1; 1.49 } 1.50 return 0; 1.51 } 1.52 1.53 + // protected method to allow overriding 1.54 + protected void disableXmlSecurity() { 1.55 + disableXmlSecurity= true; 1.56 + } 1.57 + 1.58 /** 1.59 * Obtains an operand and reports an error if it's not there. 1.60 */ 1.61 @@ -372,7 +393,28 @@ 1.62 return args[i]; 1.63 } 1.64 1.65 - 1.66 + List<String> getJavacOptions(List<String> existingOptions, WsimportListener listener) { 1.67 + List<String> result = new ArrayList<String>(); 1.68 + for (String o: javacOptions) { 1.69 + if (o.contains("=") && !o.startsWith("A")) { 1.70 + int i = o.indexOf('='); 1.71 + String key = o.substring(0, i); 1.72 + if (existingOptions.contains(key)) { 1.73 + listener.message(WscompileMessages.WSCOMPILE_EXISTING_OPTION(key)); 1.74 + } else { 1.75 + result.add(key); 1.76 + result.add(o.substring(i + 1)); 1.77 + } 1.78 + } else { 1.79 + if (existingOptions.contains(o)) { 1.80 + listener.message(WscompileMessages.WSCOMPILE_EXISTING_OPTION(o)); 1.81 + } else { 1.82 + result.add(o); 1.83 + } 1.84 + } 1.85 + } 1.86 + return result; 1.87 + } 1.88 1.89 /** 1.90 * Used to signal that we've finished processing.