< prev index next >
jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/wscompile/WsgenTool.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 142,157 ****
* @throws BadCommandLineException
*/
public boolean buildModel(String endpoint, Listener listener) throws BadCommandLineException {
final ErrorReceiverFilter errReceiver = new ErrorReceiverFilter(listener);
! List<String> args = new ArrayList<String>(6 + (options.nocompile ? 1 : 0)
+ (options.encoding != null ? 2 : 0));
- args.add("--add-modules");
- args.add("java.xml.ws");
-
args.add("-d");
args.add(options.destDir.getAbsolutePath());
args.add("-classpath");
args.add(options.classpath);
args.add("-s");
--- 142,154 ----
* @throws BadCommandLineException
*/
public boolean buildModel(String endpoint, Listener listener) throws BadCommandLineException {
final ErrorReceiverFilter errReceiver = new ErrorReceiverFilter(listener);
! List<String> args = new ArrayList<>(6 + (options.nocompile ? 1 : 0)
+ (options.encoding != null ? 2 : 0));
args.add("-d");
args.add(options.destDir.getAbsolutePath());
args.add("-classpath");
args.add(options.classpath);
args.add("-s");
*** 161,172 ****
}
if (options.encoding != null) {
args.add("-encoding");
args.add(options.encoding);
}
if (options.javacOptions != null) {
! args.addAll(options.getJavacOptions(args, listener));
}
JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
if (compiler == null) {
out.println(WscompileMessages.WSCOMPILE_CANT_GET_COMPILER(property("java.home"), property("java.version"), property("java.vendor")));
--- 158,188 ----
}
if (options.encoding != null) {
args.add("-encoding");
args.add(options.encoding);
}
+
+ boolean addModules = true;
if (options.javacOptions != null) {
! List<String> javacOptions = options.getJavacOptions(args, listener);
! for (int i = 0; i < javacOptions.size(); i++) {
! String opt = javacOptions.get(i);
! if ("-source".equals(opt) && 9 >= getVersion(javacOptions.get(i + 1))) {
! addModules = false;
! }
! if ("-target".equals(opt) && 9 >= getVersion(javacOptions.get(i + 1))) {
! addModules = false;
! }
! if ("-release".equals(opt) && 9 >= getVersion(javacOptions.get(i + 1))) {
! addModules = false;
! }
! args.add(opt);
! }
! }
! if (addModules) {
! args.add("--add-modules");
! args.add("java.xml.ws");
}
JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
if (compiler == null) {
out.println(WscompileMessages.WSCOMPILE_CANT_GET_COMPILER(property("java.home"), property("java.version"), property("java.vendor")));
*** 225,235 ****
config.setClassLoader(classLoader);
config.getMappingInfo().setBindingID(bindingID);
com.sun.xml.internal.ws.db.DatabindingImpl rt = (com.sun.xml.internal.ws.db.DatabindingImpl) fac.createRuntime(config);
final File[] wsdlFileName = new File[1]; // used to capture the generated WSDL file.
! final Map<String, File> schemaFiles = new HashMap<String, File>();
WSDLGenInfo wsdlGenInfo = new WSDLGenInfo();
wsdlGenInfo.setSecureXmlProcessingDisabled(disableXmlSecurity);
wsdlGenInfo.setWsdlResolver(
--- 241,251 ----
config.setClassLoader(classLoader);
config.getMappingInfo().setBindingID(bindingID);
com.sun.xml.internal.ws.db.DatabindingImpl rt = (com.sun.xml.internal.ws.db.DatabindingImpl) fac.createRuntime(config);
final File[] wsdlFileName = new File[1]; // used to capture the generated WSDL file.
! final Map<String, File> schemaFiles = new HashMap<>();
WSDLGenInfo wsdlGenInfo = new WSDLGenInfo();
wsdlGenInfo.setSecureXmlProcessingDisabled(disableXmlSecurity);
wsdlGenInfo.setWsdlResolver(
*** 297,307 ****
return "UNKNOWN";
}
}
private List<File> getExternalFiles(List<String> exts) {
! List<File> files = new ArrayList<File>();
for (String ext : exts) {
// first try absolute path ...
File file = new File(ext);
if (!file.exists()) {
// then relative path ...
--- 313,323 ----
return "UNKNOWN";
}
}
private List<File> getExternalFiles(List<String> exts) {
! List<File> files = new ArrayList<>();
for (String ext : exts) {
// first try absolute path ...
File file = new File(ext);
if (!file.exists()) {
// then relative path ...
*** 339,348 ****
--- 355,368 ----
// this is code for the test, so we can be lousy in the error handling
throw new Error(e);
}
}
+ private float getVersion(String s) {
+ return Float.parseFloat(s);
+ }
+
/**
* "Namespace" for code needed to generate the report file.
*/
static class ReportOutput {
@XmlElement("report")
< prev index next >