diff -r cc682329886b -r b0610cd08440 src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/Options.java --- a/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/Options.java Thu Sep 26 10:43:28 2013 -0700 +++ b/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/Options.java Fri Oct 04 16:21:34 2013 +0100 @@ -87,6 +87,13 @@ public String classpath = System.getProperty("java.class.path"); + /** + * -javacOptions + * + * @since 2.2.9 + */ + public List javacOptions; + /** * -Xnocompile @@ -94,10 +101,13 @@ public boolean nocompile; /** - * Disable secure xml processing. - * -XdisableSecureXmlProcessing + * If true XML security features when parsing XML documents will be disabled. + * The default value is false. + * + * Boolean + * @since 2.2.9 */ - public boolean disableSecureXmlProcessing = false; + public boolean disableXmlSecurity; public enum Target { V2_0, V2_1, V2_2; @@ -354,13 +364,24 @@ throw new BadCommandLineException(WscompileMessages.WSCOMPILE_UNSUPPORTED_ENCODING(encoding)); } return 2; - } else if (args[i].equals("-XdisableSecureXmlProcessing")) { - disableSecureXmlProcessing= true; + } else if (args[i].equals("-disableXmlSecurity")) { + disableXmlSecurity(); + return 1; + } else if (args[i].startsWith("-J")) { + if (javacOptions == null) { + javacOptions = new ArrayList(); + } + javacOptions.add(args[i].substring(2)); return 1; } return 0; } + // protected method to allow overriding + protected void disableXmlSecurity() { + disableXmlSecurity= true; + } + /** * Obtains an operand and reports an error if it's not there. */ @@ -372,7 +393,28 @@ return args[i]; } - + List getJavacOptions(List existingOptions, WsimportListener listener) { + List result = new ArrayList(); + for (String o: javacOptions) { + if (o.contains("=") && !o.startsWith("A")) { + int i = o.indexOf('='); + String key = o.substring(0, i); + if (existingOptions.contains(key)) { + listener.message(WscompileMessages.WSCOMPILE_EXISTING_OPTION(key)); + } else { + result.add(key); + result.add(o.substring(i + 1)); + } + } else { + if (existingOptions.contains(o)) { + listener.message(WscompileMessages.WSCOMPILE_EXISTING_OPTION(o)); + } else { + result.add(o); + } + } + } + return result; + } /** * Used to signal that we've finished processing.