documentMap) {
-
return new DocumentLocationResolver() {
+ @Override
public String getLocationFor(String namespaceURI, String systemId) {
try {
URL reference = new URL(new URL(baseWsdl),systemId);
@@ -198,7 +206,7 @@
private String sanitize(String fileName) {
fileName = fileName.replace('?', '.');
- StringBuffer sb = new StringBuffer(fileName);
+ StringBuilder sb = new StringBuilder(fileName);
for (int i = 0; i < sb.length(); i++) {
char c = sb.charAt(i);
if (Character.isLetterOrDigit(c) ||
@@ -216,8 +224,11 @@
}
private File getWSDLDownloadDir() {
- File wsdlDir = new File(options.destDir,WSDL_PATH);
- wsdlDir.mkdirs();
+ File wsdlDir = new File(options.destDir, WSDL_PATH);
+ boolean created = wsdlDir.mkdirs();
+ if (options.verbose && !created) {
+ listener.message(WscompileMessages.WSCOMPILE_NO_SUCH_DIRECTORY(wsdlDir));
+ }
return wsdlDir;
}
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/util/WSDLParseException.java 2013-04-04 15:26:29.664612183 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/util/WSDLParseException.java 2013-04-04 15:26:29.620612182 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/util/WSToolsObjectFactoryImpl.java 2013-04-04 15:26:29.932612187 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/util/WSToolsObjectFactoryImpl.java 2013-04-04 15:26:29.876612186 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/util/xml/XmlUtil.java 2013-04-04 15:26:30.176612191 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/util/xml/XmlUtil.java 2013-04-04 15:26:30.120612190 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/version.properties 2013-04-04 15:26:30.420612194 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/version.properties 2013-04-04 15:26:30.364612194 +0200
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2012, 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
@@ -23,8 +23,7 @@
# questions.
#
-build-id=b09
- build-version=JAX-WS RI 2.2.7-b09
- major-version=2.2.7
- svn-revision=12895
- svn-url=https://svn.java.net/svn/jax-ws~sources/branches/jaxws22/jaxws-ri
+build-id=2.2.9-b13941
+build-version=JAX-WS RI 2.2.9-b13941
+major-version=2.2.9
+svn-revision=unknown
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/AbortException.java 2013-04-04 15:26:30.636612198 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/AbortException.java 2013-04-04 15:26:30.588612198 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/AuthInfo.java 2013-04-04 15:26:30.892612202 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/AuthInfo.java 2013-04-04 15:26:30.844612202 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, 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
@@ -28,6 +28,7 @@
import com.sun.istack.internal.NotNull;
import java.net.URL;
+import java.util.regex.Pattern;
/**
* Represents authorization information needed by {@link com.sun.tools.internal.ws.wscompile.DefaultAuthenticator} to
@@ -39,10 +40,11 @@
public final class AuthInfo {
private final String user;
private final String password;
- private final URL url;
+ private final Pattern urlPattern;
- public AuthInfo(@NotNull URL url, @NotNull String user, @NotNull String password){
- this.url = url;
+ public AuthInfo(@NotNull URL url, @NotNull String user, @NotNull String password) {
+ String u = url.toExternalForm().replaceFirst("\\?", "\\\\?");
+ this.urlPattern = Pattern.compile(u.replace("*", ".*"), Pattern.CASE_INSENSITIVE);
this.user = user;
this.password = password;
}
@@ -59,7 +61,7 @@
* Returns if the requesting host and port are associated with this {@link AuthInfo}
*/
public boolean matchingHost(@NotNull URL requestingURL) {
- return requestingURL.equals(url);
+ return urlPattern.matcher(requestingURL.toExternalForm()).matches();
}
}
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/BadCommandLineException.java 2013-04-04 15:26:31.112612205 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/BadCommandLineException.java 2013-04-04 15:26:31.064612204 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, 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
@@ -31,7 +31,7 @@
* @author Vivek Pandey
*/
public class BadCommandLineException extends Exception {
- private Options options;
+ private transient Options options;
public BadCommandLineException(String msg) {
super(msg);
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/ErrorReceiver.java 2013-04-04 15:26:31.332612209 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/ErrorReceiver.java 2013-04-04 15:26:31.280612208 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -44,7 +44,7 @@
*
* However, to make the error handling easy (and make it work
* with visitor patterns nicely),
- * none of the methods on thi class throws {@link org.xml.sax.SAXException}.
+ * none of the methods on this class throws {@link org.xml.sax.SAXException}.
* Instead, when the compilation needs to be aborted,
* it throws {@link AbortException}, which is unchecked.
*
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/ErrorReceiverFilter.java 2013-04-04 15:26:31.576612213 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/ErrorReceiverFilter.java 2013-04-04 15:26:31.516612212 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/FilerCodeWriter.java 2013-04-04 15:26:31.808612217 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/FilerCodeWriter.java 2013-04-04 15:26:31.760612216 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, 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
@@ -51,7 +51,11 @@
public Writer openSource(JPackage pkg, String fileName) throws IOException {
String tmp = fileName.substring(0, fileName.length()-5);
- w = filer.createSourceFile(pkg.name() + "." + tmp).openWriter();
+ if (pkg.name() != null && ! "".equals(pkg.name())) {
+ w = filer.createSourceFile(pkg.name() + "." + tmp).openWriter();
+ } else {
+ w = filer.createSourceFile(tmp).openWriter();
+ }
return w;
}
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/JavaCompilerHelper.java 2013-04-04 15:26:32.052612220 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/JavaCompilerHelper.java 2013-04-04 15:26:31.992612219 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/Options.java 2013-04-04 15:26:32.308612224 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/Options.java 2013-04-04 15:26:32.252612223 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, 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
@@ -36,6 +36,7 @@
import java.net.URLClassLoader;
import java.nio.charset.Charset;
import java.nio.charset.IllegalCharsetNameException;
+import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
@@ -92,6 +93,12 @@
*/
public boolean nocompile;
+ /**
+ * Disable secure xml processing.
+ * -XdisableSecureXmlProcessing
+ */
+ public boolean disableSecureXmlProcessing = false;
+
public enum Target {
V2_0, V2_1, V2_2;
@@ -180,13 +187,6 @@
return compatibilityMode == EXTENSION;
}
- /**
- * Target direcoty when producing files.
- */
- public File targetDir = new File(".");
-
-
-
public boolean debug = false;
/**
@@ -213,7 +213,10 @@
public void removeGeneratedFiles(){
for(File file : generatedFiles){
if (file.getName().endsWith(".java")) {
- file.delete();
+ boolean deleted = file.delete();
+ if (verbose && !deleted) {
+ System.out.println(MessageFormat.format("{0} could not be deleted.", file));
+ }
}
}
generatedFiles.clear();
@@ -235,7 +238,10 @@
synchronized (generatedFiles) {
for (File file : generatedFiles) {
if (file.getName().endsWith(".java")) {
- file.delete();
+ boolean deleted = file.delete();
+ if (verbose && !deleted) {
+ System.out.println(MessageFormat.format("{0} could not be deleted.", file));
+ }
}
}
generatedFiles.clear();
@@ -348,6 +354,9 @@
throw new BadCommandLineException(WscompileMessages.WSCOMPILE_UNSUPPORTED_ENCODING(encoding));
}
return 2;
+ } else if (args[i].equals("-XdisableSecureXmlProcessing")) {
+ disableSecureXmlProcessing= true;
+ return 1;
}
return 0;
}
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/Plugin.java 2013-04-04 15:26:32.548612228 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/Plugin.java 2013-04-04 15:26:32.496612227 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2012, 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
@@ -73,7 +73,7 @@
*
*
Since options can appear in no particular order, WsImport allows
* sub-options of a plugin to show up before the option that activates a
- * plugin (one that's returned by {@link #getOptionName().)
+ * plugin (one that's returned by {@link #getOptionName()}.)
*
* But nevertheless a {@link Plugin} needs to be activated to participate in
* further processing.
@@ -120,14 +120,14 @@
* @param options This object allows access to various options used for code
* generation as well as access to the generated code.
*
- * @param errorHandler Errors should be reported to this handler.
+ * @param errorReceiver Errors should be reported to this handler.
*
* @return If the add-on executes successfully, return true. If it detects
* some errors but those are reported and recovered gracefully, return
* false.
*
- * @throws SAXException After an error is reported to {@link ErrorHandler},
- * the same exception can be thrown to indicate a fatal irrecoverable error. {@link ErrorHandler}
+ * @throws SAXException After an error is reported to {@link ErrorReceiver},
+ * the same exception can be thrown to indicate a fatal irrecoverable error. {@link ErrorReceiver}
* itself may throw it, if it chooses not to recover from the error.
*/
public abstract boolean run(
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/WSCodeWriter.java 2013-04-04 15:26:32.748612231 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/WSCodeWriter.java 2013-04-04 15:26:32.700612230 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/WsgenOptions.java 2013-04-04 15:26:32.984612235 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/WsgenOptions.java 2013-04-04 15:26:32.936612234 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -25,17 +25,22 @@
package com.sun.tools.internal.ws.wscompile;
-import com.sun.tools.internal.ws.resources.WscompileMessages;
import com.sun.tools.internal.ws.api.WsgenExtension;
import com.sun.tools.internal.ws.api.WsgenProtocol;
+import com.sun.tools.internal.ws.resources.WscompileMessages;
import com.sun.xml.internal.ws.api.BindingID;
-import com.sun.xml.internal.ws.util.ServiceFinder;
import com.sun.xml.internal.ws.binding.SOAPBindingImpl;
+import com.sun.xml.internal.ws.util.ServiceFinder;
import javax.jws.WebService;
import javax.xml.namespace.QName;
import java.io.File;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
/**
* @author Vivek Pandey
@@ -90,6 +95,12 @@
*/
public boolean protocolSet = false;
+ /**
+ * -x file1 -x file2 ...
+ * Files to be parsed to get classes' metadata in addition/instead of using annotations and reflection API
+ */
+ public List externalMetadataFiles = new ArrayList();
+
private static final String SERVICENAME_OPTION = "-servicename";
private static final String PORTNAME_OPTION = "-portname";
private static final String HTTP = "http";
@@ -163,6 +174,9 @@
} else if (args[i].equals("-inlineSchemas")) {
inlineSchemas = true;
return 1;
+ } else if ("-x".equals(args[i])) {
+ externalMetadataFiles.add(requireArgument("-x", args, ++i));
+ return 1;
}
return j;
@@ -180,7 +194,6 @@
private boolean isImplClass;
- private boolean noWebServiceEndpoint;
public void validate() throws BadCommandLineException {
if(nonclassDestDir == null)
@@ -233,9 +246,6 @@
if(!isImplClass){
throw new BadCommandLineException(WscompileMessages.WSGEN_CLASS_MUST_BE_IMPLEMENTATION_CLASS(clazz.getName()));
}
- if(noWebServiceEndpoint){
- throw new BadCommandLineException(WscompileMessages.WSGEN_NO_WEBSERVICES_CLASS(clazz.getName()));
- }
endpoint = clazz;
validateBinding();
}
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/WsgenTool.java 2013-04-04 15:26:33.192612238 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/WsgenTool.java 2013-04-04 15:26:33.144612237 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, 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
@@ -25,6 +25,7 @@
package com.sun.tools.internal.ws.wscompile;
+import com.oracle.webservices.internal.api.databinding.WSDLResolver;
import com.sun.istack.internal.tools.ParallelWorldClassLoader;
import com.sun.tools.internal.ws.ToolVersion;
import com.sun.tools.internal.ws.processor.modeler.annotation.WebServiceAp;
@@ -43,9 +44,9 @@
import com.sun.xml.internal.ws.api.server.Container;
import com.sun.xml.internal.ws.api.wsdl.writer.WSDLGeneratorExtension;
import com.sun.xml.internal.ws.binding.WebServiceFeatureList;
+import com.sun.xml.internal.ws.model.ExternalMetadataReader;
import com.sun.xml.internal.ws.model.AbstractSEIModelImpl;
import com.sun.xml.internal.ws.util.ServiceFinder;
-import com.sun.xml.internal.ws.wsdl.writer.WSDLResolver;
import org.xml.sax.SAXParseException;
import javax.tools.DiagnosticCollector;
@@ -71,6 +72,7 @@
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
/**
@@ -86,7 +88,7 @@
public WsgenTool(OutputStream out, Container container) {
- this.out = (out instanceof PrintStream)?(PrintStream)out:new PrintStream(out);
+ this.out = (out instanceof PrintStream) ? (PrintStream) out : new PrintStream(out);
this.container = container;
}
@@ -95,7 +97,7 @@
this(out, null);
}
- public boolean run(String[] args){
+ public boolean run(String[] args) {
final Listener listener = new Listener();
for (String arg : args) {
if (arg.equals("-version")) {
@@ -112,22 +114,22 @@
try {
options.parseArguments(args);
options.validate();
- if(!buildModel(options.endpoint.getName(), listener)){
+ if (!buildModel(options.endpoint.getName(), listener)) {
return false;
}
- }catch (Options.WeAreDone done){
- usage((WsgenOptions)done.getOptions());
- }catch (BadCommandLineException e) {
- if(e.getMessage()!=null) {
+ } catch (Options.WeAreDone done) {
+ usage(done.getOptions());
+ } catch (BadCommandLineException e) {
+ if (e.getMessage() != null) {
System.out.println(e.getMessage());
System.out.println();
}
- usage((WsgenOptions)e.getOptions());
+ usage(e.getOptions());
return false;
- }catch(AbortException e){
+ } catch (AbortException e) {
//error might have been reported
- }finally{
- if(!options.keep){
+ } finally {
+ if (!options.keep) {
options.removeGeneratedFiles();
}
}
@@ -136,21 +138,25 @@
private final Container container;
- private int round = 0;
-
/*
* To take care of JDK6-JDK6u3, where 2.1 API classes are not there
*/
private static boolean useBootClasspath(Class clazz) {
try {
- ParallelWorldClassLoader.toJarUrl(clazz.getResource('/'+clazz.getName().replace('.','/')+".class"));
+ ParallelWorldClassLoader.toJarUrl(clazz.getResource('/' + clazz.getName().replace('.', '/') + ".class"));
return true;
- } catch(Exception e) {
+ } catch (Exception e) {
return false;
}
}
-
+ /**
+ *
+ * @param endpoint
+ * @param listener
+ * @return
+ * @throws BadCommandLineException
+ */
public boolean buildModel(String endpoint, Listener listener) throws BadCommandLineException {
final ErrorReceiverFilter errReceiver = new ErrorReceiverFilter(listener);
@@ -178,7 +184,7 @@
.append(JavaCompilerHelper.getJarFile(XmlSeeAlso.class)).toString());
}
- JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
+ JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();// compiler = JavacTool.create();
DiagnosticCollector diagnostics = new DiagnosticCollector();
StandardJavaFileManager fileManager = compiler.getStandardFileManager(diagnostics, null, null);
JavaCompiler.CompilationTask task = compiler.getTask(
@@ -196,8 +202,15 @@
return false;
}
if (options.genWsdl) {
- DatabindingConfig config = new DatabindingConfig();
- String tmpPath = options.destDir.getAbsolutePath()+ File.pathSeparator+options.classpath;
+ DatabindingConfig config = new DatabindingConfig();
+
+ List externalMetadataFileNames = options.externalMetadataFiles;
+ boolean disableSecureXmlProcessing = options.disableSecureXmlProcessing;
+ if (externalMetadataFileNames != null && externalMetadataFileNames.size() > 0) {
+ config.setMetadataReader(new ExternalMetadataReader(getExternalFiles(externalMetadataFileNames), null, null, true, disableSecureXmlProcessing));
+ }
+
+ String tmpPath = options.destDir.getAbsolutePath() + File.pathSeparator + options.classpath;
ClassLoader classLoader = new URLClassLoader(Options.pathToURLs(tmpPath),
this.getClass().getClassLoader());
Class> endpointClass;
@@ -218,23 +231,26 @@
config.getMappingInfo().setPortName(options.portName);//rtModeler.setPortName(options.portName);
// AbstractSEIModelImpl rtModel = rtModeler.buildRuntimeModel();
- DatabindingFactory fac = DatabindingFactory.newInstance();
- config.setEndpointClass(endpointClass);
- config.getMappingInfo().setServiceName(options.serviceName);
- config.setFeatures(wsfeatures.toArray());
- 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);
+ DatabindingFactory fac = DatabindingFactory.newInstance();
+ config.setEndpointClass(endpointClass);
+ config.getMappingInfo().setServiceName(options.serviceName);
+ config.setFeatures(wsfeatures.toArray());
+ 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 schemaFiles = new HashMap();
+ final Map schemaFiles = new HashMap();
WSDLGenInfo wsdlGenInfo = new WSDLGenInfo();
+ wsdlGenInfo.setSecureXmlProcessingDisabled(disableSecureXmlProcessing);
+
wsdlGenInfo.setWsdlResolver(
new WSDLResolver() {
private File toFile(String suggestedFilename) {
return new File(options.nonclassDestDir, suggestedFilename);
}
+
private Result toResult(File file) {
Result result;
try {
@@ -247,21 +263,27 @@
return result;
}
+ @Override
public Result getWSDL(String suggestedFilename) {
File f = toFile(suggestedFilename);
wsdlFileName[0] = f;
return toResult(f);
}
+
public Result getSchemaOutput(String namespace, String suggestedFilename) {
if (namespace == null)
return null;
File f = toFile(suggestedFilename);
- schemaFiles.put(namespace,f);
+ schemaFiles.put(namespace, f);
return toResult(f);
}
+
+ @Override
public Result getAbstractWSDL(Holder filename) {
return toResult(toFile(filename.value));
}
+
+ @Override
public Result getSchemaOutput(String namespace, Holder filename) {
return getSchemaOutput(namespace, filename.value);
}
@@ -274,20 +296,34 @@
rt.generateWSDL(wsdlGenInfo);
- if(options.wsgenReport!=null)
- generateWsgenReport(endpointClass,(AbstractSEIModelImpl)rt.getModel(),wsdlFileName[0],schemaFiles);
+ if (options.wsgenReport != null)
+ generateWsgenReport(endpointClass, (AbstractSEIModelImpl) rt.getModel(), wsdlFileName[0], schemaFiles);
}
return true;
}
+ private List getExternalFiles(List exts) {
+ List files = new ArrayList();
+ for (String ext : exts) {
+ // first try absolute path ...
+ File file = new File(ext);
+ if (!file.exists()) {
+ // then relative path ...
+ file = new File(options.sourceDir.getAbsolutePath() + File.separator + ext);
+ }
+ files.add(file);
+ }
+ return files;
+ }
+
/**
* Generates a small XML file that captures the key activity of wsgen,
* so that test harness can pick up artifacts.
*/
- private void generateWsgenReport(Class> endpointClass, AbstractSEIModelImpl rtModel, File wsdlFile, Map schemaFiles) {
+ private void generateWsgenReport(Class> endpointClass, AbstractSEIModelImpl rtModel, File wsdlFile, Map schemaFiles) {
try {
ReportOutput.Report report = TXW.create(ReportOutput.Report.class,
- new StreamSerializer(new BufferedOutputStream(new FileOutputStream(options.wsgenReport))));
+ new StreamSerializer(new BufferedOutputStream(new FileOutputStream(options.wsgenReport))));
report.wsdl(wsdlFile.getAbsolutePath());
ReportOutput.writeQName(rtModel.getServiceQName(), report.service());
@@ -296,7 +332,7 @@
report.implClass(endpointClass.getName());
- for (Map.Entry e : schemaFiles.entrySet()) {
+ for (Map.Entry e : schemaFiles.entrySet()) {
ReportOutput.Schema s = report.schema();
s.ns(e.getKey());
s.location(e.getValue().getAbsolutePath());
@@ -317,10 +353,13 @@
interface Report extends TypedXmlWriter {
@XmlElement
void wsdl(String file); // location of WSDL
+
@XmlElement
QualifiedName portType();
+
@XmlElement
QualifiedName service();
+
@XmlElement
QualifiedName port();
@@ -337,6 +376,7 @@
interface QualifiedName extends TypedXmlWriter {
@XmlAttribute
void uri(String ns);
+
@XmlAttribute
void localName(String localName);
}
@@ -344,23 +384,28 @@
interface Schema extends TypedXmlWriter {
@XmlAttribute
void ns(String ns);
+
@XmlAttribute
void location(String filePath);
}
- private static void writeQName( QName n, QualifiedName w ) {
+ private static void writeQName(QName n, QualifiedName w) {
w.uri(n.getNamespaceURI());
w.localName(n.getLocalPart());
}
}
- protected void usage(WsgenOptions options) {
+ protected void usage(Options options) {
// Just don't see any point in passing WsgenOptions
// BadCommandLineException also shouldn't have options
if (options == null)
options = this.options;
- System.out.println(WscompileMessages.WSGEN_HELP("WSGEN", options.protocols, options.nonstdProtocols.keySet()));
- System.out.println(WscompileMessages.WSGEN_USAGE_EXAMPLES());
+ if (options instanceof WsgenOptions) {
+ System.out.println(WscompileMessages.WSGEN_HELP("WSGEN",
+ ((WsgenOptions)options).protocols,
+ ((WsgenOptions)options).nonstdProtocols.keySet()));
+ System.out.println(WscompileMessages.WSGEN_USAGE_EXAMPLES());
+ }
}
class Listener extends WsimportListener {
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/WsimportListener.java 2013-04-04 15:26:33.460612242 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/WsimportListener.java 2013-04-04 15:26:33.404612241 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/WsimportOptions.java 2013-04-04 15:26:33.724612246 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/WsimportOptions.java 2013-04-04 15:26:33.668612245 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, 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
@@ -62,6 +62,8 @@
import java.util.Arrays;
import java.util.List;
import java.util.HashMap;
+import java.util.logging.Level;
+import java.util.logging.Logger;
/**
* @author Vivek Pandey
@@ -139,7 +141,12 @@
/**
* Authentication file
*/
- public File authFile;
+ public File authFile = null;
+
+ //can user.home value be null?
+ public static final String defaultAuthfile
+ = System.getProperty("user.home") + System.getProperty("file.separator")
+ + ".metro" + System.getProperty("file.separator") + "auth";
/**
* Setting disableAuthenticator to true disables the DefaultAuthenticator.
@@ -147,6 +154,10 @@
*/
public boolean disableAuthenticator;
+ public String proxyAuth = null;
+ private String proxyHost = null;
+ private String proxyPort = null;
+
/**
* Additional arguments
*/
@@ -240,6 +251,16 @@
}
}
}
+
+ if (encoding != null && schemaCompiler.getOptions().encoding == null) {
+ try {
+ schemaCompiler.getOptions().parseArgument(
+ new String[] {"-encoding", encoding}, 0);
+ } catch (com.sun.tools.internal.xjc.BadCommandLineException ex) {
+ Logger.getLogger(WsimportOptions.class.getName()).log(Level.SEVERE, null, ex);
+ }
+ }
+
if(destDir == null)
destDir = new File(".");
if(sourceDir == null)
@@ -292,15 +313,15 @@
if (value.length() == 0) {
throw new BadCommandLineException(WscompileMessages.WSCOMPILE_INVALID_OPTION(args[i]));
}
- int index = value.indexOf(':');
- if (index == -1) {
- System.setProperty("proxySet", "true");
- System.setProperty("proxyHost", value);
- System.setProperty("proxyPort", "8080");
- } else {
+ parseProxy(value);
+ if (proxyHost != null || proxyPort != null) {
System.setProperty("proxySet", "true");
- System.setProperty("proxyHost", value.substring(0, index));
- System.setProperty("proxyPort", value.substring(index + 1));
+ }
+ if (proxyHost != null) {
+ System.setProperty("proxyHost", proxyHost);
+ }
+ if (proxyPort != null) {
+ System.setProperty("proxyPort", proxyPort);
}
return 1;
} else if (args[i].equals("-Xno-addressing-databinding")) {
@@ -576,6 +597,37 @@
return extensionOptions.get(argument);
}
+ private void parseProxy(String text) throws BadCommandLineException {
+ int i = text.lastIndexOf('@');
+ int j = text.lastIndexOf(':');
+
+ if (i > 0) {
+ proxyAuth = text.substring(0, i);
+ if (j > i) {
+ proxyHost = text.substring(i + 1, j);
+ proxyPort = text.substring(j + 1);
+ } else {
+ proxyHost = text.substring(i + 1);
+ proxyPort = "8080";
+ }
+ } else {
+ //no auth info
+ if (j < 0) {
+ //no port
+ proxyHost = text;
+ proxyPort = "8080";
+ } else {
+ proxyHost = text.substring(0, j);
+ proxyPort = text.substring(j + 1);
+ }
+ }
+ try {
+ Integer.valueOf(proxyPort);
+ } catch (NumberFormatException e) {
+ throw new BadCommandLineException(WscompileMessages.WSIMPORT_ILLEGAL_PROXY(text));
+ }
+ }
+
/**
* Looks for all "META-INF/services/[className]" files and
* create one instance for each class name found inside this file.
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/WsimportTool.java 2013-04-04 15:26:34.008612251 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/WsimportTool.java 2013-04-04 15:26:33.948612250 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, 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
@@ -27,6 +27,7 @@
import com.sun.codemodel.internal.CodeWriter;
import com.sun.codemodel.internal.writer.ProgressCodeWriter;
+import com.sun.istack.internal.tools.DefaultAuthenticator;
import com.sun.tools.internal.ws.ToolVersion;
import com.sun.tools.internal.ws.api.TJavaGeneratorExtension;
import com.sun.tools.internal.ws.processor.generator.CustomExceptionGenerator;
@@ -55,9 +56,10 @@
import javax.xml.ws.EndpointContext;
import java.io.*;
import java.util.*;
-import java.net.Authenticator;
+import java.text.MessageFormat;
import java.util.jar.JarEntry;
import java.util.jar.JarOutputStream;
+import org.xml.sax.Locator;
import org.xml.sax.SAXException;
/**
@@ -134,11 +136,13 @@
this.listener = listener;
}
+ @Override
public void info(SAXParseException exception) {
if (options.verbose)
super.info(exception);
}
+ @Override
public void warning(SAXParseException exception) {
if (!options.quiet)
super.warning(exception);
@@ -179,13 +183,10 @@
}
}
- Authenticator orig = null;
try {
parseArguments(args, listener, receiver);
try {
- orig = DefaultAuthenticator.getCurrentAuthenticator();
-
Model wsdlModel = buildWsdlModel(listener, receiver);
if (wsdlModel == null)
return false;
@@ -235,7 +236,7 @@
} finally{
deleteGeneratedFiles();
if (!options.disableAuthenticator) {
- Authenticator.setDefault(orig);
+ DefaultAuthenticator.reset();
}
}
if(receiver.hadError()) {
@@ -253,11 +254,12 @@
synchronized (generatedFiles) {
for (File file : generatedFiles) {
if (!file.getName().endsWith(".java")) {
- file.delete();
+ boolean deleted = file.delete();
+ if (options.verbose && !deleted) {
+ System.out.println(MessageFormat.format("{0} could not be deleted.", file));
+ }
trackedRootPackages.add(file.getParentFile());
-
}
-
}
}
//remove empty package dirs
@@ -265,7 +267,10 @@
while(pkg.list() != null && pkg.list().length ==0 && !pkg.equals(options.destDir)) {
File parentPkg = pkg.getParentFile();
- pkg.delete();
+ boolean deleted = pkg.delete();
+ if (options.verbose && !deleted) {
+ System.out.println(MessageFormat.format("{0} could not be deleted.", pkg));
+ }
pkg = parentPkg;
}
}
@@ -273,7 +278,6 @@
if(!options.keep) {
options.removeGeneratedFiles();
}
-
}
private void addClassesToGeneratedFiles() throws IOException {
@@ -286,7 +290,7 @@
File classDir = new File(options.destDir,relativeDir);
if(classDir.exists()) {
classDir.listFiles(new FilenameFilter() {
-
+ @Override
public boolean accept(File dir, String name) {
if(name.equals(className+".class") || (name.startsWith(className+"$") && name.endsWith(".class"))) {
trackedClassFiles.add(new File(dir,name));
@@ -309,42 +313,50 @@
zipFile = new File(options.destDir, options.clientjar);
}
- if (zipFile.exists()) {
- //TODO
- }
- FileOutputStream fos = null;
- if( !options.quiet )
+ FileOutputStream fos;
+ if (!options.quiet) {
listener.message(WscompileMessages.WSIMPORT_ARCHIVING_ARTIFACTS(zipFile));
+ }
-
+ BufferedInputStream bis = null;
+ FileInputStream fi = null;
fos = new FileOutputStream(zipFile);
JarOutputStream jos = new JarOutputStream(fos);
-
- String base = options.destDir.getCanonicalPath();
- for(File f: options.getGeneratedFiles()) {
- //exclude packaging the java files in the jar
- if(f.getName().endsWith(".java")) {
- continue;
- }
- if(options.verbose) {
- listener.message(WscompileMessages.WSIMPORT_ARCHIVE_ARTIFACT(f, options.clientjar));
+ try {
+ String base = options.destDir.getCanonicalPath();
+ for(File f: options.getGeneratedFiles()) {
+ //exclude packaging the java files in the jar
+ if(f.getName().endsWith(".java")) {
+ continue;
+ }
+ if(options.verbose) {
+ listener.message(WscompileMessages.WSIMPORT_ARCHIVE_ARTIFACT(f, options.clientjar));
+ }
+ String entry = f.getCanonicalPath().substring(base.length()+1);
+ fi = new FileInputStream(f);
+ bis = new BufferedInputStream(fi);
+ JarEntry jarEntry = new JarEntry(entry);
+ jos.putNextEntry(jarEntry);
+ int bytesRead;
+ byte[] buffer = new byte[1024];
+ while ((bytesRead = bis.read(buffer)) != -1) {
+ jos.write(buffer, 0, bytesRead);
+ }
}
- String entry = f.getCanonicalPath().substring(base.length()+1);
- BufferedInputStream bis = new BufferedInputStream(
- new FileInputStream(f));
- JarEntry jarEntry = new JarEntry(entry);
- jos.putNextEntry(jarEntry);
- int bytesRead;
- byte[] buffer = new byte[1024];
- while ((bytesRead = bis.read(buffer)) != -1) {
- jos.write(buffer, 0, bytesRead);
+ } finally {
+ try {
+ if (bis != null) {
+ bis.close();
+ }
+ } finally {
+ if (jos != null) {
+ jos.close();
+ }
+ if (fi != null) {
+ fi.close();
+ }
}
- bis.close();
-
}
-
- jos.close();
-
}
protected void parseArguments(String[] args, Listener listener,
@@ -356,15 +368,56 @@
options.parseBindings(receiver);
}
- protected Model buildWsdlModel(Listener listener,
- Receiver receiver) throws BadCommandLineException, XMLStreamException, IOException {
- if( !options.quiet )
- listener.message(WscompileMessages.WSIMPORT_PARSING_WSDL());
-
+ protected Model buildWsdlModel(Listener listener, final Receiver receiver)
+ throws BadCommandLineException, XMLStreamException, IOException {
//set auth info
//if(options.authFile != null)
if (!options.disableAuthenticator) {
- Authenticator.setDefault(new DefaultAuthenticator(receiver, options.authFile));
+ class AuthListener implements DefaultAuthenticator.Receiver {
+
+ private final boolean isFatal;
+
+ AuthListener(boolean isFatal) {
+ this.isFatal = isFatal;
+ }
+
+ @Override
+ public void onParsingError(String text, Locator loc) {
+ error(new SAXParseException(WscompileMessages.WSIMPORT_ILLEGAL_AUTH_INFO(text), loc));
+ }
+
+ @Override
+ public void onError(Exception e, Locator loc) {
+ if (e instanceof FileNotFoundException) {
+ error(new SAXParseException(WscompileMessages.WSIMPORT_AUTH_FILE_NOT_FOUND(
+ loc.getSystemId(), WsimportOptions.defaultAuthfile), null));
+ } else {
+ error(new SAXParseException(WscompileMessages.WSIMPORT_FAILED_TO_PARSE(loc.getSystemId(),e.getMessage()), loc));
+ }
+ }
+
+ private void error(SAXParseException e) {
+ if (isFatal) {
+ receiver.error(e);
+ } else {
+ receiver.debug(e);
+ }
+ }
+ }
+
+ DefaultAuthenticator da = DefaultAuthenticator.getAuthenticator();
+ if (options.proxyAuth != null) {
+ da.setProxyAuth(options.proxyAuth);
+ }
+ if (options.authFile != null) {
+ da.setAuth(options.authFile, new AuthListener(true));
+ } else {
+ da.setAuth(new File(WsimportOptions.defaultAuthfile), new AuthListener(false));
+ }
+ }
+
+ if (!options.quiet) {
+ listener.message(WscompileMessages.WSIMPORT_PARSING_WSDL());
}
MetadataFinder forest = new MetadataFinder(new WSDLInternalizationLogic(), options, receiver);
@@ -498,7 +551,7 @@
listener.message(WscompileMessages.WSIMPORT_COMPILING_CODE());
if(options.verbose){
- StringBuffer argstr = new StringBuffer();
+ StringBuilder argstr = new StringBuilder();
for(String arg:args){
argstr.append(arg).append(" ");
}
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/plugin/at_generated/PluginImpl.java 2013-04-04 15:26:34.252612255 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wscompile/plugin/at_generated/PluginImpl.java 2013-04-04 15:26:34.196612253 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/Binding.java 2013-04-04 15:26:34.520612259 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/Binding.java 2013-04-04 15:26:34.472612258 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/BindingFault.java 2013-04-04 15:26:34.780612263 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/BindingFault.java 2013-04-04 15:26:34.724612261 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/BindingInput.java 2013-04-04 15:26:35.016612266 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/BindingInput.java 2013-04-04 15:26:34.968612265 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/BindingOperation.java 2013-04-04 15:26:35.272612270 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/BindingOperation.java 2013-04-04 15:26:35.220612269 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, 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
@@ -59,7 +59,7 @@
public String getUniqueKey() {
if (_uniqueKey == null) {
- StringBuffer sb = new StringBuffer();
+ StringBuilder sb = new StringBuilder();
sb.append(_name);
sb.append(' ');
if (_input != null) {
@@ -121,6 +121,7 @@
return _faults;
}
+ @Override
public QName getElementName() {
return WSDLConstants.QNAME_OPERATION;
}
@@ -133,30 +134,37 @@
_documentation = d;
}
+ @Override
public String getNameValue() {
return getName();
}
+ @Override
public String getNamespaceURI() {
- return parent.getNamespaceURI();
+ return (parent == null) ? null : parent.getNamespaceURI();
}
+ @Override
public QName getWSDLElementName() {
return getElementName();
}
+ @Override
public void addExtension(TWSDLExtension e) {
_helper.addExtension(e);
}
+ @Override
public Iterable extensions() {
return _helper.extensions();
}
+ @Override
public TWSDLExtensible getParent() {
return parent;
}
+ @Override
public void withAllSubEntitiesDo(EntityAction action) {
if (_input != null) {
action.perform(_input);
@@ -186,6 +194,7 @@
visitor.postVisit(this);
}
+ @Override
public void validateThis() {
if (_name == null) {
failValidation("validation.missingRequiredAttribute", "name");
@@ -202,7 +211,7 @@
if (_output != null) {
failValidation("validation.invalidSubEntity", "output");
}
- if (_faults != null && _faults.size() != 0) {
+ if (_faults != null && !_faults.isEmpty()) {
failValidation("validation.invalidSubEntity", "fault");
}
}
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/BindingOutput.java 2013-04-04 15:26:35.532612275 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/BindingOutput.java 2013-04-04 15:26:35.484612274 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/Definitions.java 2013-04-04 15:26:35.748612277 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/Definitions.java 2013-04-04 15:26:35.696612277 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -28,6 +28,7 @@
import com.sun.tools.internal.ws.api.wsdl.TWSDLExtensible;
import com.sun.tools.internal.ws.api.wsdl.TWSDLExtension;
import com.sun.tools.internal.ws.wsdl.framework.*;
+
import org.xml.sax.Locator;
import javax.xml.namespace.QName;
@@ -213,6 +214,10 @@
public void validateThis() {
}
+ public Map resolveBindings() {
+ return _document.getMap(Kinds.BINDING);
+ }
+
private AbstractDocument _document;
private ExtensibilityHelper _helper;
private Documentation _documentation;
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/Documentation.java 2013-04-04 15:26:35.984612282 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/Documentation.java 2013-04-04 15:26:35.936612281 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/Fault.java 2013-04-04 15:26:36.220612285 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/Fault.java 2013-04-04 15:26:36.164612284 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, 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
@@ -64,6 +64,7 @@
return (Message) document.find(Kinds.MESSAGE, _message);
}
+ @Override
public QName getElementName() {
return WSDLConstants.QNAME_FAULT;
}
@@ -76,12 +77,14 @@
_documentation = d;
}
+ @Override
public void withAllQNamesDo(QNameAction action) {
if (_message != null) {
action.perform(_message);
}
}
+ @Override
public void withAllEntityReferencesDo(EntityReferenceAction action) {
super.withAllEntityReferencesDo(action);
if (_message != null) {
@@ -94,6 +97,7 @@
visitor.postVisit(this);
}
+ @Override
public void validateThis() {
if (_name == null) {
failValidation("validation.missingRequiredAttribute", "name");
@@ -109,14 +113,17 @@
private String _action;
private ExtensibilityHelper _helper;
+ @Override
public String getNameValue() {
return getName();
}
+ @Override
public String getNamespaceURI() {
- return parent.getNamespaceURI();
+ return (parent == null) ? null : parent.getNamespaceURI();
}
+ @Override
public QName getWSDLElementName() {
return getElementName();
}
@@ -124,6 +131,7 @@
/* (non-Javadoc)
* @see TWSDLExtensible#addExtension(ExtensionImpl)
*/
+ @Override
public void addExtension(TWSDLExtension e) {
_helper.addExtension(e);
@@ -132,10 +140,12 @@
/* (non-Javadoc)
* @see TWSDLExtensible#extensions()
*/
+ @Override
public Iterable extensions() {
return _helper.extensions();
}
+ @Override
public TWSDLExtensible getParent() {
return parent;
}
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/Import.java 2013-04-04 15:26:36.456612288 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/Import.java 2013-04-04 15:26:36.404612288 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/Input.java 2013-04-04 15:26:36.712612292 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/Input.java 2013-04-04 15:26:36.660612292 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/Kinds.java 2013-04-04 15:26:36.956612296 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/Kinds.java 2013-04-04 15:26:36.904612296 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/Message.java 2013-04-04 15:26:37.180612300 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/Message.java 2013-04-04 15:26:37.128612299 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/MessagePart.java 2013-04-04 15:26:37.396612304 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/MessagePart.java 2013-04-04 15:26:37.344612302 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/Operation.java 2013-04-04 15:26:37.612612306 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/Operation.java 2013-04-04 15:26:37.564612306 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/OperationStyle.java 2013-04-04 15:26:37.852612310 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/OperationStyle.java 2013-04-04 15:26:37.796612310 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/Output.java 2013-04-04 15:26:38.148612315 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/Output.java 2013-04-04 15:26:38.088612314 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/Port.java 2013-04-04 15:26:38.412612319 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/Port.java 2013-04-04 15:26:38.368612318 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/PortType.java 2013-04-04 15:26:38.652612323 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/PortType.java 2013-04-04 15:26:38.600612322 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/Service.java 2013-04-04 15:26:38.932612327 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/Service.java 2013-04-04 15:26:38.876612327 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/Types.java 2013-04-04 15:26:39.168612331 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/Types.java 2013-04-04 15:26:39.120612330 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, 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
@@ -47,6 +47,7 @@
_helper = new ExtensibilityHelper();
}
+ @Override
public QName getElementName() {
return WSDLConstants.QNAME_TYPES;
}
@@ -65,32 +66,39 @@
visitor.postVisit(this);
}
+ @Override
public void validateThis() {
}
/**
* wsdl:type does not have any name attribute
*/
+ @Override
public String getNameValue() {
return null;
}
+ @Override
public String getNamespaceURI() {
- return parent.getNamespaceURI();
+ return (parent == null) ? null : parent.getNamespaceURI();
}
+ @Override
public QName getWSDLElementName() {
return getElementName();
}
+ @Override
public void addExtension(TWSDLExtension e) {
_helper.addExtension(e);
}
+ @Override
public Iterable extensions() {
return _helper.extensions();
}
+ @Override
public TWSDLExtensible getParent() {
return parent;
}
@@ -99,6 +107,7 @@
this.parent = parent;
}
+ @Override
public void withAllSubEntitiesDo(EntityAction action) {
_helper.withAllSubEntitiesDo(action);
}
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/WSDLConstants.java 2013-04-04 15:26:39.380612334 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/WSDLConstants.java 2013-04-04 15:26:39.328612334 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -35,25 +35,24 @@
public interface WSDLConstants {
// namespace URIs
- public static String NS_XMLNS = "http://www.w3.org/2000/xmlns/";
- public static String NS_WSDL = "http://schemas.xmlsoap.org/wsdl/";
+ static final String NS_XMLNS = "http://www.w3.org/2000/xmlns/";
+ static final String NS_WSDL = "http://schemas.xmlsoap.org/wsdl/";
// QNames
- public static QName QNAME_BINDING = new QName(NS_WSDL, "binding");
- public static QName QNAME_DEFINITIONS = new QName(NS_WSDL, "definitions");
- public static QName QNAME_DOCUMENTATION =
- new QName(NS_WSDL, "documentation");
- public static QName QNAME_FAULT = new QName(NS_WSDL, "fault");
- public static QName QNAME_IMPORT = new QName(NS_WSDL, "import");
- public static QName QNAME_INPUT = new QName(NS_WSDL, "input");
- public static QName QNAME_MESSAGE = new QName(NS_WSDL, "message");
- public static QName QNAME_OPERATION = new QName(NS_WSDL, "operation");
- public static QName QNAME_OUTPUT = new QName(NS_WSDL, "output");
- public static QName QNAME_PART = new QName(NS_WSDL, "part");
- public static QName QNAME_PORT = new QName(NS_WSDL, "port");
- public static QName QNAME_PORT_TYPE = new QName(NS_WSDL, "portType");
- public static QName QNAME_SERVICE = new QName(NS_WSDL, "service");
- public static QName QNAME_TYPES = new QName(NS_WSDL, "types");
+ static final QName QNAME_BINDING = new QName(NS_WSDL, "binding");
+ static final QName QNAME_DEFINITIONS = new QName(NS_WSDL, "definitions");
+ static final QName QNAME_DOCUMENTATION = new QName(NS_WSDL, "documentation");
+ static final QName QNAME_FAULT = new QName(NS_WSDL, "fault");
+ static final QName QNAME_IMPORT = new QName(NS_WSDL, "import");
+ static final QName QNAME_INPUT = new QName(NS_WSDL, "input");
+ static final QName QNAME_MESSAGE = new QName(NS_WSDL, "message");
+ static final QName QNAME_OPERATION = new QName(NS_WSDL, "operation");
+ static final QName QNAME_OUTPUT = new QName(NS_WSDL, "output");
+ static final QName QNAME_PART = new QName(NS_WSDL, "part");
+ static final QName QNAME_PORT = new QName(NS_WSDL, "port");
+ static final QName QNAME_PORT_TYPE = new QName(NS_WSDL, "portType");
+ static final QName QNAME_SERVICE = new QName(NS_WSDL, "service");
+ static final QName QNAME_TYPES = new QName(NS_WSDL, "types");
- public static QName QNAME_ATTR_ARRAY_TYPE = new QName(NS_WSDL, "arrayType");
+ static final QName QNAME_ATTR_ARRAY_TYPE = new QName(NS_WSDL, "arrayType");
}
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/WSDLDocument.java 2013-04-04 15:26:39.608612337 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/WSDLDocument.java 2013-04-04 15:26:39.556612337 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, 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
@@ -32,7 +32,6 @@
import javax.xml.namespace.QName;
import java.util.ArrayList;
import java.util.Iterator;
-import java.util.Set;
/**
* A WSDL document.
@@ -110,6 +109,7 @@
_definitions.accept(visitor);
}
+ @Override
public void validate(EntityReferenceValidator validator) {
GloballyValidatingAction action =
new GloballyValidatingAction(this, validator);
@@ -119,14 +119,14 @@
}
}
+ @Override
protected Entity getRoot() {
return _definitions;
}
private Definitions _definitions;
- private class GloballyValidatingAction
- implements EntityAction, EntityReferenceAction {
+ private static class GloballyValidatingAction implements EntityAction, EntityReferenceAction {
public GloballyValidatingAction(
AbstractDocument document,
EntityReferenceValidator validator) {
@@ -134,6 +134,7 @@
_validator = validator;
}
+ @Override
public void perform(Entity entity) {
try {
entity.validateThis();
@@ -146,9 +147,10 @@
}
}
+ @Override
public void perform(Kind kind, QName name) {
try {
- GloballyKnown entity = _document.find(kind, name);
+ _document.find(kind, name);
} catch (NoSuchEntityException e) {
// failed to resolve, check with the validator
if (_exception == null) {
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/WSDLDocumentVisitor.java 2013-04-04 15:26:39.832612341 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/WSDLDocumentVisitor.java 2013-04-04 15:26:39.780612340 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/WSDLDocumentVisitorBase.java 2013-04-04 15:26:40.076612345 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/WSDLDocumentVisitorBase.java 2013-04-04 15:26:40.020612344 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/http/HTTPAddress.java 2013-04-04 15:26:40.324612349 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/http/HTTPAddress.java 2013-04-04 15:26:40.268612348 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/http/HTTPBinding.java 2013-04-04 15:26:40.576612353 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/http/HTTPBinding.java 2013-04-04 15:26:40.524612352 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/http/HTTPConstants.java 2013-04-04 15:26:40.812612356 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/http/HTTPConstants.java 2013-04-04 15:26:40.760612355 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -35,14 +35,12 @@
public interface HTTPConstants {
// namespace URIs
- public static String NS_WSDL_HTTP = "http://schemas.xmlsoap.org/wsdl/http/";
+ static final String NS_WSDL_HTTP = "http://schemas.xmlsoap.org/wsdl/http/";
// QNames
- public static QName QNAME_ADDRESS = new QName(NS_WSDL_HTTP, "address");
- public static QName QNAME_BINDING = new QName(NS_WSDL_HTTP, "binding");
- public static QName QNAME_OPERATION = new QName(NS_WSDL_HTTP, "operation");
- public static QName QNAME_URL_ENCODED =
- new QName(NS_WSDL_HTTP, "urlEncoded");
- public static QName QNAME_URL_REPLACEMENT =
- new QName(NS_WSDL_HTTP, "urlReplacement");
+ static final QName QNAME_ADDRESS = new QName(NS_WSDL_HTTP, "address");
+ static final QName QNAME_BINDING = new QName(NS_WSDL_HTTP, "binding");
+ static final QName QNAME_OPERATION = new QName(NS_WSDL_HTTP, "operation");
+ static final QName QNAME_URL_ENCODED = new QName(NS_WSDL_HTTP, "urlEncoded");
+ static final QName QNAME_URL_REPLACEMENT = new QName(NS_WSDL_HTTP, "urlReplacement");
}
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/http/HTTPOperation.java 2013-04-04 15:26:41.012612360 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/http/HTTPOperation.java 2013-04-04 15:26:40.964612359 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/http/HTTPUrlEncoded.java 2013-04-04 15:26:41.272612364 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/http/HTTPUrlEncoded.java 2013-04-04 15:26:41.204612363 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/http/HTTPUrlReplacement.java 2013-04-04 15:26:41.528612368 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/http/HTTPUrlReplacement.java 2013-04-04 15:26:41.476612367 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/jaxws/CustomName.java 2013-04-04 15:26:41.772612371 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/jaxws/CustomName.java 2013-04-04 15:26:41.716612371 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/jaxws/Exception.java 2013-04-04 15:26:42.016612375 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/jaxws/Exception.java 2013-04-04 15:26:41.964612374 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/jaxws/JAXWSBinding.java 2013-04-04 15:26:42.248612379 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/jaxws/JAXWSBinding.java 2013-04-04 15:26:42.196612378 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -291,19 +291,6 @@
this.className = className;
}
- /**
- * @return Returns the exception.
- */
- public Exception getException() {
- return exception;
- }
- /**
- * @param exception The exception to set.
- */
- public void setException(Exception exception) {
- this.exception = exception;
- }
-
private String wsdlNamespace;
private String wsdlLocation;
private String node;
@@ -316,7 +303,6 @@
// private Boolean enableAdditionalHeaderMapping;
private Boolean enableMimeContentMapping;
private Boolean isProvider;
- private Exception exception;
private Set jaxbBindings;
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/jaxws/JAXWSBindingsConstants.java 2013-04-04 15:26:42.464612382 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/jaxws/JAXWSBindingsConstants.java 2013-04-04 15:26:42.412612382 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -35,9 +35,9 @@
*/
public interface JAXWSBindingsConstants {
- public static String NS_JAXWS_BINDINGS = "http://java.sun.com/xml/ns/jaxws";
- public static String NS_JAXB_BINDINGS = "http://java.sun.com/xml/ns/jaxb";
- public static String NS_XJC_BINDINGS = "http://java.sun.com/xml/ns/jaxb/xjc";
+ static final String NS_JAXWS_BINDINGS = "http://java.sun.com/xml/ns/jaxws";
+ static final String NS_JAXB_BINDINGS = "http://java.sun.com/xml/ns/jaxb";
+ static final String NS_XJC_BINDINGS = "http://java.sun.com/xml/ns/jaxb/xjc";
/**
* jaxws:bindings schema component
@@ -62,44 +62,44 @@
* elements that don't have any jaxws:bindings ancestors (i.e. on
* outermost binding declarations).
*/
- public static QName JAXWS_BINDINGS = new QName(NS_JAXWS_BINDINGS, "bindings");
- public static String WSDL_LOCATION_ATTR = "wsdlLocation";
- public static String NODE_ATTR = "node";
- public static String VERSION_ATTR = "version";
+ static final QName JAXWS_BINDINGS = new QName(NS_JAXWS_BINDINGS, "bindings");
+ static final String WSDL_LOCATION_ATTR = "wsdlLocation";
+ static final String NODE_ATTR = "node";
+ static final String VERSION_ATTR = "version";
/*
* ? xs:string
*
*/
- public static QName PACKAGE = new QName(NS_JAXWS_BINDINGS, "package");
- public static String NAME_ATTR = "name";
- public static QName JAVADOC = new QName(NS_JAXWS_BINDINGS, "javadoc");
+ static final QName PACKAGE = new QName(NS_JAXWS_BINDINGS, "package");
+ static final String NAME_ATTR = "name";
+ static final QName JAVADOC = new QName(NS_JAXWS_BINDINGS, "javadoc");
/*
* xs:boolean ?
*/
- public static QName ENABLE_WRAPPER_STYLE = new QName(NS_JAXWS_BINDINGS, "enableWrapperStyle");
+ static final QName ENABLE_WRAPPER_STYLE = new QName(NS_JAXWS_BINDINGS, "enableWrapperStyle");
/*
* xs:boolean
* ?
*/
- public static QName ENABLE_ASYNC_MAPPING = new QName(NS_JAXWS_BINDINGS, "enableAsyncMapping");
+ static final QName ENABLE_ASYNC_MAPPING = new QName(NS_JAXWS_BINDINGS, "enableAsyncMapping");
/*
* xs:boolean?
*/
- public static QName ENABLE_ADDITIONAL_SOAPHEADER_MAPPING = new QName(NS_JAXWS_BINDINGS, "enableAdditionalSOAPHeaderMapping");
+ static final QName ENABLE_ADDITIONAL_SOAPHEADER_MAPPING = new QName(NS_JAXWS_BINDINGS, "enableAdditionalSOAPHeaderMapping");
/*
* xs:boolean?
*/
- public static QName ENABLE_MIME_CONTENT = new QName(NS_JAXWS_BINDINGS, "enableMIMEContent");
+ static final QName ENABLE_MIME_CONTENT = new QName(NS_JAXWS_BINDINGS, "enableMIMEContent");
/*
* xs:boolean?
*/
- public static QName PROVIDER = new QName(NS_JAXWS_BINDINGS, "provider");
+ static final QName PROVIDER = new QName(NS_JAXWS_BINDINGS, "provider");
/*
* PortType
@@ -118,7 +118,7 @@
*
*/
- public static QName CLASS = new QName(NS_JAXWS_BINDINGS, "class");
+ static final QName CLASS = new QName(NS_JAXWS_BINDINGS, "class");
/*
* PortType WSDLOperation
@@ -142,10 +142,10 @@
- public static QName METHOD = new QName(NS_JAXWS_BINDINGS, "method");
- public static QName PARAMETER = new QName(NS_JAXWS_BINDINGS, "parameter");
- public static String PART_ATTR = "part";
- public static String ELEMENT_ATTR = "childElementName";
+ static final QName METHOD = new QName(NS_JAXWS_BINDINGS, "method");
+ static final QName PARAMETER = new QName(NS_JAXWS_BINDINGS, "parameter");
+ static final String PART_ATTR = "part";
+ static final String ELEMENT_ATTR = "childElementName";
/*
* Binding
@@ -181,14 +181,14 @@
*
*/
- public static QName EXCEPTION = new QName(NS_JAXWS_BINDINGS, "exception");
+ static final QName EXCEPTION = new QName(NS_JAXWS_BINDINGS, "exception");
/*
* jaxb:bindgs QName
*/
- public static QName JAXB_BINDINGS = new QName(NS_JAXB_BINDINGS, "bindings");
- public static String JAXB_BINDING_VERSION = "2.0";
- public static QName XSD_APPINFO = new QName(Constants.NS_XSD, "appinfo");
- public static QName XSD_ANNOTATION = new QName(Constants.NS_XSD, "annotation");
+ static final QName JAXB_BINDINGS = new QName(NS_JAXB_BINDINGS, "bindings");
+ static final String JAXB_BINDING_VERSION = "2.0";
+ static final QName XSD_APPINFO = new QName(Constants.NS_XSD, "appinfo");
+ static final QName XSD_ANNOTATION = new QName(Constants.NS_XSD, "annotation");
}
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/jaxws/Parameter.java 2013-04-04 15:26:42.720612386 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/jaxws/Parameter.java 2013-04-04 15:26:42.660612385 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/mime/MIMEConstants.java 2013-04-04 15:26:42.932612389 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/mime/MIMEConstants.java 2013-04-04 15:26:42.880612388 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -35,12 +35,11 @@
public interface MIMEConstants {
// namespace URIs
- public static String NS_WSDL_MIME = "http://schemas.xmlsoap.org/wsdl/mime/";
+ static final String NS_WSDL_MIME = "http://schemas.xmlsoap.org/wsdl/mime/";
// QNames
- public static QName QNAME_CONTENT = new QName(NS_WSDL_MIME, "content");
- public static QName QNAME_MULTIPART_RELATED =
- new QName(NS_WSDL_MIME, "multipartRelated");
- public static QName QNAME_PART = new QName(NS_WSDL_MIME, "part");
- public static QName QNAME_MIME_XML = new QName(NS_WSDL_MIME, "mimeXml");
+ static final QName QNAME_CONTENT = new QName(NS_WSDL_MIME, "content");
+ static final QName QNAME_MULTIPART_RELATED = new QName(NS_WSDL_MIME, "multipartRelated");
+ static final QName QNAME_PART = new QName(NS_WSDL_MIME, "part");
+ static final QName QNAME_MIME_XML = new QName(NS_WSDL_MIME, "mimeXml");
}
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/mime/MIMEContent.java 2013-04-04 15:26:43.148612393 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/mime/MIMEContent.java 2013-04-04 15:26:43.092612392 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/mime/MIMEMultipartRelated.java 2013-04-04 15:26:43.364612396 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/mime/MIMEMultipartRelated.java 2013-04-04 15:26:43.312612396 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/mime/MIMEPart.java 2013-04-04 15:26:43.572612399 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/mime/MIMEPart.java 2013-04-04 15:26:43.524612399 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/mime/MIMEXml.java 2013-04-04 15:26:43.788612403 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/mime/MIMEXml.java 2013-04-04 15:26:43.736612402 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/schema/SchemaConstants.java 2013-04-04 15:26:43.996612406 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/schema/SchemaConstants.java 2013-04-04 15:26:43.948612406 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -34,118 +34,103 @@
public interface SchemaConstants {
// namespace URIs
- public static String NS_XMLNS = "http://www.w3.org/2000/xmlns/";
- public static String NS_XSD = "http://www.w3.org/2001/XMLSchema";
- public static String NS_XSI = "http://www.w3.org/2001/XMLSchema-instance";
+ static final String NS_XMLNS = "http://www.w3.org/2000/xmlns/";
+ static final String NS_XSD = "http://www.w3.org/2001/XMLSchema";
+ static final String NS_XSI = "http://www.w3.org/2001/XMLSchema-instance";
// QNames
- public static QName QNAME_ALL = new QName(NS_XSD, "all");
- public static QName QNAME_ANNOTATION = new QName(NS_XSD, "annotation");
- public static QName QNAME_ANY = new QName(NS_XSD, "any");
- public static QName QNAME_ANY_ATTRIBUTE = new QName(NS_XSD, "anyAttribute");
- public static QName QNAME_ATTRIBUTE = new QName(NS_XSD, "attribute");
- public static QName QNAME_ATTRIBUTE_GROUP =
- new QName(NS_XSD, "attributeGroup");
- public static QName QNAME_CHOICE = new QName(NS_XSD, "choice");
- public static QName QNAME_COMPLEX_CONTENT =
- new QName(NS_XSD, "complexContent");
- public static QName QNAME_COMPLEX_TYPE = new QName(NS_XSD, "complexType");
- public static QName QNAME_ELEMENT = new QName(NS_XSD, "element");
- public static QName QNAME_ENUMERATION = new QName(NS_XSD, "enumeration");
- public static QName QNAME_EXTENSION = new QName(NS_XSD, "extension");
- public static QName QNAME_FIELD = new QName(NS_XSD, "field");
- public static QName QNAME_FRACTION_DIGITS =
- new QName(NS_XSD, "fractionDigits");
- public static QName QNAME_GROUP = new QName(NS_XSD, "group");
- public static QName QNAME_IMPORT = new QName(NS_XSD, "import");
- public static QName QNAME_INCLUDE = new QName(NS_XSD, "include");
- public static QName QNAME_KEY = new QName(NS_XSD, "key");
- public static QName QNAME_KEYREF = new QName(NS_XSD, "keyref");
- public static QName QNAME_LENGTH = new QName(NS_XSD, "length");
- public static QName QNAME_LIST = new QName(NS_XSD, "list");
- public static QName QNAME_MAX_EXCLUSIVE = new QName(NS_XSD, "maxExclusive");
- public static QName QNAME_MAX_INCLUSIVE = new QName(NS_XSD, "maxInclusive");
- public static QName QNAME_MAX_LENGTH = new QName(NS_XSD, "maxLength");
- public static QName QNAME_MIN_EXCLUSIVE = new QName(NS_XSD, "minExclusive");
- public static QName QNAME_MIN_INCLUSIVE = new QName(NS_XSD, "minInclusive");
- public static QName QNAME_MIN_LENGTH = new QName(NS_XSD, "minLength");
- public static QName QNAME_NOTATION = new QName(NS_XSD, "notation");
- public static QName QNAME_RESTRICTION = new QName(NS_XSD, "restriction");
- public static QName QNAME_PATTERN = new QName(NS_XSD, "pattern");
- public static QName QNAME_PRECISION = new QName(NS_XSD, "precision");
- public static QName QNAME_REDEFINE = new QName(NS_XSD, "redefine");
- public static QName QNAME_SCALE = new QName(NS_XSD, "scale");
- public static QName QNAME_SCHEMA = new QName(NS_XSD, "schema");
- public static QName QNAME_SELECTOR = new QName(NS_XSD, "selector");
- public static QName QNAME_SEQUENCE = new QName(NS_XSD, "sequence");
- public static QName QNAME_SIMPLE_CONTENT =
+ static final QName QNAME_ALL = new QName(NS_XSD, "all");
+ static final QName QNAME_ANNOTATION = new QName(NS_XSD, "annotation");
+ static final QName QNAME_ANY = new QName(NS_XSD, "any");
+ static final QName QNAME_ANY_ATTRIBUTE = new QName(NS_XSD, "anyAttribute");
+ static final QName QNAME_ATTRIBUTE = new QName(NS_XSD, "attribute");
+ static final QName QNAME_ATTRIBUTE_GROUP = new QName(NS_XSD, "attributeGroup");
+ static final QName QNAME_CHOICE = new QName(NS_XSD, "choice");
+ static final QName QNAME_COMPLEX_CONTENT = new QName(NS_XSD, "complexContent");
+ static final QName QNAME_COMPLEX_TYPE = new QName(NS_XSD, "complexType");
+ static final QName QNAME_ELEMENT = new QName(NS_XSD, "element");
+ static final QName QNAME_ENUMERATION = new QName(NS_XSD, "enumeration");
+ static final QName QNAME_EXTENSION = new QName(NS_XSD, "extension");
+ static final QName QNAME_FIELD = new QName(NS_XSD, "field");
+ static final QName QNAME_FRACTION_DIGITS = new QName(NS_XSD, "fractionDigits");
+ static final QName QNAME_GROUP = new QName(NS_XSD, "group");
+ static final QName QNAME_IMPORT = new QName(NS_XSD, "import");
+ static final QName QNAME_INCLUDE = new QName(NS_XSD, "include");
+ static final QName QNAME_KEY = new QName(NS_XSD, "key");
+ static final QName QNAME_KEYREF = new QName(NS_XSD, "keyref");
+ static final QName QNAME_LENGTH = new QName(NS_XSD, "length");
+ static final QName QNAME_LIST = new QName(NS_XSD, "list");
+ static final QName QNAME_MAX_EXCLUSIVE = new QName(NS_XSD, "maxExclusive");
+ static final QName QNAME_MAX_INCLUSIVE = new QName(NS_XSD, "maxInclusive");
+ static final QName QNAME_MAX_LENGTH = new QName(NS_XSD, "maxLength");
+ static final QName QNAME_MIN_EXCLUSIVE = new QName(NS_XSD, "minExclusive");
+ static final QName QNAME_MIN_INCLUSIVE = new QName(NS_XSD, "minInclusive");
+ static final QName QNAME_MIN_LENGTH = new QName(NS_XSD, "minLength");
+ static final QName QNAME_NOTATION = new QName(NS_XSD, "notation");
+ static final QName QNAME_RESTRICTION = new QName(NS_XSD, "restriction");
+ static final QName QNAME_PATTERN = new QName(NS_XSD, "pattern");
+ static final QName QNAME_PRECISION = new QName(NS_XSD, "precision");
+ static final QName QNAME_REDEFINE = new QName(NS_XSD, "redefine");
+ static final QName QNAME_SCALE = new QName(NS_XSD, "scale");
+ static final QName QNAME_SCHEMA = new QName(NS_XSD, "schema");
+ static final QName QNAME_SELECTOR = new QName(NS_XSD, "selector");
+ static final QName QNAME_SEQUENCE = new QName(NS_XSD, "sequence");
+ static final QName QNAME_SIMPLE_CONTENT =
new QName(NS_XSD, "simpleContent");
- public static QName QNAME_SIMPLE_TYPE = new QName(NS_XSD, "simpleType");
- public static QName QNAME_TOTAL_DIGITS = new QName(NS_XSD, "totalDigits");
- public static QName QNAME_UNIQUE = new QName(NS_XSD, "unique");
- public static QName QNAME_UNION = new QName(NS_XSD, "union");
- public static QName QNAME_WHITE_SPACE = new QName(NS_XSD, "whiteSpace");
+ static final QName QNAME_SIMPLE_TYPE = new QName(NS_XSD, "simpleType");
+ static final QName QNAME_TOTAL_DIGITS = new QName(NS_XSD, "totalDigits");
+ static final QName QNAME_UNIQUE = new QName(NS_XSD, "unique");
+ static final QName QNAME_UNION = new QName(NS_XSD, "union");
+ static final QName QNAME_WHITE_SPACE = new QName(NS_XSD, "whiteSpace");
// QNames for built-in XSD types
- public static QName QNAME_TYPE_STRING = new QName(NS_XSD, "string");
- public static QName QNAME_TYPE_NORMALIZED_STRING =
- new QName(NS_XSD, "normalizedString");
- public static QName QNAME_TYPE_TOKEN = new QName(NS_XSD, "token");
- public static QName QNAME_TYPE_BYTE = new QName(NS_XSD, "byte");
- public static QName QNAME_TYPE_UNSIGNED_BYTE =
- new QName(NS_XSD, "unsignedByte");
- public static QName QNAME_TYPE_BASE64_BINARY =
- new QName(NS_XSD, "base64Binary");
- public static QName QNAME_TYPE_HEX_BINARY = new QName(NS_XSD, "hexBinary");
- public static QName QNAME_TYPE_INTEGER = new QName(NS_XSD, "integer");
- public static QName QNAME_TYPE_POSITIVE_INTEGER =
- new QName(NS_XSD, "positiveInteger");
- public static QName QNAME_TYPE_NEGATIVE_INTEGER =
- new QName(NS_XSD, "negativeInteger");
- public static QName QNAME_TYPE_NON_NEGATIVE_INTEGER =
- new QName(NS_XSD, "nonNegativeInteger");
- public static QName QNAME_TYPE_NON_POSITIVE_INTEGER =
- new QName(NS_XSD, "nonPositiveInteger");
- public static QName QNAME_TYPE_INT = new QName(NS_XSD, "int");
- public static QName QNAME_TYPE_UNSIGNED_INT =
- new QName(NS_XSD, "unsignedInt");
- public static QName QNAME_TYPE_LONG = new QName(NS_XSD, "long");
- public static QName QNAME_TYPE_UNSIGNED_LONG =
- new QName(NS_XSD, "unsignedLong");
- public static QName QNAME_TYPE_SHORT = new QName(NS_XSD, "short");
- public static QName QNAME_TYPE_UNSIGNED_SHORT =
- new QName(NS_XSD, "unsignedShort");
- public static QName QNAME_TYPE_DECIMAL = new QName(NS_XSD, "decimal");
- public static QName QNAME_TYPE_FLOAT = new QName(NS_XSD, "float");
- public static QName QNAME_TYPE_DOUBLE = new QName(NS_XSD, "double");
- public static QName QNAME_TYPE_BOOLEAN = new QName(NS_XSD, "boolean");
- public static QName QNAME_TYPE_TIME = new QName(NS_XSD, "time");
- public static QName QNAME_TYPE_DATE_TIME = new QName(NS_XSD, "dateTime");
- public static QName QNAME_TYPE_DURATION = new QName(NS_XSD, "duration");
- public static QName QNAME_TYPE_DATE = new QName(NS_XSD, "date");
- public static QName QNAME_TYPE_G_MONTH = new QName(NS_XSD, "gMonth");
- public static QName QNAME_TYPE_G_YEAR = new QName(NS_XSD, "gYear");
- public static QName QNAME_TYPE_G_YEAR_MONTH =
- new QName(NS_XSD, "gYearMonth");
- public static QName QNAME_TYPE_G_DAY = new QName(NS_XSD, "gDay");
- public static QName QNAME_TYPE_G_MONTH_DAY = new QName(NS_XSD, "gMonthDay");
- public static QName QNAME_TYPE_NAME = new QName(NS_XSD, "Name");
- public static QName QNAME_TYPE_QNAME = new QName(NS_XSD, "QName");
- public static QName QNAME_TYPE_NCNAME = new QName(NS_XSD, "NCName");
- public static QName QNAME_TYPE_ANY_URI = new QName(NS_XSD, "anyURI");
- public static QName QNAME_TYPE_ID = new QName(NS_XSD, "ID");
- public static QName QNAME_TYPE_IDREF = new QName(NS_XSD, "IDREF");
- public static QName QNAME_TYPE_IDREFS = new QName(NS_XSD, "IDREFS");
- public static QName QNAME_TYPE_ENTITY = new QName(NS_XSD, "ENTITY");
- public static QName QNAME_TYPE_ENTITIES = new QName(NS_XSD, "ENTITIES");
- public static QName QNAME_TYPE_NOTATION = new QName(NS_XSD, "NOTATION");
- public static QName QNAME_TYPE_NMTOKEN = new QName(NS_XSD, "NMTOKEN");
- public static QName QNAME_TYPE_NMTOKENS = new QName(NS_XSD, "NMTOKENS");
+ static final QName QNAME_TYPE_STRING = new QName(NS_XSD, "string");
+ static final QName QNAME_TYPE_NORMALIZED_STRING = new QName(NS_XSD, "normalizedString");
+ static final QName QNAME_TYPE_TOKEN = new QName(NS_XSD, "token");
+ static final QName QNAME_TYPE_BYTE = new QName(NS_XSD, "byte");
+ static final QName QNAME_TYPE_UNSIGNED_BYTE = new QName(NS_XSD, "unsignedByte");
+ static final QName QNAME_TYPE_BASE64_BINARY = new QName(NS_XSD, "base64Binary");
+ static final QName QNAME_TYPE_HEX_BINARY = new QName(NS_XSD, "hexBinary");
+ static final QName QNAME_TYPE_INTEGER = new QName(NS_XSD, "integer");
+ static final QName QNAME_TYPE_POSITIVE_INTEGER = new QName(NS_XSD, "positiveInteger");
+ static final QName QNAME_TYPE_NEGATIVE_INTEGER = new QName(NS_XSD, "negativeInteger");
+ static final QName QNAME_TYPE_NON_NEGATIVE_INTEGER = new QName(NS_XSD, "nonNegativeInteger");
+ static final QName QNAME_TYPE_NON_POSITIVE_INTEGER = new QName(NS_XSD, "nonPositiveInteger");
+ static final QName QNAME_TYPE_INT = new QName(NS_XSD, "int");
+ static final QName QNAME_TYPE_UNSIGNED_INT = new QName(NS_XSD, "unsignedInt");
+ static final QName QNAME_TYPE_LONG = new QName(NS_XSD, "long");
+ static final QName QNAME_TYPE_UNSIGNED_LONG = new QName(NS_XSD, "unsignedLong");
+ static final QName QNAME_TYPE_SHORT = new QName(NS_XSD, "short");
+ static final QName QNAME_TYPE_UNSIGNED_SHORT = new QName(NS_XSD, "unsignedShort");
+ static final QName QNAME_TYPE_DECIMAL = new QName(NS_XSD, "decimal");
+ static final QName QNAME_TYPE_FLOAT = new QName(NS_XSD, "float");
+ static final QName QNAME_TYPE_DOUBLE = new QName(NS_XSD, "double");
+ static final QName QNAME_TYPE_BOOLEAN = new QName(NS_XSD, "boolean");
+ static final QName QNAME_TYPE_TIME = new QName(NS_XSD, "time");
+ static final QName QNAME_TYPE_DATE_TIME = new QName(NS_XSD, "dateTime");
+ static final QName QNAME_TYPE_DURATION = new QName(NS_XSD, "duration");
+ static final QName QNAME_TYPE_DATE = new QName(NS_XSD, "date");
+ static final QName QNAME_TYPE_G_MONTH = new QName(NS_XSD, "gMonth");
+ static final QName QNAME_TYPE_G_YEAR = new QName(NS_XSD, "gYear");
+ static final QName QNAME_TYPE_G_YEAR_MONTH = new QName(NS_XSD, "gYearMonth");
+ static final QName QNAME_TYPE_G_DAY = new QName(NS_XSD, "gDay");
+ static final QName QNAME_TYPE_G_MONTH_DAY = new QName(NS_XSD, "gMonthDay");
+ static final QName QNAME_TYPE_NAME = new QName(NS_XSD, "Name");
+ static final QName QNAME_TYPE_QNAME = new QName(NS_XSD, "QName");
+ static final QName QNAME_TYPE_NCNAME = new QName(NS_XSD, "NCName");
+ static final QName QNAME_TYPE_ANY_URI = new QName(NS_XSD, "anyURI");
+ static final QName QNAME_TYPE_ID = new QName(NS_XSD, "ID");
+ static final QName QNAME_TYPE_IDREF = new QName(NS_XSD, "IDREF");
+ static final QName QNAME_TYPE_IDREFS = new QName(NS_XSD, "IDREFS");
+ static final QName QNAME_TYPE_ENTITY = new QName(NS_XSD, "ENTITY");
+ static final QName QNAME_TYPE_ENTITIES = new QName(NS_XSD, "ENTITIES");
+ static final QName QNAME_TYPE_NOTATION = new QName(NS_XSD, "NOTATION");
+ static final QName QNAME_TYPE_NMTOKEN = new QName(NS_XSD, "NMTOKEN");
+ static final QName QNAME_TYPE_NMTOKENS = new QName(NS_XSD, "NMTOKENS");
- public static QName QNAME_TYPE_LANGUAGE = new QName(NS_XSD, "language");
+ static final QName QNAME_TYPE_LANGUAGE = new QName(NS_XSD, "language");
// QNames for special types
- public static QName QNAME_TYPE_URTYPE = new QName(NS_XSD, "anyType");
- public static QName QNAME_TYPE_SIMPLE_URTYPE =
- new QName(NS_XSD, "anySimpleType");
+ static final QName QNAME_TYPE_URTYPE = new QName(NS_XSD, "anyType");
+ static final QName QNAME_TYPE_SIMPLE_URTYPE = new QName(NS_XSD, "anySimpleType");
}
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/schema/SchemaKinds.java 2013-04-04 15:26:44.204612410 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/schema/SchemaKinds.java 2013-04-04 15:26:44.156612409 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAP12Binding.java 2013-04-04 15:26:44.420612413 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAP12Binding.java 2013-04-04 15:26:44.368612412 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAP12Constants.java 2013-04-04 15:26:44.632612416 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAP12Constants.java 2013-04-04 15:26:44.580612415 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -35,205 +35,122 @@
public interface SOAP12Constants {
// namespace URIs
- public static String NS_WSDL_SOAP = "http://schemas.xmlsoap.org/wsdl/soap12/";
- public static String NS_SOAP_ENCODING =
- "http://schemas.xmlsoap.org/soap/encoding/";
+ static final String NS_WSDL_SOAP = "http://schemas.xmlsoap.org/wsdl/soap12/";
+ static final String NS_SOAP_ENCODING = "http://schemas.xmlsoap.org/soap/encoding/";
// other URIs
- public static String URI_SOAP_TRANSPORT_HTTP =
- "http://www.w3.org/2003/05/soap/bindings/HTTP/";
- ;
+ static final String URI_SOAP_TRANSPORT_HTTP = "http://www.w3.org/2003/05/soap/bindings/HTTP/";
// QNames
- public static QName QNAME_ADDRESS = new QName(NS_WSDL_SOAP, "address");
- public static QName QNAME_BINDING = new QName(NS_WSDL_SOAP, "binding");
- public static QName QNAME_BODY = new QName(NS_WSDL_SOAP, "body");
- public static QName QNAME_FAULT = new QName(NS_WSDL_SOAP, "fault");
- public static QName QNAME_HEADER = new QName(NS_WSDL_SOAP, "header");
- public static QName QNAME_HEADERFAULT =
- new QName(NS_WSDL_SOAP, "headerfault");
- public static QName QNAME_OPERATION = new QName(NS_WSDL_SOAP, "operation");
+ static final QName QNAME_ADDRESS = new QName(NS_WSDL_SOAP, "address");
+ static final QName QNAME_BINDING = new QName(NS_WSDL_SOAP, "binding");
+ static final QName QNAME_BODY = new QName(NS_WSDL_SOAP, "body");
+ static final QName QNAME_FAULT = new QName(NS_WSDL_SOAP, "fault");
+ static final QName QNAME_HEADER = new QName(NS_WSDL_SOAP, "header");
+ static final QName QNAME_HEADERFAULT = new QName(NS_WSDL_SOAP, "headerfault");
+ static final QName QNAME_OPERATION = new QName(NS_WSDL_SOAP, "operation");
// SOAP encoding QNames
- public static QName QNAME_TYPE_ARRAY = new QName(NS_SOAP_ENCODING, "Array");
- public static QName QNAME_ATTR_GROUP_COMMON_ATTRIBUTES =
- new QName(NS_SOAP_ENCODING, "commonAttributes");
- public static QName QNAME_ATTR_ARRAY_TYPE =
- new QName(NS_SOAP_ENCODING, "arrayType");
- public static QName QNAME_ATTR_ITEM_TYPE =
- new QName(NS_SOAP_ENCODING, "itemType");
- public static QName QNAME_ATTR_ARRAY_SIZE =
- new QName(NS_SOAP_ENCODING, "arraySize");
- public static QName QNAME_ATTR_OFFSET =
- new QName(NS_SOAP_ENCODING, "offset");
- public static QName QNAME_ATTR_POSITION =
- new QName(NS_SOAP_ENCODING, "position");
-
- public static QName QNAME_TYPE_BASE64 =
- new QName(NS_SOAP_ENCODING, "base64");
-
- public static QName QNAME_ELEMENT_STRING =
- new QName(NS_SOAP_ENCODING, "string");
- public static QName QNAME_ELEMENT_NORMALIZED_STRING =
- new QName(NS_SOAP_ENCODING, "normalizedString");
- public static QName QNAME_ELEMENT_TOKEN =
- new QName(NS_SOAP_ENCODING, "token");
- public static QName QNAME_ELEMENT_BYTE =
- new QName(NS_SOAP_ENCODING, "byte");
- public static QName QNAME_ELEMENT_UNSIGNED_BYTE =
- new QName(NS_SOAP_ENCODING, "unsignedByte");
- public static QName QNAME_ELEMENT_BASE64_BINARY =
- new QName(NS_SOAP_ENCODING, "base64Binary");
- public static QName QNAME_ELEMENT_HEX_BINARY =
- new QName(NS_SOAP_ENCODING, "hexBinary");
- public static QName QNAME_ELEMENT_INTEGER =
- new QName(NS_SOAP_ENCODING, "integer");
- public static QName QNAME_ELEMENT_POSITIVE_INTEGER =
- new QName(NS_SOAP_ENCODING, "positiveInteger");
- public static QName QNAME_ELEMENT_NEGATIVE_INTEGER =
- new QName(NS_SOAP_ENCODING, "negativeInteger");
- public static QName QNAME_ELEMENT_NON_NEGATIVE_INTEGER =
- new QName(NS_SOAP_ENCODING, "nonNegativeInteger");
- public static QName QNAME_ELEMENT_NON_POSITIVE_INTEGER =
- new QName(NS_SOAP_ENCODING, "nonPositiveInteger");
- public static QName QNAME_ELEMENT_INT = new QName(NS_SOAP_ENCODING, "int");
- public static QName QNAME_ELEMENT_UNSIGNED_INT =
- new QName(NS_SOAP_ENCODING, "unsignedInt");
- public static QName QNAME_ELEMENT_LONG =
- new QName(NS_SOAP_ENCODING, "long");
- public static QName QNAME_ELEMENT_UNSIGNED_LONG =
- new QName(NS_SOAP_ENCODING, "unsignedLong");
- public static QName QNAME_ELEMENT_SHORT =
- new QName(NS_SOAP_ENCODING, "short");
- public static QName QNAME_ELEMENT_UNSIGNED_SHORT =
- new QName(NS_SOAP_ENCODING, "unsignedShort");
- public static QName QNAME_ELEMENT_DECIMAL =
- new QName(NS_SOAP_ENCODING, "decimal");
- public static QName QNAME_ELEMENT_FLOAT =
- new QName(NS_SOAP_ENCODING, "float");
- public static QName QNAME_ELEMENT_DOUBLE =
- new QName(NS_SOAP_ENCODING, "double");
- public static QName QNAME_ELEMENT_BOOLEAN =
- new QName(NS_SOAP_ENCODING, "boolean");
- public static QName QNAME_ELEMENT_TIME =
- new QName(NS_SOAP_ENCODING, "time");
- public static QName QNAME_ELEMENT_DATE_TIME =
- new QName(NS_SOAP_ENCODING, "dateTime");
- public static QName QNAME_ELEMENT_DURATION =
- new QName(NS_SOAP_ENCODING, "duration");
- public static QName QNAME_ELEMENT_DATE =
- new QName(NS_SOAP_ENCODING, "date");
- public static QName QNAME_ELEMENT_G_MONTH =
- new QName(NS_SOAP_ENCODING, "gMonth");
- public static QName QNAME_ELEMENT_G_YEAR =
- new QName(NS_SOAP_ENCODING, "gYear");
- public static QName QNAME_ELEMENT_G_YEAR_MONTH =
- new QName(NS_SOAP_ENCODING, "gYearMonth");
- public static QName QNAME_ELEMENT_G_DAY =
- new QName(NS_SOAP_ENCODING, "gDay");
- public static QName QNAME_ELEMENT_G_MONTH_DAY =
- new QName(NS_SOAP_ENCODING, "gMonthDay");
- public static QName QNAME_ELEMENT_NAME =
- new QName(NS_SOAP_ENCODING, "Name");
- public static QName QNAME_ELEMENT_QNAME =
- new QName(NS_SOAP_ENCODING, "QName");
- public static QName QNAME_ELEMENT_NCNAME =
- new QName(NS_SOAP_ENCODING, "NCName");
- public static QName QNAME_ELEMENT_ANY_URI =
- new QName(NS_SOAP_ENCODING, "anyURI");
- public static QName QNAME_ELEMENT_ID = new QName(NS_SOAP_ENCODING, "ID");
- public static QName QNAME_ELEMENT_IDREF =
- new QName(NS_SOAP_ENCODING, "IDREF");
- public static QName QNAME_ELEMENT_IDREFS =
- new QName(NS_SOAP_ENCODING, "IDREFS");
- public static QName QNAME_ELEMENT_ENTITY =
- new QName(NS_SOAP_ENCODING, "ENTITY");
- public static QName QNAME_ELEMENT_ENTITIES =
- new QName(NS_SOAP_ENCODING, "ENTITIES");
- public static QName QNAME_ELEMENT_NOTATION =
- new QName(NS_SOAP_ENCODING, "NOTATION");
- public static QName QNAME_ELEMENT_NMTOKEN =
- new QName(NS_SOAP_ENCODING, "NMTOKEN");
- public static QName QNAME_ELEMENT_NMTOKENS =
- new QName(NS_SOAP_ENCODING, "NMTOKENS");
-
- public static QName QNAME_TYPE_STRING =
- new QName(NS_SOAP_ENCODING, "string");
- public static QName QNAME_TYPE_NORMALIZED_STRING =
- new QName(NS_SOAP_ENCODING, "normalizedString");
- public static QName QNAME_TYPE_TOKEN = new QName(NS_SOAP_ENCODING, "token");
- public static QName QNAME_TYPE_BYTE = new QName(NS_SOAP_ENCODING, "byte");
- public static QName QNAME_TYPE_UNSIGNED_BYTE =
- new QName(NS_SOAP_ENCODING, "unsignedByte");
- public static QName QNAME_TYPE_BASE64_BINARY =
- new QName(NS_SOAP_ENCODING, "base64Binary");
- public static QName QNAME_TYPE_HEX_BINARY =
- new QName(NS_SOAP_ENCODING, "hexBinary");
- public static QName QNAME_TYPE_INTEGER =
- new QName(NS_SOAP_ENCODING, "integer");
- public static QName QNAME_TYPE_POSITIVE_INTEGER =
- new QName(NS_SOAP_ENCODING, "positiveInteger");
- public static QName QNAME_TYPE_NEGATIVE_INTEGER =
- new QName(NS_SOAP_ENCODING, "negativeInteger");
- public static QName QNAME_TYPE_NON_NEGATIVE_INTEGER =
- new QName(NS_SOAP_ENCODING, "nonNegativeInteger");
- public static QName QNAME_TYPE_NON_POSITIVE_INTEGER =
- new QName(NS_SOAP_ENCODING, "nonPositiveInteger");
- public static QName QNAME_TYPE_INT = new QName(NS_SOAP_ENCODING, "int");
- public static QName QNAME_TYPE_UNSIGNED_INT =
- new QName(NS_SOAP_ENCODING, "unsignedInt");
- public static QName QNAME_TYPE_LONG = new QName(NS_SOAP_ENCODING, "long");
- public static QName QNAME_TYPE_UNSIGNED_LONG =
- new QName(NS_SOAP_ENCODING, "unsignedLong");
- public static QName QNAME_TYPE_SHORT = new QName(NS_SOAP_ENCODING, "short");
- public static QName QNAME_TYPE_UNSIGNED_SHORT =
- new QName(NS_SOAP_ENCODING, "unsignedShort");
- public static QName QNAME_TYPE_DECIMAL =
- new QName(NS_SOAP_ENCODING, "decimal");
- public static QName QNAME_TYPE_FLOAT = new QName(NS_SOAP_ENCODING, "float");
- public static QName QNAME_TYPE_DOUBLE =
- new QName(NS_SOAP_ENCODING, "double");
- public static QName QNAME_TYPE_BOOLEAN =
- new QName(NS_SOAP_ENCODING, "boolean");
- public static QName QNAME_TYPE_TIME = new QName(NS_SOAP_ENCODING, "time");
- public static QName QNAME_TYPE_DATE_TIME =
- new QName(NS_SOAP_ENCODING, "dateTime");
- public static QName QNAME_TYPE_DURATION =
- new QName(NS_SOAP_ENCODING, "duration");
- public static QName QNAME_TYPE_DATE = new QName(NS_SOAP_ENCODING, "date");
- public static QName QNAME_TYPE_G_MONTH =
- new QName(NS_SOAP_ENCODING, "gMonth");
- public static QName QNAME_TYPE_G_YEAR =
- new QName(NS_SOAP_ENCODING, "gYear");
- public static QName QNAME_TYPE_G_YEAR_MONTH =
- new QName(NS_SOAP_ENCODING, "gYearMonth");
- public static QName QNAME_TYPE_G_DAY = new QName(NS_SOAP_ENCODING, "gDay");
- public static QName QNAME_TYPE_G_MONTH_DAY =
- new QName(NS_SOAP_ENCODING, "gMonthDay");
- public static QName QNAME_TYPE_NAME = new QName(NS_SOAP_ENCODING, "Name");
- public static QName QNAME_TYPE_QNAME = new QName(NS_SOAP_ENCODING, "QName");
- public static QName QNAME_TYPE_NCNAME =
- new QName(NS_SOAP_ENCODING, "NCName");
- public static QName QNAME_TYPE_ANY_URI =
- new QName(NS_SOAP_ENCODING, "anyURI");
- public static QName QNAME_TYPE_ID = new QName(NS_SOAP_ENCODING, "ID");
- public static QName QNAME_TYPE_IDREF = new QName(NS_SOAP_ENCODING, "IDREF");
- public static QName QNAME_TYPE_IDREFS =
- new QName(NS_SOAP_ENCODING, "IDREFS");
- public static QName QNAME_TYPE_ENTITY =
- new QName(NS_SOAP_ENCODING, "ENTITY");
- public static QName QNAME_TYPE_ENTITIES =
- new QName(NS_SOAP_ENCODING, "ENTITIES");
- public static QName QNAME_TYPE_NOTATION =
- new QName(NS_SOAP_ENCODING, "NOTATION");
- public static QName QNAME_TYPE_NMTOKEN =
- new QName(NS_SOAP_ENCODING, "NMTOKEN");
- public static QName QNAME_TYPE_NMTOKENS =
- new QName(NS_SOAP_ENCODING, "NMTOKENS");
- public static QName QNAME_TYPE_LANGUAGE =
- new QName(NS_SOAP_ENCODING, "LANGUAGE");
+ static final QName QNAME_TYPE_ARRAY = new QName(NS_SOAP_ENCODING, "Array");
+ static final QName QNAME_ATTR_GROUP_COMMON_ATTRIBUTES = new QName(NS_SOAP_ENCODING, "commonAttributes");
+ static final QName QNAME_ATTR_ARRAY_TYPE = new QName(NS_SOAP_ENCODING, "arrayType");
+ static final QName QNAME_ATTR_ITEM_TYPE = new QName(NS_SOAP_ENCODING, "itemType");
+ static final QName QNAME_ATTR_ARRAY_SIZE = new QName(NS_SOAP_ENCODING, "arraySize");
+ static final QName QNAME_ATTR_OFFSET = new QName(NS_SOAP_ENCODING, "offset");
+ static final QName QNAME_ATTR_POSITION = new QName(NS_SOAP_ENCODING, "position");
+
+ static final QName QNAME_TYPE_BASE64 = new QName(NS_SOAP_ENCODING, "base64");
+
+ static final QName QNAME_ELEMENT_STRING = new QName(NS_SOAP_ENCODING, "string");
+ static final QName QNAME_ELEMENT_NORMALIZED_STRING = new QName(NS_SOAP_ENCODING, "normalizedString");
+ static final QName QNAME_ELEMENT_TOKEN = new QName(NS_SOAP_ENCODING, "token");
+ static final QName QNAME_ELEMENT_BYTE = new QName(NS_SOAP_ENCODING, "byte");
+ static final QName QNAME_ELEMENT_UNSIGNED_BYTE = new QName(NS_SOAP_ENCODING, "unsignedByte");
+ static final QName QNAME_ELEMENT_BASE64_BINARY = new QName(NS_SOAP_ENCODING, "base64Binary");
+ static final QName QNAME_ELEMENT_HEX_BINARY = new QName(NS_SOAP_ENCODING, "hexBinary");
+ static final QName QNAME_ELEMENT_INTEGER = new QName(NS_SOAP_ENCODING, "integer");
+ static final QName QNAME_ELEMENT_POSITIVE_INTEGER = new QName(NS_SOAP_ENCODING, "positiveInteger");
+ static final QName QNAME_ELEMENT_NEGATIVE_INTEGER = new QName(NS_SOAP_ENCODING, "negativeInteger");
+ static final QName QNAME_ELEMENT_NON_NEGATIVE_INTEGER = new QName(NS_SOAP_ENCODING, "nonNegativeInteger");
+ static final QName QNAME_ELEMENT_NON_POSITIVE_INTEGER = new QName(NS_SOAP_ENCODING, "nonPositiveInteger");
+ static final QName QNAME_ELEMENT_INT = new QName(NS_SOAP_ENCODING, "int");
+ static final QName QNAME_ELEMENT_UNSIGNED_INT = new QName(NS_SOAP_ENCODING, "unsignedInt");
+ static final QName QNAME_ELEMENT_LONG = new QName(NS_SOAP_ENCODING, "long");
+ static final QName QNAME_ELEMENT_UNSIGNED_LONG = new QName(NS_SOAP_ENCODING, "unsignedLong");
+ static final QName QNAME_ELEMENT_SHORT = new QName(NS_SOAP_ENCODING, "short");
+ static final QName QNAME_ELEMENT_UNSIGNED_SHORT = new QName(NS_SOAP_ENCODING, "unsignedShort");
+ static final QName QNAME_ELEMENT_DECIMAL = new QName(NS_SOAP_ENCODING, "decimal");
+ static final QName QNAME_ELEMENT_FLOAT = new QName(NS_SOAP_ENCODING, "float");
+ static final QName QNAME_ELEMENT_DOUBLE = new QName(NS_SOAP_ENCODING, "double");
+ static final QName QNAME_ELEMENT_BOOLEAN = new QName(NS_SOAP_ENCODING, "boolean");
+ static final QName QNAME_ELEMENT_TIME = new QName(NS_SOAP_ENCODING, "time");
+ static final QName QNAME_ELEMENT_DATE_TIME = new QName(NS_SOAP_ENCODING, "dateTime");
+ static final QName QNAME_ELEMENT_DURATION = new QName(NS_SOAP_ENCODING, "duration");
+ static final QName QNAME_ELEMENT_DATE = new QName(NS_SOAP_ENCODING, "date");
+ static final QName QNAME_ELEMENT_G_MONTH = new QName(NS_SOAP_ENCODING, "gMonth");
+ static final QName QNAME_ELEMENT_G_YEAR = new QName(NS_SOAP_ENCODING, "gYear");
+ static final QName QNAME_ELEMENT_G_YEAR_MONTH = new QName(NS_SOAP_ENCODING, "gYearMonth");
+ static final QName QNAME_ELEMENT_G_DAY = new QName(NS_SOAP_ENCODING, "gDay");
+ static final QName QNAME_ELEMENT_G_MONTH_DAY = new QName(NS_SOAP_ENCODING, "gMonthDay");
+ static final QName QNAME_ELEMENT_NAME = new QName(NS_SOAP_ENCODING, "Name");
+ static final QName QNAME_ELEMENT_QNAME = new QName(NS_SOAP_ENCODING, "QName");
+ static final QName QNAME_ELEMENT_NCNAME = new QName(NS_SOAP_ENCODING, "NCName");
+ static final QName QNAME_ELEMENT_ANY_URI = new QName(NS_SOAP_ENCODING, "anyURI");
+ static final QName QNAME_ELEMENT_ID = new QName(NS_SOAP_ENCODING, "ID");
+ static final QName QNAME_ELEMENT_IDREF = new QName(NS_SOAP_ENCODING, "IDREF");
+ static final QName QNAME_ELEMENT_IDREFS = new QName(NS_SOAP_ENCODING, "IDREFS");
+ static final QName QNAME_ELEMENT_ENTITY = new QName(NS_SOAP_ENCODING, "ENTITY");
+ static final QName QNAME_ELEMENT_ENTITIES = new QName(NS_SOAP_ENCODING, "ENTITIES");
+ static final QName QNAME_ELEMENT_NOTATION = new QName(NS_SOAP_ENCODING, "NOTATION");
+ static final QName QNAME_ELEMENT_NMTOKEN = new QName(NS_SOAP_ENCODING, "NMTOKEN");
+ static final QName QNAME_ELEMENT_NMTOKENS = new QName(NS_SOAP_ENCODING, "NMTOKENS");
+
+ static final QName QNAME_TYPE_STRING = new QName(NS_SOAP_ENCODING, "string");
+ static final QName QNAME_TYPE_NORMALIZED_STRING = new QName(NS_SOAP_ENCODING, "normalizedString");
+ static final QName QNAME_TYPE_TOKEN = new QName(NS_SOAP_ENCODING, "token");
+ static final QName QNAME_TYPE_BYTE = new QName(NS_SOAP_ENCODING, "byte");
+ static final QName QNAME_TYPE_UNSIGNED_BYTE = new QName(NS_SOAP_ENCODING, "unsignedByte");
+ static final QName QNAME_TYPE_BASE64_BINARY = new QName(NS_SOAP_ENCODING, "base64Binary");
+ static final QName QNAME_TYPE_HEX_BINARY = new QName(NS_SOAP_ENCODING, "hexBinary");
+ static final QName QNAME_TYPE_INTEGER = new QName(NS_SOAP_ENCODING, "integer");
+ static final QName QNAME_TYPE_POSITIVE_INTEGER = new QName(NS_SOAP_ENCODING, "positiveInteger");
+ static final QName QNAME_TYPE_NEGATIVE_INTEGER = new QName(NS_SOAP_ENCODING, "negativeInteger");
+ static final QName QNAME_TYPE_NON_NEGATIVE_INTEGER = new QName(NS_SOAP_ENCODING, "nonNegativeInteger");
+ static final QName QNAME_TYPE_NON_POSITIVE_INTEGER = new QName(NS_SOAP_ENCODING, "nonPositiveInteger");
+ static final QName QNAME_TYPE_INT = new QName(NS_SOAP_ENCODING, "int");
+ static final QName QNAME_TYPE_UNSIGNED_INT = new QName(NS_SOAP_ENCODING, "unsignedInt");
+ static final QName QNAME_TYPE_LONG = new QName(NS_SOAP_ENCODING, "long");
+ static final QName QNAME_TYPE_UNSIGNED_LONG = new QName(NS_SOAP_ENCODING, "unsignedLong");
+ static final QName QNAME_TYPE_SHORT = new QName(NS_SOAP_ENCODING, "short");
+ static final QName QNAME_TYPE_UNSIGNED_SHORT = new QName(NS_SOAP_ENCODING, "unsignedShort");
+ static final QName QNAME_TYPE_DECIMAL = new QName(NS_SOAP_ENCODING, "decimal");
+ static final QName QNAME_TYPE_FLOAT = new QName(NS_SOAP_ENCODING, "float");
+ static final QName QNAME_TYPE_DOUBLE = new QName(NS_SOAP_ENCODING, "double");
+ static final QName QNAME_TYPE_BOOLEAN = new QName(NS_SOAP_ENCODING, "boolean");
+ static final QName QNAME_TYPE_TIME = new QName(NS_SOAP_ENCODING, "time");
+ static final QName QNAME_TYPE_DATE_TIME = new QName(NS_SOAP_ENCODING, "dateTime");
+ static final QName QNAME_TYPE_DURATION = new QName(NS_SOAP_ENCODING, "duration");
+ static final QName QNAME_TYPE_DATE = new QName(NS_SOAP_ENCODING, "date");
+ static final QName QNAME_TYPE_G_MONTH = new QName(NS_SOAP_ENCODING, "gMonth");
+ static final QName QNAME_TYPE_G_YEAR = new QName(NS_SOAP_ENCODING, "gYear");
+ static final QName QNAME_TYPE_G_YEAR_MONTH = new QName(NS_SOAP_ENCODING, "gYearMonth");
+ static final QName QNAME_TYPE_G_DAY = new QName(NS_SOAP_ENCODING, "gDay");
+ static final QName QNAME_TYPE_G_MONTH_DAY = new QName(NS_SOAP_ENCODING, "gMonthDay");
+ static final QName QNAME_TYPE_NAME = new QName(NS_SOAP_ENCODING, "Name");
+ static final QName QNAME_TYPE_QNAME = new QName(NS_SOAP_ENCODING, "QName");
+ static final QName QNAME_TYPE_NCNAME = new QName(NS_SOAP_ENCODING, "NCName");
+ static final QName QNAME_TYPE_ANY_URI = new QName(NS_SOAP_ENCODING, "anyURI");
+ static final QName QNAME_TYPE_ID = new QName(NS_SOAP_ENCODING, "ID");
+ static final QName QNAME_TYPE_IDREF = new QName(NS_SOAP_ENCODING, "IDREF");
+ static final QName QNAME_TYPE_IDREFS = new QName(NS_SOAP_ENCODING, "IDREFS");
+ static final QName QNAME_TYPE_ENTITY = new QName(NS_SOAP_ENCODING, "ENTITY");
+ static final QName QNAME_TYPE_ENTITIES = new QName(NS_SOAP_ENCODING, "ENTITIES");
+ static final QName QNAME_TYPE_NOTATION = new QName(NS_SOAP_ENCODING, "NOTATION");
+ static final QName QNAME_TYPE_NMTOKEN = new QName(NS_SOAP_ENCODING, "NMTOKEN");
+ static final QName QNAME_TYPE_NMTOKENS = new QName(NS_SOAP_ENCODING, "NMTOKENS");
+ static final QName QNAME_TYPE_LANGUAGE = new QName(NS_SOAP_ENCODING, "LANGUAGE");
// SOAP attributes with non-colonized names
- public static QName QNAME_ATTR_ID = new QName("", "id");
- public static QName QNAME_ATTR_HREF = new QName("", "ref");
+ static final QName QNAME_ATTR_ID = new QName("", "id");
+ static final QName QNAME_ATTR_HREF = new QName("", "ref");
}
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPAddress.java 2013-04-04 15:26:44.884612420 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPAddress.java 2013-04-04 15:26:44.832612419 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPBinding.java 2013-04-04 15:26:45.136612424 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPBinding.java 2013-04-04 15:26:45.084612423 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPBody.java 2013-04-04 15:26:45.364612428 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPBody.java 2013-04-04 15:26:45.308612426 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPConstants.java 2013-04-04 15:26:45.604612431 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPConstants.java 2013-04-04 15:26:45.556612431 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPFault.java 2013-04-04 15:26:45.864612435 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPFault.java 2013-04-04 15:26:45.808612434 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPHeader.java 2013-04-04 15:26:46.152612440 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPHeader.java 2013-04-04 15:26:46.084612439 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPHeaderFault.java 2013-04-04 15:26:46.416612444 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPHeaderFault.java 2013-04-04 15:26:46.368612443 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPOperation.java 2013-04-04 15:26:46.648612448 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPOperation.java 2013-04-04 15:26:46.592612446 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPStyle.java 2013-04-04 15:26:46.892612451 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPStyle.java 2013-04-04 15:26:46.836612450 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPUse.java 2013-04-04 15:26:47.136612455 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPUse.java 2013-04-04 15:26:47.080612454 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/AbstractDocument.java 2013-04-04 15:26:47.380612458 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/AbstractDocument.java 2013-04-04 15:26:47.320612458 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -34,8 +34,6 @@
import javax.xml.namespace.QName;
import java.util.*;
-import org.xml.sax.helpers.LocatorImpl;
-
/**
* An abstract class for documents containing entities.
*
@@ -163,10 +161,11 @@
private final Set includedDocuments;
private final List includedEntities;
- private class LocallyValidatingAction implements EntityAction {
+ private static class LocallyValidatingAction implements EntityAction {
public LocallyValidatingAction() {
}
+ @Override
public void perform(Entity entity) {
try {
entity.validateThis();
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/Defining.java 2013-04-04 15:26:47.612612463 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/Defining.java 2013-04-04 15:26:47.560612461 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/DuplicateEntityException.java 2013-04-04 15:26:47.844612466 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/DuplicateEntityException.java 2013-04-04 15:26:47.784612465 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/Elemental.java 2013-04-04 15:26:48.076612470 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/Elemental.java 2013-04-04 15:26:48.020612468 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/Entity.java 2013-04-04 15:26:48.344612473 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/Entity.java 2013-04-04 15:26:48.276612472 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/EntityAction.java 2013-04-04 15:26:48.564612477 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/EntityAction.java 2013-04-04 15:26:48.512612477 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/EntityReferenceAction.java 2013-04-04 15:26:48.784612481 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/EntityReferenceAction.java 2013-04-04 15:26:48.732612480 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/EntityReferenceValidator.java 2013-04-04 15:26:49.000612484 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/EntityReferenceValidator.java 2013-04-04 15:26:48.952612483 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/ExtensibilityHelper.java 2013-04-04 15:26:49.212612487 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/ExtensibilityHelper.java 2013-04-04 15:26:49.164612486 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/ExtensionImpl.java 2013-04-04 15:26:49.492612492 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/ExtensionImpl.java 2013-04-04 15:26:49.436612490 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/ExtensionVisitor.java 2013-04-04 15:26:49.732612496 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/ExtensionVisitor.java 2013-04-04 15:26:49.680612494 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/ExtensionVisitorBase.java 2013-04-04 15:26:49.948612499 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/ExtensionVisitorBase.java 2013-04-04 15:26:49.892612498 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/ExternalEntityReference.java 2013-04-04 15:26:50.180612503 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/ExternalEntityReference.java 2013-04-04 15:26:50.132612502 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/GlobalEntity.java 2013-04-04 15:26:50.440612507 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/GlobalEntity.java 2013-04-04 15:26:50.384612505 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/GloballyKnown.java 2013-04-04 15:26:50.740612511 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/GloballyKnown.java 2013-04-04 15:26:50.684612510 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/Identifiable.java 2013-04-04 15:26:51.012612515 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/Identifiable.java 2013-04-04 15:26:50.960612514 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/Kind.java 2013-04-04 15:26:51.292612520 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/Kind.java 2013-04-04 15:26:51.236612518 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/NoSuchEntityException.java 2013-04-04 15:26:51.544612524 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/NoSuchEntityException.java 2013-04-04 15:26:51.496612523 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/ParseException.java 2013-04-04 15:26:51.784612527 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/ParseException.java 2013-04-04 15:26:51.732612526 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -25,8 +25,8 @@
package com.sun.tools.internal.ws.wsdl.framework;
+import com.sun.istack.internal.localization.Localizable;
import com.sun.xml.internal.ws.util.exception.JAXWSExceptionBase;
-import com.sun.xml.internal.ws.util.localization.Localizable;
/**
* An exception signalling a parsing error.
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/ParserListener.java 2013-04-04 15:26:52.016612531 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/ParserListener.java 2013-04-04 15:26:51.964612530 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/QNameAction.java 2013-04-04 15:26:52.288612535 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/QNameAction.java 2013-04-04 15:26:52.232612534 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/TWSDLParserContextImpl.java 2013-04-04 15:26:52.500612538 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/TWSDLParserContextImpl.java 2013-04-04 15:26:52.452612537 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/ValidationException.java 2013-04-04 15:26:52.780612543 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/ValidationException.java 2013-04-04 15:26:52.724612542 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/WSDLLocation.java 2013-04-04 15:26:53.048612547 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/framework/WSDLLocation.java 2013-04-04 15:26:52.984612546 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -43,17 +43,12 @@
if (idPos >= max) {
LocationContext newContexts[] = new LocationContext[max * 2];
System.arraycopy(contexts, 0, newContexts, 0, max);
- max *= 2;
contexts = newContexts;
}
currentContext = contexts[idPos];
if (currentContext == null) {
contexts[idPos] = currentContext = new LocationContext();
}
- if (idPos > 0) {
- currentContext.setParent(contexts[idPos - 1]);
- }
-
}
public void pop() {
@@ -63,7 +58,7 @@
}
}
- public void reset() {
+ public final void reset() {
contexts = new LocationContext[32];
idPos = 0;
contexts[idPos] = currentContext = new LocationContext();
@@ -91,11 +86,6 @@
return location;
}
- void setParent(LocationContext parent) {
- parentLocation = parent;
- }
-
private String location;
- private LocationContext parentLocation;
}
}
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/AbstractExtensionHandler.java 2013-04-04 15:26:53.340612551 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/AbstractExtensionHandler.java 2013-04-04 15:26:53.276612550 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/AbstractReferenceFinderImpl.java 2013-04-04 15:26:53.580612555 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/AbstractReferenceFinderImpl.java 2013-04-04 15:26:53.532612554 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, 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
@@ -70,6 +70,7 @@
*/
protected abstract String findExternalResource( String nsURI, String localName, Attributes atts);
+ @Override
public void startElement(String namespaceURI, String localName, String qName, Attributes atts)
throws SAXException {
super.startElement(namespaceURI, localName, qName, atts);
@@ -79,16 +80,17 @@
try {
// absolutize URL.
- String lsi = locator.getSystemId();
- String ref;
- if (lsi.startsWith("jar:")) {
- int bangIdx = lsi.indexOf('!');
- if (bangIdx > 0) {
- ref = new URL(new URL(lsi), relativeRef).toString();
- } else
- ref = relativeRef;
- } else
- ref = new URI(lsi).resolve(new URI(relativeRef)).toString();
+ assert locator != null;
+ String lsi = locator.getSystemId();
+ String ref;
+ if (lsi.startsWith("jar:")) {
+ int bangIdx = lsi.indexOf('!');
+ if (bangIdx > 0) {
+ ref = new URL(new URL(lsi), relativeRef).toString();
+ } else
+ ref = relativeRef;
+ } else
+ ref = new URI(lsi).resolve(new URI(relativeRef)).toString();
// then parse this schema as well,
// but don't mark this document as a root.
@@ -112,6 +114,7 @@
private Locator locator;
+ @Override
public void setDocumentLocator(Locator locator) {
super.setDocumentLocator(locator);
this.locator = locator;
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/Constants.java 2013-04-04 15:26:53.808612559 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/Constants.java 2013-04-04 15:26:53.760612558 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -32,114 +32,114 @@
*/
public interface Constants {
// WSDL element tags
- public static String TAG_BINDING = "binding";
- public static String TAG_DEFINITIONS = "definitions";
- public static String TAG_DOCUMENTATION = "documentation";
- public static String TAG_MESSAGE = "message";
- public static String TAG_PART = "part";
- public static String TAG_PORT_TYPE = "portType";
- public static String TAG_TYPES = "types";
- public static String TAG_OPERATION = "operation";
- public static String TAG_INPUT = "input";
- public static String TAG_OUTPUT = "output";
- public static String TAG_FAULT = "fault";
- public static String TAG_SERVICE = "service";
- public static String TAG_PORT = "port";
- public static String TAG_ = "";
+ static final String TAG_BINDING = "binding";
+ static final String TAG_DEFINITIONS = "definitions";
+ static final String TAG_DOCUMENTATION = "documentation";
+ static final String TAG_MESSAGE = "message";
+ static final String TAG_PART = "part";
+ static final String TAG_PORT_TYPE = "portType";
+ static final String TAG_TYPES = "types";
+ static final String TAG_OPERATION = "operation";
+ static final String TAG_INPUT = "input";
+ static final String TAG_OUTPUT = "output";
+ static final String TAG_FAULT = "fault";
+ static final String TAG_SERVICE = "service";
+ static final String TAG_PORT = "port";
+ static final String TAG_ = "";
// WSDL attribute names
- public static String ATTR_ELEMENT = "element";
- public static String ATTR_NAME = "name";
- public static String ATTR_REQUIRED = "required";
- public static String ATTR_TARGET_NAMESPACE = "targetNamespace";
- public static String ATTR_TYPE = "type";
- public static String ATTR_MESSAGE = "message";
- public static String ATTR_BINDING = "binding";
- public static String ATTR_LOCATION = "location";
- public static String ATTR_TRANSPORT = "transport";
- public static String ATTR_STYLE = "style";
- public static String ATTR_USE = "use";
- public static String ATTR_NAMESPACE = "namespace";
- public static String ATTR_ENCODING_STYLE = "encodingStyle";
- public static String ATTR_PART = "part";
- public static String ATTR_PARTS = "parts";
- public static String ATTR_SOAP_ACTION = "soapAction";
- public static String ATTR_PARAMETER_ORDER = "parameterOrder";
- public static String ATTR_VERB = "verb";
+ static final String ATTR_ELEMENT = "element";
+ static final String ATTR_NAME = "name";
+ static final String ATTR_REQUIRED = "required";
+ static final String ATTR_TARGET_NAMESPACE = "targetNamespace";
+ static final String ATTR_TYPE = "type";
+ static final String ATTR_MESSAGE = "message";
+ static final String ATTR_BINDING = "binding";
+ static final String ATTR_LOCATION = "location";
+ static final String ATTR_TRANSPORT = "transport";
+ static final String ATTR_STYLE = "style";
+ static final String ATTR_USE = "use";
+ static final String ATTR_NAMESPACE = "namespace";
+ static final String ATTR_ENCODING_STYLE = "encodingStyle";
+ static final String ATTR_PART = "part";
+ static final String ATTR_PARTS = "parts";
+ static final String ATTR_SOAP_ACTION = "soapAction";
+ static final String ATTR_PARAMETER_ORDER = "parameterOrder";
+ static final String ATTR_VERB = "verb";
// schema attribute names
- public static String ATTR_ID = "id";
- public static String ATTR_VERSION = "version";
- public static String ATTR_ATTRIBUTE_FORM_DEFAULT = "attributeFormDefault";
- public static String ATTR_BLOCK_DEFAULT = "blockDefault";
- public static String ATTR_ELEMENT_FORM_DEFAULT = "elementFormDefault";
- public static String ATTR_FINAL_DEFAULT = "finalDefault";
- public static String ATTR_ABSTRACT = "abstract";
- public static String ATTR_NILLABLE = "nillable";
- public static String ATTR_DEFAULT = "default";
- public static String ATTR_FIXED = "fixed";
- public static String ATTR_FORM = "form";
- public static String ATTR_BLOCK = "block";
- public static String ATTR_FINAL = "final";
- public static String ATTR_REF = "ref";
- public static String ATTR_SUBSTITUTION_GROUP = "substitutionGroup";
- public static String ATTR_MIN_OCCURS = "minOccurs";
- public static String ATTR_MAX_OCCURS = "maxOccurs";
- public static String ATTR_PROCESS_CONTENTS = "processContents";
- public static String ATTR_MIXED = "mixed";
- public static String ATTR_BASE = "base";
- public static String ATTR_VALUE = "value";
- public static String ATTR_XPATH = "xpath";
- public static String ATTR_SCHEMA_LOCATION = "schemaLocation";
- public static String ATTR_REFER = "refer";
- public static String ATTR_ITEM_TYPE = "itemType";
- public static String ATTR_PUBLIC = "public";
- public static String ATTR_SYSTEM = "system";
- public static String ATTR_MEMBER_TYPES = "memberTypes";
- public static String ATTR_ = "";
+ static final String ATTR_ID = "id";
+ static final String ATTR_VERSION = "version";
+ static final String ATTR_ATTRIBUTE_FORM_DEFAULT = "attributeFormDefault";
+ static final String ATTR_BLOCK_DEFAULT = "blockDefault";
+ static final String ATTR_ELEMENT_FORM_DEFAULT = "elementFormDefault";
+ static final String ATTR_FINAL_DEFAULT = "finalDefault";
+ static final String ATTR_ABSTRACT = "abstract";
+ static final String ATTR_NILLABLE = "nillable";
+ static final String ATTR_DEFAULT = "default";
+ static final String ATTR_FIXED = "fixed";
+ static final String ATTR_FORM = "form";
+ static final String ATTR_BLOCK = "block";
+ static final String ATTR_FINAL = "final";
+ static final String ATTR_REF = "ref";
+ static final String ATTR_SUBSTITUTION_GROUP = "substitutionGroup";
+ static final String ATTR_MIN_OCCURS = "minOccurs";
+ static final String ATTR_MAX_OCCURS = "maxOccurs";
+ static final String ATTR_PROCESS_CONTENTS = "processContents";
+ static final String ATTR_MIXED = "mixed";
+ static final String ATTR_BASE = "base";
+ static final String ATTR_VALUE = "value";
+ static final String ATTR_XPATH = "xpath";
+ static final String ATTR_SCHEMA_LOCATION = "schemaLocation";
+ static final String ATTR_REFER = "refer";
+ static final String ATTR_ITEM_TYPE = "itemType";
+ static final String ATTR_PUBLIC = "public";
+ static final String ATTR_SYSTEM = "system";
+ static final String ATTR_MEMBER_TYPES = "memberTypes";
+ static final String ATTR_ = "";
// WSDL attribute values
- public static String ATTRVALUE_RPC = "rpc";
- public static String ATTRVALUE_DOCUMENT = "document";
- public static String ATTRVALUE_LITERAL = "literal";
- public static String ATTRVALUE_ENCODED = "encoded";
+ static final String ATTRVALUE_RPC = "rpc";
+ static final String ATTRVALUE_DOCUMENT = "document";
+ static final String ATTRVALUE_LITERAL = "literal";
+ static final String ATTRVALUE_ENCODED = "encoded";
// schema attribute values
- public static String ATTRVALUE_QUALIFIED = "qualified";
- public static String ATTRVALUE_UNQUALIFIED = "unqualified";
- public static String ATTRVALUE_ALL = "#all";
- public static String ATTRVALUE_SUBSTITUTION = "substitution";
- public static String ATTRVALUE_EXTENSION = "extension";
- public static String ATTRVALUE_RESTRICTION = "restriction";
- public static String ATTRVALUE_LIST = "list";
- public static String ATTRVALUE_UNION = "union";
- public static String ATTRVALUE_UNBOUNDED = "unbounded";
- public static String ATTRVALUE_PROHIBITED = "prohibited";
- public static String ATTRVALUE_OPTIONAL = "optional";
- public static String ATTRVALUE_REQUIRED = "required";
- public static String ATTRVALUE_LAX = "lax";
- public static String ATTRVALUE_SKIP = "skip";
- public static String ATTRVALUE_STRICT = "strict";
- public static String ATTRVALUE_ANY = "##any";
- public static String ATTRVALUE_LOCAL = "##local";
- public static String ATTRVALUE_OTHER = "##other";
- public static String ATTRVALUE_TARGET_NAMESPACE = "##targetNamespace";
- public static String ATTRVALUE_ = "";
+ static final String ATTRVALUE_QUALIFIED = "qualified";
+ static final String ATTRVALUE_UNQUALIFIED = "unqualified";
+ static final String ATTRVALUE_ALL = "#all";
+ static final String ATTRVALUE_SUBSTITUTION = "substitution";
+ static final String ATTRVALUE_EXTENSION = "extension";
+ static final String ATTRVALUE_RESTRICTION = "restriction";
+ static final String ATTRVALUE_LIST = "list";
+ static final String ATTRVALUE_UNION = "union";
+ static final String ATTRVALUE_UNBOUNDED = "unbounded";
+ static final String ATTRVALUE_PROHIBITED = "prohibited";
+ static final String ATTRVALUE_OPTIONAL = "optional";
+ static final String ATTRVALUE_REQUIRED = "required";
+ static final String ATTRVALUE_LAX = "lax";
+ static final String ATTRVALUE_SKIP = "skip";
+ static final String ATTRVALUE_STRICT = "strict";
+ static final String ATTRVALUE_ANY = "##any";
+ static final String ATTRVALUE_LOCAL = "##local";
+ static final String ATTRVALUE_OTHER = "##other";
+ static final String ATTRVALUE_TARGET_NAMESPACE = "##targetNamespace";
+ static final String ATTRVALUE_ = "";
// namespace URIs
- public static String NS_XML = "http://www.w3.org/XML/1998/namespace";
- public static String NS_XMLNS = "http://www.w3.org/2000/xmlns/";
- public static String NS_WSDL = "http://schemas.xmlsoap.org/wsdl/";
- public static String NS_WSDL_SOAP = "http://schemas.xmlsoap.org/wsdl/soap/";
- public static String NS_WSDL_SOAP12 = "http://schemas.xmlsoap.org/wsdl/soap12/";
- public static String NS_WSDL_HTTP = "http://schemas.xmlsoap.org/wsdl/http/";
- public static String NS_WSDL_MIME = "http://schemas.xmlsoap.org/wsdl/mime/";
- public static String NS_XSD = "http://www.w3.org/2001/XMLSchema";
- public static String NS_XSI = "http://www.w3.org/2001/XMLSchema-instance";
- public static String NS_ = "";
+ static final String NS_XML = "http://www.w3.org/XML/1998/namespace";
+ static final String NS_XMLNS = "http://www.w3.org/2000/xmlns/";
+ static final String NS_WSDL = "http://schemas.xmlsoap.org/wsdl/";
+ static final String NS_WSDL_SOAP = "http://schemas.xmlsoap.org/wsdl/soap/";
+ static final String NS_WSDL_SOAP12 = "http://schemas.xmlsoap.org/wsdl/soap12/";
+ static final String NS_WSDL_HTTP = "http://schemas.xmlsoap.org/wsdl/http/";
+ static final String NS_WSDL_MIME = "http://schemas.xmlsoap.org/wsdl/mime/";
+ static final String NS_XSD = "http://www.w3.org/2001/XMLSchema";
+ static final String NS_XSI = "http://www.w3.org/2001/XMLSchema-instance";
+ static final String NS_ = "";
// other constants
- public static String XMLNS = "xmlns";
- public static String TRUE = "true";
- public static String FALSE = "false";
+ static final String XMLNS = "xmlns";
+ static final String TRUE = "true";
+ static final String FALSE = "false";
}
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/DOMBuilder.java 2013-04-04 15:26:54.036612563 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/DOMBuilder.java 2013-04-04 15:26:53.984612561 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/DOMForest.java 2013-04-04 15:26:54.280612566 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/DOMForest.java 2013-04-04 15:26:54.228612566 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, 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
@@ -26,15 +26,12 @@
package com.sun.tools.internal.ws.wsdl.parser;
import com.sun.istack.internal.NotNull;
-import com.sun.tools.internal.ws.resources.WscompileMessages;
-import com.sun.tools.internal.ws.wscompile.AbortException;
-import com.sun.tools.internal.ws.wscompile.DefaultAuthenticator;
+import com.sun.tools.internal.ws.util.xml.XmlUtil;
import com.sun.tools.internal.ws.wscompile.ErrorReceiver;
import com.sun.tools.internal.ws.wscompile.WsimportOptions;
import com.sun.tools.internal.ws.wsdl.document.schema.SchemaConstants;
import com.sun.tools.internal.xjc.reader.internalizer.LocatorTable;
import com.sun.xml.internal.bind.marshaller.DataWriter;
-import com.sun.xml.internal.ws.util.JAXWSUtils;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
@@ -51,9 +48,6 @@
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.sax.SAXResult;
-import javax.net.ssl.HttpsURLConnection;
-import javax.net.ssl.HostnameVerifier;
-import javax.net.ssl.SSLSession;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
@@ -119,11 +113,13 @@
this.errorReceiver = errReceiver;
this.logic = logic;
try {
- DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ // secure xml processing can be switched off if input requires it
+ boolean secureProcessingEnabled = options == null || !options.disableSecureXmlProcessing;
+ DocumentBuilderFactory dbf = XmlUtil.newDocumentBuilderFactory(secureProcessingEnabled);
dbf.setNamespaceAware(true);
this.documentBuilder = dbf.newDocumentBuilder();
- this.parserFactory = SAXParserFactory.newInstance();
+ this.parserFactory = XmlUtil.newSAXParserFactory(secureProcessingEnabled);
this.parserFactory.setNamespaceAware(true);
} catch (ParserConfigurationException e) {
throw new AssertionError(e);
@@ -368,7 +364,10 @@
public void dump(OutputStream out) throws IOException {
try {
// create identity transformer
- Transformer it = TransformerFactory.newInstance().newTransformer();
+ // secure xml processing can be switched off if input requires it
+ boolean secureProcessingEnabled = options == null || !options.disableSecureXmlProcessing;
+ TransformerFactory tf = XmlUtil.newTransformerFactory(secureProcessingEnabled);
+ Transformer it = tf.newTransformer();
for (Map.Entry e : core.entrySet()) {
out.write(("---<< " + e.getKey() + '\n').getBytes());
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/DOMForestParser.java 2013-04-04 15:26:54.520612570 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/DOMForestParser.java 2013-04-04 15:26:54.468612569 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/DOMForestScanner.java 2013-04-04 15:26:54.768612573 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/DOMForestScanner.java 2013-04-04 15:26:54.716612573 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/HTTPExtensionHandler.java 2013-04-04 15:26:55.016612578 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/HTTPExtensionHandler.java 2013-04-04 15:26:54.964612577 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/InternalizationLogic.java 2013-04-04 15:26:55.280612582 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/InternalizationLogic.java 2013-04-04 15:26:55.228612581 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/Internalizer.java 2013-04-04 15:26:55.528612586 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/Internalizer.java 2013-04-04 15:26:55.468612585 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, 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
@@ -36,12 +36,8 @@
import com.sun.xml.internal.bind.v2.util.EditDistance;
import com.sun.xml.internal.ws.util.DOMUtil;
import com.sun.xml.internal.ws.util.JAXWSUtils;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
+import com.sun.xml.internal.ws.util.xml.XmlUtil;
+import org.w3c.dom.*;
import org.xml.sax.SAXParseException;
import javax.xml.namespace.NamespaceContext;
@@ -52,10 +48,8 @@
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
-import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
-import java.util.Map;
import java.util.Set;
@@ -65,16 +59,15 @@
* @author Vivek Pandey
*/
public class Internalizer {
- private static final XPathFactory xpf = XPathFactory.newInstance();
+
+ private static final XPathFactory xpf = XmlUtil.newXPathFactory(true);
private final XPath xpath = xpf.newXPath();
- private final WsimportOptions options;
private final DOMForest forest;
private final ErrorReceiver errorReceiver;
public Internalizer(DOMForest forest, WsimportOptions options, ErrorReceiver errorReceiver) {
this.forest = forest;
- this.options = options;
this.errorReceiver = errorReceiver;
}
@@ -82,15 +75,6 @@
for (Element jaxwsBinding : forest.outerMostBindings) {
internalize(jaxwsBinding, jaxwsBinding);
}
- /*
- Map targetNodes = new HashMap();
- for (Element jaxwsBinding : forest.outerMostBindings) {
- buildTargetNodeMap(jaxwsBinding, jaxwsBinding, targetNodes);
- }
- for (Element jaxwsBinding : forest.outerMostBindings) {
- move(jaxwsBinding, targetNodes);
- }
- */
}
/**
@@ -100,12 +84,15 @@
NamedNodeMap atts = bindings.getAttributes();
for (int i = 0; i < atts.getLength(); i++) {
Attr a = (Attr) atts.item(i);
- if (a.getNamespaceURI() != null)
+ if (a.getNamespaceURI() != null) {
continue; // all foreign namespace OK.
- if (a.getLocalName().equals("node"))
+ }
+ if (a.getLocalName().equals("node")) {
continue;
- if (a.getLocalName().equals("wsdlLocation"))
+ }
+ if (a.getLocalName().equals("wsdlLocation")) {
continue;
+ }
// TODO: flag error for this undefined attribute
}
@@ -181,9 +168,9 @@
//if target is null or empty it means the xpath evaluation has some problem,
// just return
- if (targetNodes == null && hasNode && !isToplevelBinding)
+ if (targetNodes == null && hasNode && !isToplevelBinding) {
return;
-
+ }
if (hasNode) {
if (targetNodes != null) {
@@ -191,10 +178,11 @@
insertBinding(bindings, targetNodes.item(i));
// look for child and process them recursively
Element[] children = getChildElements(bindings);
- for (Element child : children)
- if("bindings".equals(child.getLocalName())) {
+ for (Element child : children) {
+ if ("bindings".equals(child.getLocalName())) {
internalize(child, targetNodes.item(i));
}
+ }
}
}
}
@@ -202,8 +190,9 @@
// look for child and process them recursively
Element[] children = getChildElements(bindings);
- for (Element child : children)
+ for (Element child : children) {
internalize(child, target);
+ }
}
}
@@ -226,105 +215,20 @@
}
}
-
- /**
- * Determines the target node of the "bindings" element
- * by using the inherited target node, then put
- * the result into the "result" map.
- */
- /* TODO Remove this logic if there are no regressions with new internalization logic
- private void buildTargetNodeMap(Element bindings, Node inheritedTarget, Map result) {
- // start by the inherited target
- Node target = inheritedTarget;
-
- validate(bindings); // validate this node
-
- // look for @wsdlLocation
- if (isTopLevelBinding(bindings)) {
- String wsdlLocation;
- if (bindings.getAttributeNode("wsdlLocation") != null) {
- wsdlLocation = bindings.getAttribute("wsdlLocation");
-
- try {
- // absolutize this URI.
- // TODO: use the URI class
- // TODO: honor xml:base
- wsdlLocation = new URL(new URL(forest.getSystemId(bindings.getOwnerDocument())),
- wsdlLocation).toExternalForm();
- } catch (MalformedURLException e) {
- wsdlLocation = JAXWSUtils.absolutize(JAXWSUtils.getFileOrURLName(wsdlLocation));
- }
- } else {
- //the node does not have
- wsdlLocation = forest.getFirstRootDocument();
- }
- target = forest.get(wsdlLocation);
-
- if (target == null) {
- reportError(bindings, WsdlMessages.INTERNALIZER_INCORRECT_SCHEMA_REFERENCE(wsdlLocation, EditDistance.findNearest(wsdlLocation, forest.listSystemIDs())));
- return; // abort processing this
- }
- }
-
- //if the target node is xs:schema, declare the jaxb version on it as latter on it will be
- //required by the inlined schema bindings
-
- Element element = DOMUtil.getFirstElementChild(target);
- if (element != null && element.getNamespaceURI().equals(Constants.NS_WSDL) && element.getLocalName().equals("definitions")) {
- //get all schema elements
- Element type = DOMUtils.getFirstChildElement(element, Constants.NS_WSDL, "types");
- if (type != null) {
- for (Element schemaElement : DOMUtils.getChildElements(type, Constants.NS_XSD, "schema")) {
- if (!schemaElement.hasAttributeNS(Constants.NS_XMLNS, "jaxb")) {
- schemaElement.setAttributeNS(Constants.NS_XMLNS, "xmlns:jaxb", JAXWSBindingsConstants.NS_JAXB_BINDINGS);
- }
-
- //add jaxb:bindings version info. Lets put it to 1.0, may need to change latter
- if (!schemaElement.hasAttributeNS(JAXWSBindingsConstants.NS_JAXB_BINDINGS, "version")) {
- schemaElement.setAttributeNS(JAXWSBindingsConstants.NS_JAXB_BINDINGS, "jaxb:version", JAXWSBindingsConstants.JAXB_BINDING_VERSION);
- }
- }
- }
- }
-
-
- boolean hasNode = true;
- if ((isJAXWSBindings(bindings) || isJAXBBindings(bindings)) && bindings.getAttributeNode("node") != null) {
- target = evaluateXPathNode(bindings, target, bindings.getAttribute("node"), new NamespaceContextImpl(bindings));
- } else
- if (isJAXWSBindings(bindings) && (bindings.getAttributeNode("node") == null) && !isTopLevelBinding(bindings)) {
- hasNode = false;
- } else
- if (isGlobalBinding(bindings) && !isWSDLDefinition(target) && isTopLevelBinding(bindings.getParentNode())) {
- target = getWSDLDefintionNode(bindings, target);
- }
-
- //if target is null it means the xpath evaluation has some problem,
- // just return
- if (target == null)
- return;
-
- // update the result map
- if (hasNode)
- result.put(bindings, target);
-
- // look for child and process them recursively
- Element[] children = getChildElements(bindings);
- for (Element child : children)
- buildTargetNodeMap(child, target, result);
- }
- */
private NodeList getWSDLDefintionNode(Node bindings, Node target) {
return evaluateXPathMultiNode(bindings, target, "wsdl:definitions",
new NamespaceContext() {
+ @Override
public String getNamespaceURI(String prefix) {
return "http://schemas.xmlsoap.org/wsdl/";
}
+ @Override
public String getPrefix(String nsURI) {
throw new UnsupportedOperationException();
}
+ @Override
public Iterator getPrefixes(String namespaceURI) {
throw new UnsupportedOperationException();
}
@@ -332,8 +236,9 @@
}
private boolean isWSDLDefinition(Node target) {
- if (target == null)
+ if (target == null) {
return false;
+ }
String localName = target.getLocalName();
String nsURI = target.getNamespaceURI();
return fixNull(localName).equals("definitions") && fixNull(nsURI).equals("http://schemas.xmlsoap.org/wsdl/");
@@ -369,43 +274,17 @@
NodeList children = parent.getChildNodes();
for (int i = 0; i < children.getLength(); i++) {
Node item = children.item(i);
- if (!(item instanceof Element)) continue;
-
+ if (!(item instanceof Element)) {
+ continue;
+ }
if (JAXWSBindingsConstants.NS_JAXWS_BINDINGS.equals(item.getNamespaceURI()) ||
- JAXWSBindingsConstants.NS_JAXB_BINDINGS.equals(item.getNamespaceURI()))
+ JAXWSBindingsConstants.NS_JAXB_BINDINGS.equals(item.getNamespaceURI())) {
a.add((Element) item);
+ }
}
return a.toArray(new Element[a.size()]);
}
- private Node evaluateXPathNode(Node bindings, Node target, String expression, NamespaceContext namespaceContext) {
- NodeList nlst;
- try {
- xpath.setNamespaceContext(namespaceContext);
- nlst = (NodeList) xpath.evaluate(expression, target, XPathConstants.NODESET);
- } catch (XPathExpressionException e) {
- reportError((Element) bindings, WsdlMessages.INTERNALIZER_X_PATH_EVALUATION_ERROR(e.getMessage()), e);
- return null; // abort processing this
- }
-
- if (nlst.getLength() == 0) {
- reportError((Element) bindings, WsdlMessages.INTERNALIZER_X_PATH_EVALUATES_TO_NO_TARGET(expression));
- return null; // abort
- }
-
- if (nlst.getLength() != 1) {
- reportError((Element) bindings, WsdlMessages.INTERNALIZER_X_PATH_EVAULATES_TO_TOO_MANY_TARGETS(expression, nlst.getLength()));
- return null; // abort
- }
-
- Node rnode = nlst.item(0);
- if (!(rnode instanceof Element)) {
- reportError((Element) bindings, WsdlMessages.INTERNALIZER_X_PATH_EVALUATES_TO_NON_ELEMENT(expression));
- return null; // abort
- }
- return rnode;
- }
-
private NodeList evaluateXPathMultiNode(Node bindings, Node target, String expression, NamespaceContext namespaceContext) {
NodeList nlst;
try {
@@ -424,35 +303,6 @@
return nlst;
}
- /**
- * Moves JAXWS customizations under their respective target nodes.
- */
- private void move(Element bindings, Map targetNodes) {
- Node target = targetNodes.get(bindings);
- if (target == null)
- // this must be the result of an error on the external binding.
- // recover from the error by ignoring this node
- return;
-
- Element[] children = DOMUtils.getChildElements(bindings);
-
- for (Element item : children) {
- if ("bindings".equals(item.getLocalName())) {
- // process child recursively
- move(item, targetNodes);
- } else if (isGlobalBinding(item)) {
- target = targetNodes.get(item);
- moveUnder(item, (Element) target);
- } else {
- if (!(target instanceof Element)) {
- return; // abort
- }
- // move this node under the target
- moveUnder(item, (Element) target);
- }
- }
- }
-
private boolean isJAXBBindingElement(Element e) {
return fixNull(e.getNamespaceURI()).equals(JAXWSBindingsConstants.NS_JAXB_BINDINGS);
}
@@ -536,8 +386,11 @@
Attr a = (Attr) atts.item(i);
if (Constants.NS_XMLNS.equals(a.getNamespaceURI())) {
String prefix;
- if (a.getName().indexOf(':') == -1) prefix = "";
- else prefix = a.getLocalName();
+ if (a.getName().indexOf(':') == -1) {
+ prefix = "";
+ } else {
+ prefix = a.getLocalName();
+ }
if (inscopes.add(prefix) && p != e) {
// if this is the first time we see this namespace bindings,
@@ -550,8 +403,9 @@
}
}
- if (p.getParentNode() instanceof Document)
+ if (p.getParentNode() instanceof Document) {
break;
+ }
p = (Element) p.getParentNode();
}
@@ -567,15 +421,17 @@
public Element refineSchemaTarget(Element target) {
// look for existing xs:annotation
Element annotation = DOMUtils.getFirstChildElement(target, Constants.NS_XSD, "annotation");
- if (annotation == null)
+ if (annotation == null) {
// none exists. need to make one
annotation = insertXMLSchemaElement(target, "annotation");
+ }
// then look for appinfo
Element appinfo = DOMUtils.getFirstChildElement(annotation, Constants.NS_XSD, "appinfo");
- if (appinfo == null)
+ if (appinfo == null) {
// none exists. need to make one
appinfo = insertXMLSchemaElement(annotation, "appinfo");
+ }
return appinfo;
}
@@ -583,9 +439,10 @@
public Element refineWSDLTarget(Element target) {
// look for existing xs:annotation
Element JAXWSBindings = DOMUtils.getFirstChildElement(target, JAXWSBindingsConstants.NS_JAXWS_BINDINGS, "bindings");
- if (JAXWSBindings == null)
+ if (JAXWSBindings == null) {
// none exists. need to make one
JAXWSBindings = insertJAXWSBindingsElement(target, "bindings");
+ }
return JAXWSBindings;
}
@@ -600,17 +457,21 @@
// the namespace binding.
String qname = parent.getTagName();
int idx = qname.indexOf(':');
- if (idx == -1) qname = localName;
- else qname = qname.substring(0, idx + 1) + localName;
+ if (idx == -1) {
+ qname = localName;
+ } else {
+ qname = qname.substring(0, idx + 1) + localName;
+ }
Element child = parent.getOwnerDocument().createElementNS(Constants.NS_XSD, qname);
NodeList children = parent.getChildNodes();
- if (children.getLength() == 0)
+ if (children.getLength() == 0) {
parent.appendChild(child);
- else
+ } else {
parent.insertBefore(child, children.item(0));
+ }
return child;
}
@@ -622,22 +483,24 @@
NodeList children = parent.getChildNodes();
- if (children.getLength() == 0)
+ if (children.getLength() == 0) {
parent.appendChild(child);
- else
+ } else {
parent.insertBefore(child, children.item(0));
+ }
return child;
}
- private static
@NotNull
- String fixNull(@Nullable String s) {
- if (s == null) return "";
- else return s;
+ static String fixNull(@Nullable String s) {
+ if (s == null) {
+ return "";
+ } else {
+ return s;
+ }
}
-
private void reportError(Element errorSource, String formattedMsg) {
reportError(errorSource, formattedMsg, null);
}
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/JAXWSBindingExtensionHandler.java 2013-04-04 15:26:55.800612590 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/JAXWSBindingExtensionHandler.java 2013-04-04 15:26:55.748612589 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, 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
@@ -40,10 +40,7 @@
import javax.xml.namespace.NamespaceContext;
import javax.xml.namespace.QName;
-import javax.xml.xpath.XPath;
-import javax.xml.xpath.XPathConstants;
-import javax.xml.xpath.XPathExpressionException;
-import javax.xml.xpath.XPathFactory;
+import javax.xml.xpath.*;
import java.util.Iterator;
import java.util.Map;
@@ -56,7 +53,8 @@
*/
public class JAXWSBindingExtensionHandler extends AbstractExtensionHandler {
- private static final XPathFactory xpf = XPathFactory.newInstance();
+ // xml security enabled always, xpath used for parsing "part" attribute
+ private static final XPathFactory xpf = XmlUtil.newXPathFactory(true);
private final XPath xpath = xpf.newXPath();
public JAXWSBindingExtensionHandler(Map extensionHandlerMap) {
@@ -66,6 +64,7 @@
/* (non-Javadoc)
* @see AbstractExtensionHandler#getNamespaceURI()
*/
+ @Override
public String getNamespaceURI() {
return JAXWSBindingsConstants.NS_JAXWS_BINDINGS;
}
@@ -80,8 +79,9 @@
context.registerNamespaces(e);
JAXWSBinding jaxwsBinding = getJAXWSExtension(parent);
- if(jaxwsBinding == null)
+ if(jaxwsBinding == null) {
jaxwsBinding = new JAXWSBinding(context.getLocation(e));
+ }
String attr = XmlUtil.getAttributeOrNull(e, JAXWSBindingsConstants.WSDL_LOCATION_ATTR);
if (attr != null) {
jaxwsBinding.setWsdlLocation(attr);
@@ -99,29 +99,29 @@
for(Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();){
Element e2 = Util.nextElement(iter);
- if (e2 == null)
+ if (e2 == null) {
break;
+ }
- if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.PACKAGE)){
+ if (XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.PACKAGE)) {
parsePackage(context, jaxwsBinding, e2);
- if((jaxwsBinding.getJaxwsPackage() != null) && (jaxwsBinding.getJaxwsPackage().getJavaDoc() != null)){
- ((Definitions)parent).setDocumentation(new Documentation(jaxwsBinding.getJaxwsPackage().getJavaDoc()));
+ if ((jaxwsBinding.getJaxwsPackage() != null) && (jaxwsBinding.getJaxwsPackage().getJavaDoc() != null)) {
+ ((Definitions) parent).setDocumentation(new Documentation(jaxwsBinding.getJaxwsPackage().getJavaDoc()));
}
- }else if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_WRAPPER_STYLE)){
+ } else if (XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_WRAPPER_STYLE)) {
parseWrapperStyle(context, jaxwsBinding, e2);
- }else if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_ASYNC_MAPPING)){
+ } else if (XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_ASYNC_MAPPING)) {
parseAsynMapping(context, jaxwsBinding, e2);
- }
-// else if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_ADDITIONAL_SOAPHEADER_MAPPING)){
-// parseAdditionalSOAPHeaderMapping(context, jaxwsBinding, e2);
-// }
- else if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_MIME_CONTENT)){
+ } // else if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_ADDITIONAL_SOAPHEADER_MAPPING)){
+ // parseAdditionalSOAPHeaderMapping(context, jaxwsBinding, e2);
+ // }
+ else if (XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_MIME_CONTENT)) {
parseMimeContent(context, jaxwsBinding, e2);
- }else{
+ } else {
Util.fail(
- "parsing.invalidExtensionElement",
- e2.getTagName(),
- e2.getNamespaceURI());
+ "parsing.invalidExtensionElement",
+ e2.getTagName(),
+ e2.getNamespaceURI());
return false;
}
}
@@ -150,28 +150,18 @@
*/
private void parseProvider(com.sun.tools.internal.ws.api.wsdl.TWSDLParserContext context, JAXWSBinding parent, Element e) {
String val = e.getTextContent();
- if(val == null)
+ if (val == null) {
return;
- if(val.equals("false") || val.equals("0")){
+ }
+ if (val.equals("false") || val.equals("0")) {
((JAXWSBinding)parent).setProvider(Boolean.FALSE);
- }else if(val.equals("true") || val.equals("1")){
+ } else if(val.equals("true") || val.equals("1")) {
((JAXWSBinding)parent).setProvider(Boolean.TRUE);
}
}
/**
- *
- * @param context
- * @param parent
- * @param e
- */
- private void parseJAXBBindings(com.sun.tools.internal.ws.api.wsdl.TWSDLParserContext context, TWSDLExtensible parent, Element e) {
- JAXWSBinding binding = (JAXWSBinding)parent;
- binding.addJaxbBindings(e);
- }
-
- /**
* @param context
* @param parent
* @param e
@@ -191,12 +181,13 @@
private void parseWrapperStyle(com.sun.tools.internal.ws.api.wsdl.TWSDLParserContext context, JAXWSBinding parent, Element e) {
//System.out.println("In handleWrapperStyleExtension: " + e.getNodeName());
String val = e.getTextContent();
- if(val == null)
+ if (val == null) {
return;
- if(val.equals("false") || val.equals("0")){
- ((JAXWSBinding)parent).setEnableWrapperStyle(Boolean.FALSE);
- }else if(val.equals("true") || val.equals("1")){
- ((JAXWSBinding)parent).setEnableWrapperStyle(Boolean.TRUE);
+ }
+ if (val.equals("false") || val.equals("0")) {
+ ((JAXWSBinding) parent).setEnableWrapperStyle(Boolean.FALSE);
+ } else if (val.equals("true") || val.equals("1")) {
+ ((JAXWSBinding) parent).setEnableWrapperStyle(Boolean.TRUE);
}
}
@@ -225,12 +216,13 @@
private void parseAsynMapping(com.sun.tools.internal.ws.api.wsdl.TWSDLParserContext context, JAXWSBinding parent, Element e) {
//System.out.println("In handleAsynMappingExtension: " + e.getNodeName());
String val = e.getTextContent();
- if(val == null)
+ if (val == null) {
return;
- if(val.equals("false") || val.equals("0")){
- ((JAXWSBinding)parent).setEnableAsyncMapping(Boolean.FALSE);
- }else if(val.equals("true") || val.equals("1")){
- ((JAXWSBinding)parent).setEnableAsyncMapping(Boolean.TRUE);
+ }
+ if (val.equals("false") || val.equals("0")) {
+ ((JAXWSBinding) parent).setEnableAsyncMapping(Boolean.FALSE);
+ } else if (val.equals("true") || val.equals("1")) {
+ ((JAXWSBinding) parent).setEnableAsyncMapping(Boolean.TRUE);
}
}
@@ -242,12 +234,13 @@
private void parseMimeContent(com.sun.tools.internal.ws.api.wsdl.TWSDLParserContext context, JAXWSBinding parent, Element e) {
//System.out.println("In handleMimeContentExtension: " + e.getNodeName());
String val = e.getTextContent();
- if(val == null)
+ if (val == null) {
return;
- if(val.equals("false") || val.equals("0")){
- ((JAXWSBinding)parent).setEnableMimeContentMapping(Boolean.FALSE);
- }else if(val.equals("true") || val.equals("1")){
- ((JAXWSBinding)parent).setEnableMimeContentMapping(Boolean.TRUE);
+ }
+ if (val.equals("false") || val.equals("0")) {
+ ((JAXWSBinding) parent).setEnableMimeContentMapping(Boolean.FALSE);
+ } else if (val.equals("true") || val.equals("1")) {
+ ((JAXWSBinding) parent).setEnableMimeContentMapping(Boolean.TRUE);
}
}
@@ -276,10 +269,9 @@
String partName = XmlUtil.getAttributeOrNull(msgPartElm, "name");
String msgName = XmlUtil.getAttributeOrNull((Element)msgElm, "name");
- if((partName == null) || (msgName == null))
+ if ((partName == null) || (msgName == null)) {
return;
-
- String val = XmlUtil.getAttributeOrNull(msgPartElm, "element");
+ }
String element = XmlUtil.getAttributeOrNull(e, JAXWSBindingsConstants.ELEMENT_ATTR);
String name = XmlUtil.getAttributeOrNull(e, JAXWSBindingsConstants.NAME_ATTR);
@@ -333,28 +325,12 @@
}
- /**
- * @param context
- * @param jaxwsBinding
- * @param e
- */
- private void parseException(com.sun.tools.internal.ws.api.wsdl.TWSDLParserContext context, JAXWSBinding jaxwsBinding, Element e) {
- for(Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();){
- Element e2 = Util.nextElement(iter);
- if (e2 == null)
- break;
- if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.CLASS)){
- String className = XmlUtil.getAttributeOrNull(e2, JAXWSBindingsConstants.NAME_ATTR);
- String javaDoc = getJavaDoc(e2);
- jaxwsBinding.setException(new com.sun.tools.internal.ws.wsdl.document.jaxws.Exception(new CustomName(className, javaDoc)));
- }
- }
- }
-
+ @Override
public boolean handleDefinitionsExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
return parseGlobalJAXWSBindings(context, parent, e);
}
+ @Override
public boolean handlePortTypeExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
if(XmlUtil.matchesTagNS(e, JAXWSBindingsConstants.JAXWS_BINDINGS)){
context.push();
@@ -363,23 +339,24 @@
for(Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();){
Element e2 = Util.nextElement(iter);
- if (e2 == null)
+ if (e2 == null) {
break;
+ }
- if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_WRAPPER_STYLE)){
+ if (XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_WRAPPER_STYLE)) {
parseWrapperStyle(context, jaxwsBinding, e2);
- }else if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_ASYNC_MAPPING)){
+ } else if (XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_ASYNC_MAPPING)) {
parseAsynMapping(context, jaxwsBinding, e2);
- }else if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.CLASS)){
+ } else if (XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.CLASS)) {
parseClass(context, jaxwsBinding, e2);
- if((jaxwsBinding.getClassName() != null) && (jaxwsBinding.getClassName().getJavaDoc() != null)){
- ((PortType)parent).setDocumentation(new Documentation(jaxwsBinding.getClassName().getJavaDoc()));
+ if ((jaxwsBinding.getClassName() != null) && (jaxwsBinding.getClassName().getJavaDoc() != null) && (parent instanceof PortType)) {
+ ((PortType) parent).setDocumentation(new Documentation(jaxwsBinding.getClassName().getJavaDoc()));
}
- }else{
+ } else {
Util.fail(
- "parsing.invalidExtensionElement",
- e2.getTagName(),
- e2.getNamespaceURI());
+ "parsing.invalidExtensionElement",
+ e2.getTagName(),
+ e2.getNamespaceURI());
return false;
}
}
@@ -398,6 +375,7 @@
}
}
+ @Override
public boolean handleOperationExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
if(XmlUtil.matchesTagNS(e, JAXWSBindingsConstants.JAXWS_BINDINGS)){
if(parent instanceof Operation){
@@ -423,8 +401,9 @@
for(Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();){
Element e2 = Util.nextElement(iter);
- if (e2 == null)
+ if (e2 == null) {
break;
+ }
// if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_ADDITIONAL_SOAPHEADER_MAPPING)){
// parseAdditionalSOAPHeaderMapping(context, jaxwsBinding, e2);
@@ -463,8 +442,9 @@
for(Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();){
Element e2 = Util.nextElement(iter);
- if (e2 == null)
+ if (e2 == null) {
break;
+ }
if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_WRAPPER_STYLE)){
parseWrapperStyle(context, jaxwsBinding, e2);
@@ -493,6 +473,7 @@
return true;
}
+ @Override
public boolean handleBindingExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
if(XmlUtil.matchesTagNS(e, JAXWSBindingsConstants.JAXWS_BINDINGS)){
context.push();
@@ -501,8 +482,9 @@
for(Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();){
Element e2 = Util.nextElement(iter);
- if (e2 == null)
+ if (e2 == null) {
break;
+ }
// if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_ADDITIONAL_SOAPHEADER_MAPPING)){
// parseAdditionalSOAPHeaderMapping(context, jaxwsBinding, e2);
@@ -535,6 +517,7 @@
/* (non-Javadoc)
* @see ExtensionHandlerBase#handleFaultExtension(TWSDLParserContextImpl, TWSDLExtensible, org.w3c.dom.Element)
*/
+ @Override
public boolean handleFaultExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
if(XmlUtil.matchesTagNS(e, JAXWSBindingsConstants.JAXWS_BINDINGS)){
context.push();
@@ -543,8 +526,9 @@
for(Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();){
Element e2 = Util.nextElement(iter);
- if (e2 == null)
+ if (e2 == null) {
break;
+ }
if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.CLASS)){
parseClass(context, jaxwsBinding, e2);
if((jaxwsBinding.getClassName() != null) && (jaxwsBinding.getClassName().getJavaDoc() != null)){
@@ -573,6 +557,7 @@
}
}
+ @Override
public boolean handleServiceExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
if(XmlUtil.matchesTagNS(e, JAXWSBindingsConstants.JAXWS_BINDINGS)){
context.push();
@@ -581,8 +566,9 @@
for(Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();){
Element e2 = Util.nextElement(iter);
- if (e2 == null)
+ if (e2 == null) {
break;
+ }
if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.CLASS)){
parseClass(context, jaxwsBinding, e2);
if((jaxwsBinding.getClassName() != null) && (jaxwsBinding.getClassName().getJavaDoc() != null)){
@@ -611,6 +597,7 @@
}
}
+ @Override
public boolean handlePortExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
if(XmlUtil.matchesTagNS(e, JAXWSBindingsConstants.JAXWS_BINDINGS)){
context.push();
@@ -619,8 +606,9 @@
for(Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();){
Element e2 = Util.nextElement(iter);
- if (e2 == null)
+ if (e2 == null) {
break;
+ }
if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.PROVIDER)){
parseProvider(context, jaxwsBinding, e2);
@@ -655,8 +643,9 @@
private String getJavaDoc(Element e){
for(Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();){
Element e2 = Util.nextElement(iter);
- if (e2 == null)
+ if (e2 == null) {
break;
+ }
if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.JAVADOC)){
return XmlUtil.getTextForNode(e2);
}
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/MIMEExtensionHandler.java 2013-04-04 15:26:56.016612593 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/MIMEExtensionHandler.java 2013-04-04 15:26:55.972612592 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/MemberSubmissionAddressingExtensionHandler.java 2013-04-04 15:26:56.248612597 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/MemberSubmissionAddressingExtensionHandler.java 2013-04-04 15:26:56.196612596 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -27,23 +27,35 @@
import com.sun.tools.internal.ws.api.wsdl.TWSDLExtensible;
import com.sun.tools.internal.ws.api.wsdl.TWSDLParserContext;
+import com.sun.tools.internal.ws.resources.ModelerMessages;
+import com.sun.tools.internal.ws.resources.WsdlMessages;
+import com.sun.tools.internal.ws.util.xml.XmlUtil;
import com.sun.tools.internal.ws.wscompile.ErrorReceiver;
+import com.sun.tools.internal.ws.wsdl.document.Fault;
+import com.sun.tools.internal.ws.wsdl.document.Input;
+import com.sun.tools.internal.ws.wsdl.document.Output;
+import com.sun.xml.internal.ws.addressing.W3CAddressingMetadataConstants;
import com.sun.xml.internal.ws.api.addressing.AddressingVersion;
import org.w3c.dom.Element;
+import org.xml.sax.Locator;
import javax.xml.namespace.QName;
import java.util.Map;
+import static com.sun.xml.internal.ws.addressing.v200408.MemberSubmissionAddressingConstants.WSA_ACTION_QNAME;
+
/**
* @author Arun Gupta
*/
public class MemberSubmissionAddressingExtensionHandler extends W3CAddressingExtensionHandler {
- public MemberSubmissionAddressingExtensionHandler(Map extensionHandlerMap) {
- super(extensionHandlerMap);
- }
- public MemberSubmissionAddressingExtensionHandler(Map extensionHandlerMap, ErrorReceiver env) {
+ private ErrorReceiver errReceiver;
+ private boolean extensionModeOn;
+
+ public MemberSubmissionAddressingExtensionHandler(Map extensionHandlerMap, ErrorReceiver env, boolean extensionModeOn) {
super(extensionHandlerMap, env);
+ this.errReceiver = env;
+ this.extensionModeOn = extensionModeOn;
}
@Override
@@ -61,4 +73,67 @@
return false;
}
+ @Override
+ public boolean handleInputExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
+ if (extensionModeOn) {
+ warn(context.getLocation(e));
+ String actionValue = XmlUtil.getAttributeNSOrNull(e, WSA_ACTION_QNAME);
+ if (actionValue == null || actionValue.equals("")) {
+ return warnEmptyAction(parent, context.getLocation(e));
+ }
+ ((Input) parent).setAction(actionValue);
+ return true;
+ } else {
+ return fail(context.getLocation(e));
+ }
+ }
+
+ private boolean fail(Locator location) {
+ errReceiver.warning(location,
+ ModelerMessages.WSDLMODELER_INVALID_IGNORING_MEMBER_SUBMISSION_ADDRESSING(
+ AddressingVersion.MEMBER.nsUri, W3CAddressingMetadataConstants.WSAM_NAMESPACE_NAME));
+ return false;
+ }
+
+ private void warn(Locator location) {
+ errReceiver.warning(location,
+ ModelerMessages.WSDLMODELER_WARNING_MEMBER_SUBMISSION_ADDRESSING_USED(
+ AddressingVersion.MEMBER.nsUri, W3CAddressingMetadataConstants.WSAM_NAMESPACE_NAME));
+ }
+
+ @Override
+ public boolean handleOutputExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
+ if (extensionModeOn) {
+ warn(context.getLocation(e));
+ String actionValue = XmlUtil.getAttributeNSOrNull(e, WSA_ACTION_QNAME);
+ if (actionValue == null || actionValue.equals("")) {
+ return warnEmptyAction(parent, context.getLocation(e));
+ }
+ ((Output) parent).setAction(actionValue);
+ return true;
+ } else {
+ return fail(context.getLocation(e));
+ }
+ }
+
+ @Override
+ public boolean handleFaultExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
+ if (extensionModeOn) {
+ warn(context.getLocation(e));
+ String actionValue = XmlUtil.getAttributeNSOrNull(e, WSA_ACTION_QNAME);
+ if (actionValue == null || actionValue.equals("")) {
+ errReceiver.warning(context.getLocation(e), WsdlMessages.WARNING_FAULT_EMPTY_ACTION(parent.getNameValue(), parent.getWSDLElementName().getLocalPart(), parent.getParent().getNameValue()));
+ return false; // keep compiler happy
+ }
+ ((Fault) parent).setAction(actionValue);
+ return true;
+ } else {
+ return fail(context.getLocation(e));
+ }
+ }
+
+ private boolean warnEmptyAction(TWSDLExtensible parent, Locator pos) {
+ errReceiver.warning(pos, WsdlMessages.WARNING_INPUT_OUTPUT_EMPTY_ACTION(parent.getWSDLElementName().getLocalPart(), parent.getParent().getNameValue()));
+ return false;
+ }
}
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/MetadataFinder.java 2013-04-04 15:26:56.512612601 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/MetadataFinder.java 2013-04-04 15:26:56.456612600 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, 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
@@ -30,7 +30,6 @@
import com.sun.tools.internal.ws.resources.WscompileMessages;
import com.sun.tools.internal.ws.resources.WsdlMessages;
import com.sun.tools.internal.ws.wscompile.AbortException;
-import com.sun.tools.internal.ws.wscompile.DefaultAuthenticator;
import com.sun.tools.internal.ws.wscompile.ErrorReceiver;
import com.sun.tools.internal.ws.wscompile.WsimportOptions;
import com.sun.tools.internal.ws.wsdl.document.WSDLConstants;
@@ -69,28 +68,31 @@
public boolean isMexMetadata;
private String rootWSDL;
- private Set rootWsdls = new HashSet();
+ private final Set rootWsdls = new HashSet();
public MetadataFinder(InternalizationLogic logic, WsimportOptions options, ErrorReceiver errReceiver) {
super(logic, new WSEntityResolver(options,errReceiver), options, errReceiver);
}
+ @SuppressWarnings("element-type-mismatch")
public void parseWSDL(){
// parse source grammars
for (InputSource value : options.getWSDLs()) {
String systemID = value.getSystemId();
errorReceiver.pollAbort();
- Document dom ;
- Element doc = null;
+ Document dom;
+ Element doc;
try {
- //if there is entity resolver use it
- if (options.entityResolver != null)
- value = options.entityResolver.resolveEntity(null, systemID);
- if (value == null)
- value = new InputSource(systemID);
+ //if there is entity resolver use it
+ if (options.entityResolver != null) {
+ value = options.entityResolver.resolveEntity(null, systemID);
+ }
+ if (value == null) {
+ value = new InputSource(systemID);
+ }
dom = parse(value, true);
doc = dom.getDocumentElement();
@@ -100,9 +102,9 @@
//if its not a WSDL document, retry with MEX
if (doc.getNamespaceURI() == null || !doc.getNamespaceURI().equals(WSDLConstants.NS_WSDL) || !doc.getLocalName().equals("definitions")) {
throw new SAXParseException(WsdlMessages.INVALID_WSDL(systemID,
- com.sun.xml.internal.ws.wsdl.parser.WSDLConstants.QNAME_DEFINITIONS, doc.getNodeName(), locatorTable.getStartLocation(doc).getLineNumber()), locatorTable.getStartLocation(doc));
+ com.sun.xml.internal.ws.wsdl.parser.WSDLConstants.QNAME_DEFINITIONS, doc.getNodeName(), locatorTable.getStartLocation(doc).getLineNumber()), locatorTable.getStartLocation(doc));
}
- } catch(FileNotFoundException e){
+ } catch (FileNotFoundException e) {
errorReceiver.error(WsdlMessages.FILE_NOT_FOUND(systemID), e);
return;
} catch (IOException e) {
@@ -119,24 +121,27 @@
NodeList schemas = doc.getElementsByTagNameNS(SchemaConstants.NS_XSD, "schema");
for (int i = 0; i < schemas.getLength(); i++) {
- if(!inlinedSchemaElements.contains(schemas.item(i)))
+ if (!inlinedSchemaElements.contains(schemas.item(i))) {
inlinedSchemaElements.add((Element) schemas.item(i));
+ }
}
}
identifyRootWsdls();
}
public static class WSEntityResolver implements EntityResolver {
- EntityResolver parentResolver;
WsimportOptions options;
ErrorReceiver errorReceiver;
+ private URLConnection c = null;
+ private boolean doReset = false;
+
public WSEntityResolver(WsimportOptions options, ErrorReceiver errReceiver) {
- this.parentResolver = options.entityResolver;
this.options = options;
this.errorReceiver = errReceiver;
}
+ @Override
public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
InputSource inputSource = null;
@@ -161,6 +166,14 @@
((HttpURLConnection) conn).setInstanceFollowRedirects(false);
}
+ if (conn instanceof JarURLConnection) {
+ if (conn.getUseCaches()) {
+ doReset = true;
+ conn.setDefaultUseCaches(false);
+ c = conn;
+ }
+ }
+
try {
is = conn.getInputStream();
//is = sun.net.www.protocol.http.HttpURLConnection.openConnectionCheckRedirects(conn);
@@ -170,7 +183,7 @@
int code = httpConn.getResponseCode();
if (code == 401) {
errorReceiver.error(new SAXParseException(WscompileMessages.WSIMPORT_AUTH_INFO_NEEDED(e.getMessage(),
- systemId, DefaultAuthenticator.defaultAuthfile), null, e));
+ systemId, WsimportOptions.defaultAuthfile), null, e));
throw new AbortException();
}
//FOR other code we will retry with MEX
@@ -211,11 +224,19 @@
return inputSource;
}
+ @Override
+ protected void finalize() throws Throwable {
+ //see http://java.net/jira/browse/JAX_WS-1087
+ if (doReset) {
+ c.setDefaultUseCaches(true);
+ }
+ }
}
// overide default SSL HttpClientVerifier to always return true
// effectively overiding Hostname client verification when using SSL
private static class HttpClientVerifier implements HostnameVerifier {
+ @Override
public boolean verify(String s, SSLSession sslSession) {
return true;
}
@@ -263,7 +284,7 @@
}
//no wsdl with wsdl:service found, throw error
if(rootWSDL == null){
- StringBuffer strbuf = new StringBuffer();
+ StringBuilder strbuf = new StringBuilder();
for(String str : rootWsdls){
strbuf.append(str);
strbuf.append('\n');
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/NamespaceContextImpl.java 2013-04-04 15:26:56.732612605 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/NamespaceContextImpl.java 2013-04-04 15:26:56.684612604 +0200
@@ -3,7 +3,7 @@
* DO NOT REMOVE OR ALTER!
*/
/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/Policy12ExtensionHandler.java 2013-04-04 15:26:56.952612608 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/Policy12ExtensionHandler.java 2013-04-04 15:26:56.900612607 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/Policy15ExtensionHandler.java 2013-04-04 15:26:57.212612612 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/Policy15ExtensionHandler.java 2013-04-04 15:26:57.160612611 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/SOAP12ExtensionHandler.java 2013-04-04 15:26:57.468612615 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/SOAP12ExtensionHandler.java 2013-04-04 15:26:57.416612615 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/SOAPEntityReferenceValidator.java 2013-04-04 15:26:57.728612620 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/SOAPEntityReferenceValidator.java 2013-04-04 15:26:57.672612619 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/SOAPExtensionHandler.java 2013-04-04 15:26:57.968612624 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/SOAPExtensionHandler.java 2013-04-04 15:26:57.908612623 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -232,125 +232,108 @@
// context.fireDoneParsingEntity(getBodyQName(), body);
return true;
} else if (XmlUtil.matchesTagNS(e, getHeaderQName())) {
- context.push();
- context.registerNamespaces(e);
-
- SOAPHeader header = new SOAPHeader(context.getLocation(e));
+ return handleHeaderElement(parent, e, context);
+ } else {
+ Util.fail("parsing.invalidExtensionElement", e.getTagName(), e.getNamespaceURI());
+ return false; // keep compiler happy
+ }
+ }
- String use = XmlUtil.getAttributeOrNull(e, Constants.ATTR_USE);
- if (use != null) {
- if (use.equals(Constants.ATTRVALUE_LITERAL)) {
- header.setUse(SOAPUse.LITERAL);
- } else if (use.equals(Constants.ATTRVALUE_ENCODED)) {
- header.setUse(SOAPUse.ENCODED);
- } else {
- Util.fail(
- "parsing.invalidAttributeValue",
- Constants.ATTR_USE,
- use);
- }
+ private boolean handleHeaderElement(TWSDLExtensible parent, Element e, TWSDLParserContextImpl context) {
+ context.push();
+ context.registerNamespaces(e);
+
+ SOAPHeader header = new SOAPHeader(context.getLocation(e));
+
+ String use = XmlUtil.getAttributeOrNull(e, Constants.ATTR_USE);
+ if (use != null) {
+ if (use.equals(Constants.ATTRVALUE_LITERAL)) {
+ header.setUse(SOAPUse.LITERAL);
+ } else if (use.equals(Constants.ATTRVALUE_ENCODED)) {
+ header.setUse(SOAPUse.ENCODED);
+ } else {
+ Util.fail("parsing.invalidAttributeValue", Constants.ATTR_USE, use);
}
+ }
- String namespace =
- XmlUtil.getAttributeOrNull(e, Constants.ATTR_NAMESPACE);
- if (namespace != null) {
- header.setNamespace(namespace);
+ String namespace = XmlUtil.getAttributeOrNull(e, Constants.ATTR_NAMESPACE);
+ if (namespace != null) {
+ header.setNamespace(namespace);
+ }
+
+ String encodingStyle = XmlUtil.getAttributeOrNull(e, Constants.ATTR_ENCODING_STYLE);
+ if (encodingStyle != null) {
+ header.setEncodingStyle(encodingStyle);
+ }
+
+ String part = XmlUtil.getAttributeOrNull(e, Constants.ATTR_PART);
+ if (part != null) {
+ header.setPart(part);
+ }
+
+ String messageAttr = XmlUtil.getAttributeOrNull(e, Constants.ATTR_MESSAGE);
+ if (messageAttr != null) {
+ header.setMessage(context.translateQualifiedName(context.getLocation(e), messageAttr));
+ }
+
+ for (Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();) {
+ Element e2 = Util.nextElement(iter);
+ if (e2 == null)
+ break;
+
+ if (XmlUtil.matchesTagNS(e2, getHeaderfaultQName())) {
+ handleHeaderFaultElement(e, context, header, use, e2);
+ } else {
+ Util.fail("parsing.invalidElement", e2.getTagName(), e2.getNamespaceURI());
}
+ }
- String encodingStyle =
- XmlUtil.getAttributeOrNull(e, Constants.ATTR_ENCODING_STYLE);
- if (encodingStyle != null) {
- header.setEncodingStyle(encodingStyle);
+ parent.addExtension(header);
+ context.pop();
+ context.fireDoneParsingEntity(getHeaderQName(), header);
+ return true;
+ }
+
+ private void handleHeaderFaultElement(Element e, TWSDLParserContextImpl context, SOAPHeader header, String use, Element e2) {
+ context.push();
+ context.registerNamespaces(e);
+
+ SOAPHeaderFault headerfault = new SOAPHeaderFault(context.getLocation(e));
+
+ String use2 = XmlUtil.getAttributeOrNull(e2, Constants.ATTR_USE);
+ if (use2 != null) {
+ if (use2.equals(Constants.ATTRVALUE_LITERAL)) {
+ headerfault.setUse(SOAPUse.LITERAL);
+ } else if (use.equals(Constants.ATTRVALUE_ENCODED)) {
+ headerfault.setUse(SOAPUse.ENCODED);
+ } else {
+ Util.fail("parsing.invalidAttributeValue", Constants.ATTR_USE, use2);
}
+ }
- String part = XmlUtil.getAttributeOrNull(e, Constants.ATTR_PART);
- if (part != null) {
- header.setPart(part);
- }
-
- String messageAttr =
- XmlUtil.getAttributeOrNull(e, Constants.ATTR_MESSAGE);
- if (messageAttr != null) {
- header.setMessage(context.translateQualifiedName(context.getLocation(e), messageAttr));
- }
-
- for (Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();) {
- Element e2 = Util.nextElement(iter);
- if (e2 == null)
- break;
-
- if (XmlUtil
- .matchesTagNS(e2, getHeaderfaultQName())) {
- context.push();
- context.registerNamespaces(e);
-
- SOAPHeaderFault headerfault = new SOAPHeaderFault(context.getLocation(e));
-
- String use2 =
- XmlUtil.getAttributeOrNull(e2, Constants.ATTR_USE);
- if (use2 != null) {
- if (use2.equals(Constants.ATTRVALUE_LITERAL)) {
- headerfault.setUse(SOAPUse.LITERAL);
- } else if (use.equals(Constants.ATTRVALUE_ENCODED)) {
- headerfault.setUse(SOAPUse.ENCODED);
- } else {
- Util.fail(
- "parsing.invalidAttributeValue",
- Constants.ATTR_USE,
- use2);
- }
- }
-
- String namespace2 =
- XmlUtil.getAttributeOrNull(
- e2,
- Constants.ATTR_NAMESPACE);
- if (namespace2 != null) {
- headerfault.setNamespace(namespace2);
- }
-
- String encodingStyle2 =
- XmlUtil.getAttributeOrNull(
- e2,
- Constants.ATTR_ENCODING_STYLE);
- if (encodingStyle2 != null) {
- headerfault.setEncodingStyle(encodingStyle2);
- }
-
- String part2 =
- XmlUtil.getAttributeOrNull(e2, Constants.ATTR_PART);
- if (part2 != null) {
- headerfault.setPart(part2);
- }
-
- String messageAttr2 =
- XmlUtil.getAttributeOrNull(e2, Constants.ATTR_MESSAGE);
- if (messageAttr2 != null) {
- headerfault.setMessage(
- context.translateQualifiedName(context.getLocation(e2), messageAttr2));
- }
+ String namespace2 = XmlUtil.getAttributeOrNull(e2, Constants.ATTR_NAMESPACE);
+ if (namespace2 != null) {
+ headerfault.setNamespace(namespace2);
+ }
- header.add(headerfault);
- context.pop();
- } else {
- Util.fail(
- "parsing.invalidElement",
- e2.getTagName(),
- e2.getNamespaceURI());
- }
- }
+ String encodingStyle2 = XmlUtil.getAttributeOrNull(e2, Constants.ATTR_ENCODING_STYLE);
+ if (encodingStyle2 != null) {
+ headerfault.setEncodingStyle(encodingStyle2);
+ }
- parent.addExtension(header);
- context.pop();
- context.fireDoneParsingEntity(getHeaderQName(), header);
- return true;
- } else {
- Util.fail(
- "parsing.invalidExtensionElement",
- e.getTagName(),
- e.getNamespaceURI());
- return false; // keep compiler happy
+ String part2 = XmlUtil.getAttributeOrNull(e2, Constants.ATTR_PART);
+ if (part2 != null) {
+ headerfault.setPart(part2);
+ }
+
+ String messageAttr2 = XmlUtil.getAttributeOrNull(e2, Constants.ATTR_MESSAGE);
+ if (messageAttr2 != null) {
+ headerfault.setMessage(
+ context.translateQualifiedName(context.getLocation(e2), messageAttr2));
}
+
+ header.add(headerfault);
+ context.pop();
}
public boolean handleFaultExtension(
@@ -398,6 +381,10 @@
context.pop();
// context.fireDoneParsingEntity(getFaultQName(), fault);
return true;
+ } else if (XmlUtil.matchesTagNS(e, getHeaderQName())) {
+ // although SOAP spec doesn't define meaning of this extension; it is allowed
+ // to be here, so we have to accept it, not fail (bug 13576977)
+ return handleHeaderElement(parent, e, (TWSDLParserContextImpl) context);
} else {
Util.fail(
"parsing.invalidExtensionElement",
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/Util.java 2013-04-04 15:26:58.244612628 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/Util.java 2013-04-04 15:26:58.180612627 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/VersionChecker.java 2013-04-04 15:26:58.476612631 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/VersionChecker.java 2013-04-04 15:26:58.412612630 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/W3CAddressingExtensionHandler.java 2013-04-04 15:26:58.736612635 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/W3CAddressingExtensionHandler.java 2013-04-04 15:26:58.676612635 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/W3CAddressingMetadataExtensionHandler.java 2013-04-04 15:26:58.976612639 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/W3CAddressingMetadataExtensionHandler.java 2013-04-04 15:26:58.928612638 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/WSDLInternalizationLogic.java 2013-04-04 15:26:59.196612643 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/WSDLInternalizationLogic.java 2013-04-04 15:26:59.148612642 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, 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
@@ -25,7 +25,6 @@
package com.sun.tools.internal.ws.wsdl.parser;
-import com.sun.tools.internal.ws.wscompile.WsimportOptions;
import com.sun.tools.internal.ws.wsdl.document.WSDLConstants;
import com.sun.tools.internal.ws.wsdl.document.jaxws.JAXWSBindingsConstants;
import com.sun.tools.internal.ws.wsdl.document.schema.SchemaConstants;
@@ -49,11 +48,12 @@
super(parent);
}
+ @Override
protected String findExternalResource( String nsURI, String localName, Attributes atts) {
if(WSDLConstants.NS_WSDL.equals(nsURI) && "import".equals(localName)){
- if(parent.isExtensionMode()){
- //TODO: add support for importing schema using wsdl:import
- }
+// if(parent.isExtensionMode()){
+// //TODO: add support for importing schema using wsdl:import
+// }
return atts.getValue("location");
}
@@ -67,14 +67,17 @@
return null;
}
}
+ @Override
public XMLFilterImpl createExternalReferenceFinder(DOMForest parent) {
return new ReferenceFinder(parent);
}
+ @Override
public boolean checkIfValidTargetNode(DOMForest parent, Element bindings, Element target) {
return false;
}
+ @Override
public Element refineSchemaTarget(Element target) {
// look for existing xs:annotation
Element annotation = DOMUtils.getFirstChildElement(target, Constants.NS_XSD, "annotation");
@@ -92,6 +95,7 @@
}
+ @Override
public Element refineWSDLTarget(Element target){
// look for existing xs:annotation
Element JAXWSBindings = DOMUtils.getFirstChildElement(target, JAXWSBindingsConstants.NS_JAXWS_BINDINGS, "bindings");
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/WSDLParser.java 2013-04-04 15:26:59.396612646 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/WSDLParser.java 2013-04-04 15:26:59.344612645 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, 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
@@ -58,11 +58,9 @@
import com.sun.tools.internal.ws.wsdl.framework.ParserListener;
import com.sun.tools.internal.ws.wsdl.framework.TWSDLParserContextImpl;
import com.sun.xml.internal.ws.util.ServiceFinder;
-
import org.w3c.dom.Attr;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
-import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;
import org.xml.sax.Locator;
@@ -73,6 +71,7 @@
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
+import org.w3c.dom.Node;
/**
* A parser for WSDL documents. This parser is used only at the tool time.
@@ -101,9 +100,10 @@
if (forest == null) {
forest = new MetadataFinder(new WSDLInternalizationLogic(), options, errReceiver);
forest.parseWSDL();
- if (forest.isMexMetadata)
+ if (forest.isMexMetadata) {
errReceiver.reset();
}
+ }
this.forest = forest;
// register handlers for default extensions
register(new SOAPExtensionHandler(extensionHandlers));
@@ -111,7 +111,10 @@
register(new MIMEExtensionHandler(extensionHandlers));
register(new JAXWSBindingExtensionHandler(extensionHandlers));
register(new SOAP12ExtensionHandler(extensionHandlers));
- register(new MemberSubmissionAddressingExtensionHandler(extensionHandlers, errReceiver));
+
+ // MemberSubmission Addressing not supported by WsImport anymore see JAX_WS-1040 for details
+ //register(new MemberSubmissionAddressingExtensionHandler(extensionHandlers, errReceiver, options.isExtensionMode()));
+
register(new W3CAddressingExtensionHandler(extensionHandlers, errReceiver));
register(new W3CAddressingMetadataExtensionHandler(extensionHandlers, errReceiver));
register(new Policy12ExtensionHandler());
@@ -144,7 +147,7 @@
Document root = forest.parse(value, false);
if(root==null) continue; // error must have been reported
Element binding = root.getDocumentElement();
- if (!fixNull(binding.getNamespaceURI()).equals(JAXWSBindingsConstants.NS_JAXWS_BINDINGS)
+ if (!Internalizer.fixNull(binding.getNamespaceURI()).equals(JAXWSBindingsConstants.NS_JAXWS_BINDINGS)
|| !binding.getLocalName().equals("bindings")){
errReceiver.error(forest.locatorTable.getStartLocation(binding), WsdlMessages.PARSER_NOT_A_BINDING_FILE(
binding.getNamespaceURI(),
@@ -162,11 +165,6 @@
return buildWSDLDocument();
}
- private String fixNull(String s) {
- if(s==null) return "";
- else return s;
- }
-
public MetadataFinder getDOMForest() {
return forest;
}
@@ -203,13 +201,6 @@
new Internalizer(forest, options, errReceiver).transform();
- //print the wsdl
-// try{
-// forest.dump(System.out);
-// }catch(IOException e){
-// e.printStackTrace();
-// }
-
Definitions definitions = parseDefinitionsNoImport(context, root);
if(definitions == null){
Locator locator = forest.locatorTable.getStartLocation(root.getDocumentElement());
@@ -221,20 +212,6 @@
return definitions;
}
- private void processMexDocs(TWSDLParserContextImpl context){
- for(String location : forest.listSystemIDs()){
- if (!context.getDocument().isImportedDocument(location)){
- Document doc = forest.get(location);
- if(doc == null)
- continue;
- Definitions importedDefinitions = parseDefinitionsNoImport(context, doc);
- if(importedDefinitions == null)
- continue;
- context.getDocument().addImportedEntity(importedDefinitions);
- context.getDocument().addImportedDocument(location);
- }
- }
- }
private void processImports(TWSDLParserContextImpl context) {
for(String location : forest.getExternalReferences()){
if (!context.getDocument().isImportedDocument(location)){
@@ -520,10 +497,7 @@
// possible extensibility element -- must live outside the WSDL namespace
checkNotWsdlAttribute(e3);
- if (!handleExtension(context, input, e3, e2)) {
- // ignore the extensiblity attribute
- // TODO throw a WARNING
- }
+ handleExtension(context, input, e3, e2);
}
// verify that there is at most one child element and it is a documentation element
@@ -582,10 +556,7 @@
// possible extensibility element -- must live outside the WSDL namespace
checkNotWsdlAttribute(e3);
- if (!handleExtension(context, output, e3, e2)) {
- // ignore the extensiblity attribute
- // TODO throw a WARNING
- }
+ handleExtension(context, output, e3, e2);
}
// verify that there is at most one child element and it is a documentation element
@@ -635,10 +606,7 @@
// possible extensibility element -- must live outside the WSDL namespace
checkNotWsdlAttribute(e3);
- if (!handleExtension(context, fault, e3, e2)) {
- // ignore the extensiblity attribute
- // TODO throw a WARNING
- }
+ handleExtension(context, fault, e3, e2);
}
// verify that there is at most one child element and it is a documentation element
@@ -780,7 +748,6 @@
}
/* Here we check for the use scenario */
- Iterator itere2 = XmlUtil.getAllChildren(e2);
context.push();
context.registerNamespaces(e2);
BindingInput input = new BindingInput(forest.locatorTable.getStartLocation(e2));
@@ -984,8 +951,9 @@
errReceiver.error(forest.locatorTable.getStartLocation(e), WsdlMessages.PARSING_ONLY_ONE_DOCUMENTATION_ALLOWED(e.getLocalName()));
}
gotDocumentation = true;
- if(service.getDocumentation() == null)
+ if (service.getDocumentation() == null) {
service.setDocumentation(getDocumentationFor(e2));
+ }
} else if (XmlUtil.matchesTagNS(e2, WSDLConstants.QNAME_PORT)) {
Port port = parsePort(context, definitions, e2);
service.add(port);
@@ -1022,16 +990,18 @@
for (Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();) {
Element e2 = Util.nextElement(iter);
- if (e2 == null)
+ if (e2 == null) {
break;
+ }
if (XmlUtil.matchesTagNS(e2, WSDLConstants.QNAME_DOCUMENTATION)) {
if (gotDocumentation) {
errReceiver.error(forest.locatorTable.getStartLocation(e), WsdlMessages.PARSING_ONLY_ONE_DOCUMENTATION_ALLOWED(e.getLocalName()));
}
gotDocumentation = true;
- if(port.getDocumentation() == null)
+ if (port.getDocumentation() == null) {
port.setDocumentation(getDocumentationFor(e2));
+ }
} else {
// possible extensibility element -- must live outside the WSDL namespace
checkNotWsdlElement(e2);
@@ -1049,8 +1019,9 @@
private void validateSchemaImports(Element typesElement){
for (Iterator iter = XmlUtil.getAllChildren(typesElement); iter.hasNext();) {
Element e = Util.nextElement(iter);
- if (e == null)
+ if (e == null) {
break;
+ }
if (XmlUtil.matchesTagNS(e, SchemaConstants.QNAME_IMPORT)) {
errReceiver.warning(forest.locatorTable.getStartLocation(e), WsdlMessages.WARNING_WSI_R_2003());
}else{
@@ -1072,6 +1043,7 @@
(TWSDLExtensionHandler) extensionHandlers.get(e.getNamespaceURI());
if (h == null) {
context.fireIgnoringExtension(e, (Entity) entity);
+ errReceiver.warning(forest.locatorTable.getStartLocation(e), WsdlMessages.PARSING_UNKNOWN_EXTENSIBILITY_ELEMENT_OR_ATTRIBUTE(e.getLocalName(), e.getNamespaceURI()));
return false;
} else {
return h.doHandleExtension(context, entity, e);
@@ -1087,6 +1059,7 @@
(TWSDLExtensionHandler) extensionHandlers.get(n.getNamespaceURI());
if (h == null) {
context.fireIgnoringExtension(e, (Entity) entity);
+ errReceiver.warning(forest.locatorTable.getStartLocation(e), WsdlMessages.PARSING_UNKNOWN_EXTENSIBILITY_ELEMENT_OR_ATTRIBUTE(n.getLocalName(), n.getNamespaceURI()));
return false;
} else {
return h.doHandleExtension(context, entity, e);
@@ -1095,15 +1068,17 @@
private void checkNotWsdlElement(Element e) {
// possible extensibility element -- must live outside the WSDL namespace
- if (e.getNamespaceURI() != null && e.getNamespaceURI().equals(Constants.NS_WSDL))
+ if (e.getNamespaceURI() != null && e.getNamespaceURI().equals(Constants.NS_WSDL)) {
errReceiver.error(forest.locatorTable.getStartLocation(e), WsdlMessages.PARSING_INVALID_WSDL_ELEMENT(e.getTagName()));
}
+ }
private void checkNotWsdlAttribute(Attr a) {
// possible extensibility element -- must live outside the WSDL namespace
- if (a.getNamespaceURI().equals(Constants.NS_WSDL))
+ if (Constants.NS_WSDL.equals(a.getNamespaceURI())) {
errReceiver.error(forest.locatorTable.getStartLocation(a.getOwnerElement()), WsdlMessages.PARSING_INVALID_WSDL_ELEMENT(a.getLocalName()));
}
+ }
private void checkNotWsdlRequired(Element e) {
// check the wsdl:required attribute, fail if set to "true"
--- old/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/WhitespaceStripper.java 2013-04-04 15:26:59.628612650 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/ws/wsdl/parser/WhitespaceStripper.java 2013-04-04 15:26:59.576612649 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/ClassLoaderBuilder.java 2013-04-04 15:26:59.848612653 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/ClassLoaderBuilder.java 2013-04-04 15:26:59.796612652 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -36,7 +36,6 @@
import com.sun.istack.internal.tools.MaskingClassLoader;
import com.sun.istack.internal.tools.ParallelWorldClassLoader;
-import com.sun.tools.internal.xjc.SecureLoader;
/**
* Creates a class loader configured to run XJC 1.0/2.0 safely without
@@ -62,7 +61,7 @@
// JAXB API is loaded from the bootstrap. We need to override one with ours
mustang = true;
- List mask = new ArrayList(Arrays.asList(maskedPackages));
+ List mask = new ArrayList(Arrays.asList(maskedPackages));
mask.add("javax.xml.bind.");
cl = new MaskingClassLoader(cl,mask);
@@ -80,7 +79,7 @@
// so that the XJC2 classes in the parent class loader
// won't interfere with loading XJC1 classes in a child class loader
- if (v.equals("1.0")) {
+ if ("1.0".equals(v)) {
if(!mustang)
// if we haven't used Masking ClassLoader, do so now.
cl = new MaskingClassLoader(cl,toolPackages);
--- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/Driver.java 2013-04-04 15:27:00.056612656 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/Driver.java 2013-04-04 15:26:59.996612655 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, 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
@@ -38,6 +38,7 @@
import com.sun.codemodel.internal.writer.ZipCodeWriter;
import com.sun.istack.internal.NotNull;
import com.sun.istack.internal.Nullable;
+import com.sun.istack.internal.tools.DefaultAuthenticator;
import com.sun.tools.internal.xjc.generator.bean.BeanGenerator;
import com.sun.tools.internal.xjc.model.Model;
import com.sun.tools.internal.xjc.outline.Outline;
@@ -222,9 +223,15 @@
opt.setSchemaLanguage(Language.XMLSCHEMA); // disable auto-guessing
try {
opt.parseArguments(args);
- } catch (WeAreDone _) {
+ } catch (WeAreDone e) {
+ if (opt.proxyAuth != null) {
+ DefaultAuthenticator.reset();
+ }
return -1;
} catch(BadCommandLineException e) {
+ if (opt.proxyAuth != null) {
+ DefaultAuthenticator.reset();
+ }
e.initOptions(opt);
throw e;
}
@@ -401,6 +408,10 @@
listener.message(Messages.format(Messages.STACK_OVERFLOW));
return -1;
}
+ } finally {
+ if (opt.proxyAuth != null) {
+ DefaultAuthenticator.reset();
+ }
}
}
--- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle.properties 2013-04-04 15:27:00.288612660 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/MessageBundle.properties 2013-04-04 15:27:00.232612659 +0200
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 2012, 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
@@ -70,6 +70,7 @@
\ \ -target (2.0|2.1) : behave like XJC 2.0 or 2.1 and generate code that doesn't use any 2.2 features.\n\
\ \ -encoding : specify character encoding for generated source files\n\
\ \ -enableIntrospection : enable correct generation of Boolean getters/setters to enable Bean Introspection apis \n\
+\ \ -disableXmlSecurity : disables XML security features when parsing XML documents \n\
\ \ -contentForWildcard : generates content property for types with multiple xs:any derived elements \n\
\ \ -xmlschema : treat input as W3C XML Schema (default)\n\
\ \ -relaxng : treat input as RELAX NG (experimental,unsupported)\n\
@@ -170,31 +171,31 @@
Driver.FailedToGenerateCode = \
Failed to produce code.
-# DO NOT localize the 2.2.5-b10 string - it is a token for an ant
+# DO NOT localize the 2.2.7-b63 string - it is a token for an ant
Driver.FilePrologComment = \
- This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.5-b10 \n\
+ This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.7-b63 \n\
See http://java.sun.com/xml/jaxb \n\
Any modifications to this file will be lost upon recompilation of the source schema. \n\
Generated on: {0} \n
Driver.Version = \
- xjc 2.2.5-b10
+ xjc 2.2.7-b63
Driver.FullVersion = \
- xjc full version "2.2.5-b10-b14"
+ xjc full version "2.2.7-b63-b19"
-Driver.BuildID = 2.2.5-b10
+Driver.BuildID = 2.2.7-b63
# for JDK integration - include version in source zip
-jaxb.jdk.version=2.2.5-b10
+jaxb.jdk.version=2.2.7-b63
# see java.text.SimpleDateFormat for format syntax
-# Format should not be changed, English locale is used to transform this string into a real date. Letters can be translated but the user should known that java.text.SimpleDateFormat is responsible for formatting (meaning of symbols can be found at http://docs.oracle.com/javase/tutorial/i18n/format/simpleDateFormat.html).
+# DO NOT LOCALIZE, Format should not be changed, English locale is used to transform this string into a real date.
Driver.DateFormat = \
yyyy.MM.dd
# see java.text.SimpleDateFormat for format syntax
-# Format should not be changed, English locale is used to transform this string into a real time. Letters can be translated but the user should known that java.text.SimpleDateFormat is responsible for formatting (meaning of symbols can be found at http://docs.oracle.com/javase/tutorial/i18n/format/simpleDateFormat.html).
+# Format should not be changed, English locale is used to transform this string into a real time.
Driver.TimeFormat = \
hh:mm:ss a z
--- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/Messages.java 2013-04-04 15:27:00.492612663 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/Messages.java 2013-04-04 15:27:00.448612662 +0200
@@ -31,10 +31,10 @@
/**
* Formats error messages.
*/
-class Messages
+public class Messages
{
/** Loads a string resource and formats it with specified arguments. */
- static String format( String property, Object... args ) {
+ public static String format( String property, Object... args ) {
String text = ResourceBundle.getBundle(Messages.class.getPackage().getName() +".MessageBundle").getString(property);
return MessageFormat.format(text,args);
}
--- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/ModelLoader.java 2013-04-04 15:27:00.724612666 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/ModelLoader.java 2013-04-04 15:27:00.664612665 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, 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
@@ -47,12 +47,11 @@
import com.sun.tools.internal.xjc.reader.xmlschema.parser.SchemaConstraintChecker;
import com.sun.tools.internal.xjc.reader.xmlschema.parser.XMLSchemaInternalizationLogic;
import com.sun.tools.internal.xjc.util.ErrorReceiverFilter;
+import com.sun.xml.internal.bind.v2.util.XmlFactory;
import com.sun.xml.internal.xsom.XSSchemaSet;
import com.sun.xml.internal.xsom.parser.JAXPParser;
import com.sun.xml.internal.xsom.parser.XMLParser;
import com.sun.xml.internal.xsom.parser.XSOMParser;
-import java.net.URI;
-import java.net.URISyntaxException;
import javax.xml.XMLConstants;
import com.sun.xml.internal.rngom.ast.builder.SchemaBuilder;
@@ -298,7 +297,7 @@
throws SAXException {
// parse into DOM forest
- DOMForest forest = new DOMForest(logic);
+ DOMForest forest = new DOMForest(logic, opt);
forest.setErrorHandler(errorReceiver);
if(opt.entityResolver!=null)
@@ -343,7 +342,7 @@
*/
public XSSchemaSet loadXMLSchema() throws SAXException {
- if( opt.strictCheck && !SchemaConstraintChecker.check(opt.getGrammars(),errorReceiver,opt.entityResolver)) {
+ if( opt.strictCheck && !SchemaConstraintChecker.check(opt.getGrammars(),errorReceiver,opt.entityResolver, opt.disableXmlSecurity)) {
// schema error. error should have been reported
return null;
}
@@ -353,7 +352,7 @@
// which is faster if the speculation succeeds.
try {
return createXSOMSpeculative();
- } catch( SpeculationFailure _ ) {
+ } catch( SpeculationFailure e) {
// failed. go the slow way
}
}
@@ -411,6 +410,13 @@
return BGMBuilder.build(xs, codeModel, errorReceiver, opt);
}
+ /**
+ * Potentially problematic - make sure the parser instance passed is initialized
+ * with proper security feature.
+ *
+ * @param parser
+ * @return
+ */
public XSOMParser createXSOMParser(XMLParser parser) {
// set up other parameters to XSOMParser
XSOMParser reader = new XSOMParser(new XMLSchemaParser(parser));
@@ -465,7 +471,7 @@
// check if the schema contains external binding files. If so, speculation is a failure.
XMLParser parser = new XMLParser() {
- private final JAXPParser base = new JAXPParser();
+ private final JAXPParser base = new JAXPParser(XmlFactory.createParserFactory(opt.disableXmlSecurity));
public void parse(InputSource source, ContentHandler handler,
ErrorHandler errorHandler, EntityResolver entityResolver ) throws SAXException, IOException {
--- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/Options.java 2013-04-04 15:27:01.008612671 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/Options.java 2013-04-04 15:27:00.956612670 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, 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
@@ -45,13 +45,13 @@
import java.util.HashSet;
import java.util.List;
import java.util.Set;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
import com.sun.codemodel.internal.CodeWriter;
import com.sun.codemodel.internal.JPackage;
+import com.sun.codemodel.internal.JResourceFile;
import com.sun.codemodel.internal.writer.FileCodeWriter;
import com.sun.codemodel.internal.writer.PrologCodeWriter;
+import com.sun.istack.internal.tools.DefaultAuthenticator;
import com.sun.org.apache.xml.internal.resolver.CatalogManager;
import com.sun.org.apache.xml.internal.resolver.tools.CatalogResolver;
import com.sun.tools.internal.xjc.api.ClassNameAllocator;
@@ -106,6 +106,15 @@
public String encoding;
/**
+ * If true XML security features when parsing XML documents will be disabled.
+ * The default value is false.
+ *
+ * Boolean
+ * @since 2.2.6
+ */
+ public boolean disableXmlSecurity;
+
+ /**
* Check the source schemas with extra scrutiny.
* The exact meaning depends on the schema language.
*/
@@ -152,20 +161,12 @@
*/
public SpecVersion target = SpecVersion.LATEST;
- private boolean is2_2 = true;
public Options() {
- if (is2_2) {
- try {
- Class.forName("javax.xml.bind.JAXBPermission");
- } catch (ClassNotFoundException cnfe) {
- is2_2 = false;
- }
- if (!is2_2) {
- target = SpecVersion.V2_1;
- } else {
- target = SpecVersion.LATEST;
- }
+ try {
+ Class.forName("javax.xml.bind.JAXBPermission");
+ } catch (ClassNotFoundException cnfe) {
+ target = SpecVersion.V2_1;
}
}
@@ -213,8 +214,7 @@
// Proxy setting.
private String proxyHost = null;
private String proxyPort = null;
- private String proxyUser = null;
- private String proxyPassword = null;
+ public String proxyAuth = null;
/**
* {@link Plugin}s that are enabled in this compilation.
@@ -459,7 +459,9 @@
* Gets a classLoader that can load classes specified via the
* -classpath option.
*/
- public URLClassLoader getUserClassLoader( ClassLoader parent ) {
+ public ClassLoader getUserClassLoader( ClassLoader parent ) {
+ if (classpaths.isEmpty())
+ return parent;
return new URLClassLoader(
classpaths.toArray(new URL[classpaths.size()]),parent);
}
@@ -542,6 +544,10 @@
enableIntrospection = true;
return 1;
}
+ if (args[i].equals("-disableXmlSecurity")) {
+ disableXmlSecurity = true;
+ return 1;
+ }
if (args[i].equals("-contentForWildcard")) {
contentForWildcard = true;
return 1;
@@ -639,16 +645,6 @@
}
return 2;
}
- if (args[i].equals("-source")) {
- String version = requireArgument("-source",args,++i);
- //For source 1.0 the 1.0 Driver is loaded
- //Hence anything other than 2.0 is defaulted to
- //2.0
- if( !version.equals("2.0") && !version.equals("2.1") )
- throw new BadCommandLineException(
- Messages.format(Messages.DEFAULT_VERSION));
- return 2;
- }
if( args[i].equals("-Xtest-class-name-allocator") ) {
classNameAllocator = new ClassNameAllocator() {
public String assignClassName(String packageName, String className) {
@@ -703,18 +699,29 @@
}
private void parseProxy(String text) throws BadCommandLineException {
- // syntax is [user[:password]@]proxyHost:proxyPort
- String token = "([^@:]+)";
- Pattern p = Pattern.compile("(?:"+token+"(?:\\:"+token+")?\\@)?"+token+"(?:\\:"+token+")");
-
- Matcher matcher = p.matcher(text);
- if(!matcher.matches())
- throw new BadCommandLineException(Messages.format(Messages.ILLEGAL_PROXY,text));
+ int i = text.lastIndexOf('@');
+ int j = text.lastIndexOf(':');
- proxyUser = matcher.group(1);
- proxyPassword = matcher.group(2);
- proxyHost = matcher.group(3);
- proxyPort = matcher.group(4);
+ if (i > 0) {
+ proxyAuth = text.substring(0, i);
+ if (j > i) {
+ proxyHost = text.substring(i + 1, j);
+ proxyPort = text.substring(j + 1);
+ } else {
+ proxyHost = text.substring(i + 1);
+ proxyPort = "80";
+ }
+ } else {
+ //no auth info
+ if (j < 0) {
+ //no port
+ proxyHost = text;
+ proxyPort = "80";
+ } else {
+ proxyHost = text.substring(0, j);
+ proxyPort = text.substring(j + 1);
+ }
+ }
try {
Integer.valueOf(proxyPort);
} catch (NumberFormatException e) {
@@ -811,11 +818,9 @@
throw new BadCommandLineException(
Messages.format(Messages.MISSING_PROXYPORT));
}
- if(proxyUser!=null)
- System.setProperty("http.proxyUser", proxyUser);
- if(proxyPassword!=null)
- System.setProperty("http.proxyPassword", proxyPassword);
-
+ if (proxyAuth != null) {
+ DefaultAuthenticator.getAuthenticator().setProxyAuth(proxyAuth);
+ }
}
if (grammars.isEmpty())
--- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/SchemaCache.java 2013-04-04 15:27:01.264612675 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/SchemaCache.java 2013-04-04 15:27:01.212612674 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -31,8 +31,8 @@
import javax.xml.validation.SchemaFactory;
import javax.xml.validation.ValidatorHandler;
-import com.sun.xml.internal.bind.v2.WellKnownNamespace;
-
+import com.sun.xml.internal.bind.v2.util.XmlFactory;
+import javax.xml.XMLConstants;
import org.xml.sax.SAXException;
/**
@@ -57,7 +57,9 @@
synchronized(this) {
if(schema==null) {
try {
- schema = SchemaFactory.newInstance(WellKnownNamespace.XML_SCHEMA).newSchema(source);
+ // do not disable secure processing - these are well-known schemas
+ SchemaFactory sf = XmlFactory.createSchemaFactory(XMLConstants.W3C_XML_SCHEMA_NS_URI, false);
+ schema = sf.newSchema(source);
} catch (SAXException e) {
// we make sure that the schema is correct before we ship.
throw new AssertionError(e);
--- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/SecureLoader.java 2013-04-04 15:27:01.488612679 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/SecureLoader.java 2013-04-04 15:27:01.436612677 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -37,9 +37,9 @@
if (System.getSecurityManager() == null) {
return Thread.currentThread().getContextClassLoader();
} else {
- return (ClassLoader) java.security.AccessController.doPrivileged(
- new java.security.PrivilegedAction() {
- public java.lang.Object run() {
+ return java.security.AccessController.doPrivileged(
+ new java.security.PrivilegedAction() {
+ public ClassLoader run() {
return Thread.currentThread().getContextClassLoader();
}
});
@@ -50,9 +50,9 @@
if (System.getSecurityManager() == null) {
return c.getClassLoader();
} else {
- return (ClassLoader) java.security.AccessController.doPrivileged(
- new java.security.PrivilegedAction() {
- public java.lang.Object run() {
+ return java.security.AccessController.doPrivileged(
+ new java.security.PrivilegedAction() {
+ public ClassLoader run() {
return c.getClassLoader();
}
});
@@ -63,9 +63,9 @@
if (System.getSecurityManager() == null) {
return ClassLoader.getSystemClassLoader();
} else {
- return (ClassLoader) java.security.AccessController.doPrivileged(
- new java.security.PrivilegedAction() {
- public java.lang.Object run() {
+ return java.security.AccessController.doPrivileged(
+ new java.security.PrivilegedAction() {
+ public ClassLoader run() {
return ClassLoader.getSystemClassLoader();
}
});
@@ -77,8 +77,8 @@
Thread.currentThread().setContextClassLoader(cl);
} else {
java.security.AccessController.doPrivileged(
- new java.security.PrivilegedAction() {
- public java.lang.Object run() {
+ new java.security.PrivilegedAction() {
+ public ClassLoader run() {
Thread.currentThread().setContextClassLoader(cl);
return null;
}
@@ -86,4 +86,18 @@
}
}
+ static ClassLoader getParentClassLoader(final ClassLoader cl) {
+ if (System.getSecurityManager() == null) {
+ return cl.getParent();
+ } else {
+ return java.security.AccessController.doPrivileged(
+ new java.security.PrivilegedAction() {
+ public ClassLoader run() {
+ return cl.getParent();
+ }
+ });
+ }
+ }
+
+
}
--- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/XJCFacade.java 2013-04-04 15:27:01.720612682 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/XJCFacade.java 2013-04-04 15:27:01.664612681 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, 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
@@ -25,56 +25,80 @@
package com.sun.tools.internal.xjc;
-import com.sun.tools.internal.xjc.SecureLoader;
+import java.io.Closeable;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
+import java.net.URLClassLoader;
/**
* A shabby driver to invoke XJC1 or XJC2 depending on the command line switch.
*
*
- * This class is compiled with -source 1.2 so that we can report a nice user-friendly
- * "you require Tiger" error message.
+ * This class is compiled with -source 1.2 so that we can report a nice
+ * user-friendly "you require Tiger" error message.
*
* @author Kohsuke Kawaguchi
*/
public class XJCFacade {
+ private static final String JDK6_REQUIRED = "XJC requires JDK 6.0 or later. Please download it from http://www.oracle.com/technetwork/java/javase/downloads";
+
public static void main(String[] args) throws Throwable {
String v = "2.0"; // by default, we go 2.0
- for( int i=0; i driver = cl.loadClass("com.sun.tools.internal.xjc.Driver");
Method mainMethod = driver.getDeclaredMethod("main", new Class[]{String[].class});
try {
- mainMethod.invoke(null,new Object[]{args});
- } catch (IllegalAccessException e) {
- throw e;
+ mainMethod.invoke(null, new Object[]{args});
} catch (InvocationTargetException e) {
- if(e.getTargetException()!=null)
+ if (e.getTargetException() != null) {
throw e.getTargetException();
+ }
}
} catch (UnsupportedClassVersionError e) {
- System.err.println("XJC requires JDK 5.0 or later. Please download it from http://java.sun.com/j2se/1.5/");
+ System.err.println(JDK6_REQUIRED);
+ } finally {
+ ClassLoader cl = SecureLoader.getContextClassLoader();
+ SecureLoader.setContextClassLoader(oldContextCl);
+
+ //close/cleanup all classLoaders but the one which loaded this class
+ while (cl != null && !oldContextCl.equals(cl)) {
+ if (cl instanceof Closeable) {
+ //JDK7+, ParallelWorldClassLoader
+ ((Closeable) cl).close();
+ } else {
+ if (cl instanceof URLClassLoader) {
+ //JDK6 - API jars are loaded by instance of URLClassLoader
+ //so use proprietary API to release holded resources
+ try {
+ Class> clUtil = oldContextCl.loadClass("sun.misc.ClassLoaderUtil");
+ Method release = clUtil.getDeclaredMethod("releaseLoader", URLClassLoader.class);
+ release.invoke(null, cl);
+ } catch (ClassNotFoundException ex) {
+ //not Sun JDK 6, ignore
+ System.err.println(JDK6_REQUIRED);
+ }
+ }
+ }
+ cl = SecureLoader.getParentClassLoader(cl);
+ }
}
}
- private static String parseVersion(String version) {
- if(version.equals("1.0"))
- return version;
- // if we don't recognize the version number, we'll go to 2.0 RI
- // anyway. It's easier to report an error message there,
- // than in here.
+ public static String parseVersion(String version) {
+ // no other versions supported as of now
return "2.0";
}
}
--- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/api/XJC.java 2013-04-04 15:27:01.944612685 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/api/XJC.java 2013-04-04 15:27:01.888612685 +0200
@@ -25,7 +25,6 @@
package com.sun.tools.internal.xjc.api;
-import com.sun.tools.internal.xjc.api.impl.j2s.JavaCompilerImpl;
import com.sun.tools.internal.xjc.api.impl.s2j.SchemaCompilerImpl;
import com.sun.xml.internal.bind.api.impl.NameConverter;
@@ -37,15 +36,6 @@
* Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
*/
public final class XJC {
- /**
- * Gets a fresh {@link JavaCompiler}.
- *
- * @return
- * always return non-null object.
- */
- public static JavaCompiler createJavaCompiler() {
- return new JavaCompilerImpl();
- }
/**
* Gets a fresh {@link SchemaCompiler}.
--- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/api/impl/s2j/SchemaCompilerImpl.java 2013-04-04 15:27:02.148612689 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/api/impl/s2j/SchemaCompilerImpl.java 2013-04-04 15:27:02.088612687 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, 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
@@ -53,6 +53,7 @@
import com.sun.tools.internal.xjc.reader.xmlschema.parser.LSInputSAXWrapper;
import com.sun.tools.internal.xjc.reader.xmlschema.parser.XMLSchemaInternalizationLogic;
import com.sun.xml.internal.bind.unmarshaller.DOMScanner;
+import com.sun.xml.internal.bind.v2.util.XmlFactory;
import com.sun.xml.internal.xsom.XSSchemaSet;
import org.w3c.dom.Element;
@@ -169,7 +170,7 @@
// eventually we need a proper URI class that works for us.
try {
new URL(systemId);
- } catch( MalformedURLException _ ) {
+ } catch( MalformedURLException mue) {
try {
new URI(systemId);
} catch (URISyntaxException e ) {
@@ -196,7 +197,7 @@
}
public void resetSchema() {
- forest = new DOMForest(new XMLSchemaInternalizationLogic());
+ forest = new DOMForest(new XMLSchemaInternalizationLogic(), opts);
forest.setErrorHandler(this);
forest.setEntityResolver(opts.entityResolver);
}
@@ -216,7 +217,7 @@
if (!NO_CORRECTNESS_CHECK) {
// correctness check
- SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+ SchemaFactory sf = XmlFactory.createSchemaFactory(XMLConstants.W3C_XML_SCHEMA_NS_URI, opts.disableXmlSecurity);
// fix for https://jaxb.dev.java.net/issues/show_bug.cgi?id=795
// taken from SchemaConstraintChecker, TODO XXX FIXME UGLY
--- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/api/impl/s2j/TypeAndAnnotationImpl.java 2013-04-04 15:27:02.384612692 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/api/impl/s2j/TypeAndAnnotationImpl.java 2013-04-04 15:27:02.336612691 +0200
@@ -38,7 +38,7 @@
import com.sun.tools.internal.xjc.model.nav.NType;
import static com.sun.tools.internal.xjc.outline.Aspect.EXPOSED;
import com.sun.tools.internal.xjc.outline.Outline;
-import com.sun.xml.internal.bind.v2.runtime.SwaRefAdapter;
+import com.sun.xml.internal.bind.v2.runtime.SwaRefAdapterMarker;
/**
* {@link TypeAndAnnotation} implementation.
@@ -81,7 +81,7 @@
CAdapter adapterUse = typeUse.getAdapterUse();
if(adapterUse!=null) {
// ugly, ugly hack
- if(adapterUse.getAdapterIfKnown()== SwaRefAdapter.class) {
+ if(adapterUse.getAdapterIfKnown() == SwaRefAdapterMarker.class) {
programElement.annotate(XmlAttachmentRef.class);
} else {
// [RESULT]
--- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlAccessorOrderWriter.java 2013-04-04 15:27:02.620612696 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlAccessorOrderWriter.java 2013-04-04 15:27:02.564612695 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlAccessorTypeWriter.java 2013-04-04 15:27:02.880612700 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlAccessorTypeWriter.java 2013-04-04 15:27:02.832612699 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlAnyAttributeWriter.java 2013-04-04 15:27:03.100612703 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlAnyAttributeWriter.java 2013-04-04 15:27:03.052612702 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlAnyElementWriter.java 2013-04-04 15:27:03.328612707 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlAnyElementWriter.java 2013-04-04 15:27:03.276612706 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlAttachmentRefWriter.java 2013-04-04 15:27:03.572612711 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlAttachmentRefWriter.java 2013-04-04 15:27:03.520612710 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlAttributeWriter.java 2013-04-04 15:27:03.792612714 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlAttributeWriter.java 2013-04-04 15:27:03.740612714 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlElementDeclWriter.java 2013-04-04 15:27:04.008612718 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlElementDeclWriter.java 2013-04-04 15:27:03.960612717 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlElementRefWriter.java 2013-04-04 15:27:04.240612721 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlElementRefWriter.java 2013-04-04 15:27:04.192612720 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlElementRefsWriter.java 2013-04-04 15:27:04.472612725 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlElementRefsWriter.java 2013-04-04 15:27:04.420612724 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlElementWrapperWriter.java 2013-04-04 15:27:04.692612728 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlElementWrapperWriter.java 2013-04-04 15:27:04.644612727 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlElementWriter.java 2013-04-04 15:27:04.920612731 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlElementWriter.java 2013-04-04 15:27:04.864612731 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlElementsWriter.java 2013-04-04 15:27:05.152612736 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlElementsWriter.java 2013-04-04 15:27:05.104612735 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlEnumValueWriter.java 2013-04-04 15:27:05.372612739 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlEnumValueWriter.java 2013-04-04 15:27:05.316612738 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlEnumWriter.java 2013-04-04 15:27:05.644612743 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlEnumWriter.java 2013-04-04 15:27:05.592612742 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlIDREFWriter.java 2013-04-04 15:27:05.884612747 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlIDREFWriter.java 2013-04-04 15:27:05.828612746 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlIDWriter.java 2013-04-04 15:27:06.140612750 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlIDWriter.java 2013-04-04 15:27:06.080612750 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlInlineBinaryDataWriter.java 2013-04-04 15:27:06.372612755 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlInlineBinaryDataWriter.java 2013-04-04 15:27:06.312612753 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlJavaTypeAdapterWriter.java 2013-04-04 15:27:06.736612760 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlJavaTypeAdapterWriter.java 2013-04-04 15:27:06.684612759 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlListWriter.java 2013-04-04 15:27:06.968612764 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlListWriter.java 2013-04-04 15:27:06.916612763 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlMimeTypeWriter.java 2013-04-04 15:27:07.192612767 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlMimeTypeWriter.java 2013-04-04 15:27:07.136612766 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlMixedWriter.java 2013-04-04 15:27:07.452612771 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlMixedWriter.java 2013-04-04 15:27:07.396612771 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlNsWriter.java 2013-04-04 15:27:07.700612775 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlNsWriter.java 2013-04-04 15:27:07.648612774 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlRegistryWriter.java 2013-04-04 15:27:07.972612779 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlRegistryWriter.java 2013-04-04 15:27:07.908612778 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlRootElementWriter.java 2013-04-04 15:27:08.256612783 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlRootElementWriter.java 2013-04-04 15:27:08.184612783 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlSchemaTypeWriter.java 2013-04-04 15:27:08.496612787 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlSchemaTypeWriter.java 2013-04-04 15:27:08.444612787 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlSchemaTypesWriter.java 2013-04-04 15:27:08.740612791 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlSchemaTypesWriter.java 2013-04-04 15:27:08.684612791 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlSchemaWriter.java 2013-04-04 15:27:08.996612795 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlSchemaWriter.java 2013-04-04 15:27:08.948612794 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlSeeAlsoWriter.java 2013-04-04 15:27:09.232612799 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlSeeAlsoWriter.java 2013-04-04 15:27:09.180612798 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlTransientWriter.java 2013-04-04 15:27:09.452612803 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlTransientWriter.java 2013-04-04 15:27:09.400612801 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlTypeWriter.java 2013-04-04 15:27:09.680612806 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlTypeWriter.java 2013-04-04 15:27:09.628612805 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlValueWriter.java 2013-04-04 15:27:09.940612810 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/annotation/spec/XmlValueWriter.java 2013-04-04 15:27:09.880612809 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/bean/BeanGenerator.java 2013-04-04 15:27:10.196612814 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/bean/BeanGenerator.java 2013-04-04 15:27:10.144612813 +0200
@@ -43,6 +43,8 @@
import javax.xml.bind.annotation.XmlAttachmentRef;
import javax.xml.bind.annotation.XmlID;
import javax.xml.bind.annotation.XmlIDREF;
+import javax.xml.bind.annotation.XmlMimeType;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import javax.xml.namespace.QName;
import com.sun.codemodel.internal.ClassType;
@@ -96,7 +98,8 @@
import com.sun.tools.internal.xjc.outline.Outline;
import com.sun.tools.internal.xjc.outline.PackageOutline;
import com.sun.tools.internal.xjc.util.CodeModelClassFactory;
-import com.sun.xml.internal.bind.v2.runtime.SwaRefAdapter;
+import com.sun.xml.internal.bind.v2.model.core.PropertyInfo;
+import com.sun.xml.internal.bind.v2.runtime.SwaRefAdapterMarker;
import com.sun.xml.internal.xsom.XmlString;
import com.sun.istack.internal.NotNull;
import com.sun.tools.internal.xjc.model.CReferencePropertyInfo;
@@ -770,7 +773,7 @@
public final void generateAdapterIfNecessary(CPropertyInfo prop, JAnnotatable field) {
CAdapter adapter = prop.getAdapter();
if (adapter != null) {
- if (adapter.getAdapterIfKnown() == SwaRefAdapter.class) {
+ if (adapter.getAdapterIfKnown() == SwaRefAdapterMarker.class) {
field.annotate(XmlAttachmentRef.class);
} else {
// [RESULT]
--- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/bean/DualObjectFactoryGenerator.java 2013-04-04 15:27:10.424612817 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/bean/DualObjectFactoryGenerator.java 2013-04-04 15:27:10.372612817 +0200
@@ -31,7 +31,6 @@
import com.sun.codemodel.internal.JPackage;
import com.sun.tools.internal.xjc.model.CElementInfo;
import com.sun.tools.internal.xjc.model.Model;
-import com.sun.xml.internal.bind.v2.ContextFactory;
/**
* {@link ObjectFactoryGenerator} used when we generate
@@ -53,7 +52,7 @@
// put the marker so that we can detect missing jaxb.properties
publicOFG.getObjectFactory().field(JMod.PRIVATE|JMod.STATIC|JMod.FINAL,
- Void.class, ContextFactory.USE_JAXB_PROPERTIES, JExpr._null());
+ Void.class, "_useJAXBProperties", JExpr._null());
}
void populate(CElementInfo ei) {
--- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/bean/field/AbstractFieldWithVar.java 2013-04-04 15:27:10.640612821 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/generator/bean/field/AbstractFieldWithVar.java 2013-04-04 15:27:10.588612820 +0200
@@ -32,7 +32,6 @@
import com.sun.codemodel.internal.JMod;
import com.sun.codemodel.internal.JType;
import com.sun.codemodel.internal.JVar;
-import com.sun.tools.internal.xjc.api.SpecVersion;
import com.sun.tools.internal.xjc.generator.bean.ClassOutlineImpl;
import com.sun.tools.internal.xjc.model.CPropertyInfo;
--- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/model/CArrayInfo.java 2013-04-04 15:27:10.856612824 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/model/CArrayInfo.java 2013-04-04 15:27:10.804612824 +0200
@@ -28,12 +28,12 @@
import javax.xml.namespace.QName;
import com.sun.codemodel.internal.JType;
+import com.sun.xml.internal.bind.v2.model.util.ArrayInfoUtil;
import com.sun.tools.internal.xjc.model.nav.NClass;
import com.sun.tools.internal.xjc.model.nav.NType;
import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.tools.internal.xjc.outline.Outline;
import com.sun.xml.internal.bind.v2.model.core.ArrayInfo;
-import com.sun.xml.internal.bind.v2.model.impl.ArrayInfoImpl;
import com.sun.xml.internal.xsom.XSComponent;
import org.xml.sax.Locator;
@@ -57,7 +57,7 @@
super(model,source,customizations);
this.itemType = itemType;
assert itemType.getTypeName()!=null;
- this.typeName = ArrayInfoImpl.calcArrayTypeName(itemType.getTypeName());
+ this.typeName = ArrayInfoUtil.calcArrayTypeName(itemType.getTypeName());
}
public CNonElement getItemType() {
--- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/model/CBuiltinLeafInfo.java 2013-04-04 15:27:11.076612828 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/model/CBuiltinLeafInfo.java 2013-04-04 15:27:11.024612827 +0200
@@ -49,16 +49,19 @@
import com.sun.codemodel.internal.JExpression;
import com.sun.codemodel.internal.JType;
import com.sun.tools.internal.xjc.model.nav.NClass;
+import com.sun.xml.internal.bind.v2.model.annotation.Locatable;
+import com.sun.xml.internal.bind.v2.model.core.BuiltinLeafInfo;
+import com.sun.xml.internal.bind.v2.model.core.Element;
+import com.sun.xml.internal.bind.v2.model.core.LeafInfo;
+import com.sun.xml.internal.bind.v2.runtime.Location;
import com.sun.tools.internal.xjc.model.nav.NType;
import com.sun.tools.internal.xjc.model.nav.NavigatorImpl;
import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.tools.internal.xjc.outline.Outline;
import com.sun.tools.internal.xjc.runtime.ZeroOneBooleanAdapter;
import com.sun.tools.internal.xjc.util.NamespaceContextAdapter;
-import com.sun.xml.internal.bind.DatatypeConverterImpl;
import com.sun.xml.internal.bind.v2.WellKnownNamespace;
import com.sun.xml.internal.bind.v2.model.core.ID;
-import com.sun.xml.internal.bind.v2.model.impl.BuiltinLeafInfoImpl;
import com.sun.xml.internal.xsom.XSComponent;
import com.sun.xml.internal.xsom.XmlString;
@@ -92,13 +95,23 @@
*
* @author Kohsuke Kawaguchi
*/
-public abstract class CBuiltinLeafInfo extends BuiltinLeafInfoImpl implements CNonElement {
+public abstract class CBuiltinLeafInfo implements CNonElement, BuiltinLeafInfo, LeafInfo, Location {
+
+ private final NType type;
+ /**
+ * Can be null for anonymous types.
+ */
+ private final QName typeName;
+
+ private final QName[] typeNames;
private final ID id;
// no derived class other than the spec-defined ones. definitely not for enum.
- private CBuiltinLeafInfo(NType typeToken, QName typeName, ID id) {
- super(typeToken,typeName);
+ private CBuiltinLeafInfo(NType typeToken, ID id, QName... typeNames) {
+ this.type = typeToken;
+ this.typeName = typeNames.length>0?typeNames[0]:null;
+ this.typeNames = typeNames;
this.id = id;
}
@@ -172,6 +185,73 @@
}
/**
+ * @deprecated always return false at this level.
+ */
+ public final boolean isElement() {
+ return false;
+ }
+
+ /**
+ * @deprecated always return null at this level.
+ */
+ public final QName getElementName() {
+ return null;
+ }
+
+ /**
+ * @deprecated always return null at this level.
+ */
+ public final Element asElement() {
+ return null;
+ }
+
+ /**
+ * A reference to the representation of the type.
+ */
+ public NType getType() {
+ return type;
+ }
+
+ /**
+ * Returns all the type names recognized by this bean info.
+ *
+ * @return
+ * do not modify the returned array.
+ */
+ public final QName[] getTypeNames() {
+ return typeNames;
+ }
+
+ /**
+ * Leaf-type cannot be referenced from IDREF.
+ *
+ * @deprecated
+ * why are you calling a method whose return value is always known?
+ */
+ public final boolean canBeReferencedByIDREF() {
+ return false;
+ }
+
+ public QName getTypeName() {
+ return typeName;
+ }
+
+ public Locatable getUpstream() {
+ return null;
+ }
+
+ public Location getLocation() {
+ // this isn't very accurate, but it's not too bad
+ // doing it correctly need leaves to hold navigator.
+ // otherwise revisit the design so that we take navigator as a parameter
+ return this;
+ }
+
+ public boolean isSimpleType() {
+ return true;
+ }
+
+ /**
* {@link CBuiltinLeafInfo} for Java classes that have
* the spec defined built-in binding semantics.
*/
@@ -180,7 +260,7 @@
this(c,typeName,com.sun.xml.internal.bind.v2.model.core.ID.NONE);
}
protected Builtin(Class c, String typeName, ID id) {
- super(NavigatorImpl.theInstance.ref(c), new QName(WellKnownNamespace.XML_SCHEMA,typeName),id);
+ super(NavigatorImpl.theInstance.ref(c), id, new QName(WellKnownNamespace.XML_SCHEMA,typeName));
LEAVES.put(getType(),this);
}
@@ -215,46 +295,46 @@
};
public static final CBuiltinLeafInfo BOOLEAN = new Builtin(Boolean.class,"boolean") {
public JExpression createConstant(Outline outline, XmlString lexical) {
- return JExpr.lit(DatatypeConverterImpl._parseBoolean(lexical.value));
+ return JExpr.lit(DatatypeConverter.parseBoolean(lexical.value));
}
};
public static final CBuiltinLeafInfo INT = new Builtin(Integer.class,"int") {
public JExpression createConstant(Outline outline, XmlString lexical) {
- return JExpr.lit(DatatypeConverterImpl._parseInt(lexical.value));
+ return JExpr.lit(DatatypeConverter.parseInt(lexical.value));
}
};
public static final CBuiltinLeafInfo LONG = new Builtin(Long.class,"long") {
public JExpression createConstant(Outline outline, XmlString lexical) {
- return JExpr.lit(DatatypeConverterImpl._parseLong(lexical.value));
+ return JExpr.lit(DatatypeConverter.parseLong(lexical.value));
}
};
public static final CBuiltinLeafInfo BYTE = new Builtin(Byte.class,"byte") {
public JExpression createConstant(Outline outline, XmlString lexical) {
return JExpr.cast(
outline.getCodeModel().BYTE,
- JExpr.lit(DatatypeConverterImpl._parseByte(lexical.value)));
+ JExpr.lit(DatatypeConverter.parseByte(lexical.value)));
}
};
public static final CBuiltinLeafInfo SHORT = new Builtin(Short.class,"short") {
public JExpression createConstant(Outline outline, XmlString lexical) {
return JExpr.cast(
outline.getCodeModel().SHORT,
- JExpr.lit(DatatypeConverterImpl._parseShort(lexical.value)));
+ JExpr.lit(DatatypeConverter.parseShort(lexical.value)));
}
};
public static final CBuiltinLeafInfo FLOAT = new Builtin(Float.class,"float") {
public JExpression createConstant(Outline outline, XmlString lexical) {
- return JExpr.lit(DatatypeConverterImpl._parseFloat(lexical.value));
+ return JExpr.lit(DatatypeConverter.parseFloat(lexical.value));
}
};
public static final CBuiltinLeafInfo DOUBLE = new Builtin(Double.class,"double") {
public JExpression createConstant(Outline outline, XmlString lexical) {
- return JExpr.lit(DatatypeConverterImpl._parseDouble(lexical.value));
+ return JExpr.lit(DatatypeConverter.parseDouble(lexical.value));
}
};
public static final CBuiltinLeafInfo QNAME = new Builtin(QName.class,"QName") {
public JExpression createConstant(Outline outline, XmlString lexical) {
- QName qn = DatatypeConverterImpl._parseQName(lexical.value,new NamespaceContextAdapter(lexical));
+ QName qn = DatatypeConverter.parseQName(lexical.value,new NamespaceContextAdapter(lexical));
return JExpr._new(outline.getCodeModel().ref(QName.class))
.arg(qn.getNamespaceURI())
.arg(qn.getLocalPart())
--- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/model/CPropertyInfo.java 2013-04-04 15:27:11.300612831 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/model/CPropertyInfo.java 2013-04-04 15:27:11.248612830 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -29,7 +29,6 @@
import java.util.Collection;
import java.util.Map;
-import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import javax.xml.namespace.QName;
@@ -37,10 +36,10 @@
import com.sun.codemodel.internal.JClass;
import com.sun.codemodel.internal.JJavaName;
import com.sun.codemodel.internal.JType;
-import com.sun.tools.internal.xjc.Plugin;
import com.sun.tools.internal.xjc.generator.bean.field.FieldRenderer;
import com.sun.tools.internal.xjc.model.nav.NClass;
import com.sun.tools.internal.xjc.model.nav.NType;
+import com.sun.tools.internal.xjc.reader.Ring;
import com.sun.xml.internal.bind.api.impl.NameConverter;
import com.sun.xml.internal.bind.v2.WellKnownNamespace;
import com.sun.xml.internal.bind.v2.model.core.PropertyInfo;
@@ -105,7 +104,15 @@
protected CPropertyInfo(String name, boolean collection, XSComponent source,
CCustomizations customizations, Locator locator) {
this.publicName = name;
- String n = NameConverter.standard.toVariableName(name);
+ String n = null;
+
+ Model m = Ring.get(Model.class);
+ if (m != null) {
+ n = m.getNameConverter().toVariableName(name);
+ } else {
+ n = NameConverter.standard.toVariableName(name);
+ }
+
if(!JJavaName.isJavaIdentifier(n))
n = '_'+n; // avoid colliding with the reserved names like 'abstract'.
this.privateName = n;
--- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/model/CTypeInfo.java 2013-04-04 15:27:11.528612835 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/model/CTypeInfo.java 2013-04-04 15:27:11.468612833 +0200
@@ -26,15 +26,12 @@
package com.sun.tools.internal.xjc.model;
import com.sun.codemodel.internal.JClass;
-import com.sun.codemodel.internal.JCodeModel;
-import com.sun.codemodel.internal.JExpression;
import com.sun.codemodel.internal.JType;
import com.sun.tools.internal.xjc.model.nav.NClass;
import com.sun.tools.internal.xjc.model.nav.NType;
import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.tools.internal.xjc.outline.Outline;
import com.sun.xml.internal.bind.v2.model.core.TypeInfo;
-import com.sun.xml.internal.xsom.XmlString;
/**
* {@link TypeInfo} at the compile-time.
--- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/model/nav/NavigatorImpl.java 2013-04-04 15:27:11.752612838 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/model/nav/NavigatorImpl.java 2013-04-04 15:27:11.700612838 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, 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
@@ -207,7 +207,7 @@
return create(primitiveType);
}
-
+ @SuppressWarnings("FinalStaticMethod")
public static final NType create(Type t) {
if(t==null) return null;
if(t instanceof Class)
@@ -236,17 +236,18 @@
public Location getClassLocation(final NClass c) {
// not really needed for XJC but doesn't hurt to have one
return new Location() {
+ @Override
public String toString() {
return c.fullName();
}
};
}
- public Location getFieldLocation(Void _) {
+ public Location getFieldLocation(Void v) {
throw new IllegalStateException();
}
- public Location getMethodLocation(Void _) {
+ public Location getMethodLocation(Void v) {
throw new IllegalStateException();
}
--- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/TypeUtil.java 2013-04-04 15:27:11.972612841 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/TypeUtil.java 2013-04-04 15:27:11.916612841 +0200
@@ -34,7 +34,6 @@
import java.util.TreeSet;
import com.sun.codemodel.internal.JClass;
-import com.sun.codemodel.internal.JClassAlreadyExistsException;
import com.sun.codemodel.internal.JCodeModel;
import com.sun.codemodel.internal.JDefinedClass;
import com.sun.codemodel.internal.JType;
--- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/BIUserConversion.java 2013-04-04 15:27:12.204612845 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/BIUserConversion.java 2013-04-04 15:27:12.148612844 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -50,6 +50,7 @@
import com.sun.tools.internal.xjc.model.TypeUse;
import com.sun.tools.internal.xjc.model.TypeUseFactory;
+import com.sun.xml.internal.bind.v2.util.XmlFactory;
import org.w3c.dom.Element;
import org.xml.sax.InputSource;
import org.xml.sax.Locator;
@@ -86,8 +87,8 @@
private static Element parse(String text) {
try {
- DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
- dbf.setNamespaceAware(true);
+ //this is parsing well known schemas, do not configure secure processing - always true
+ DocumentBuilderFactory dbf = XmlFactory.createDocumentBuilderFactory(false);
InputSource is = new InputSource(new StringReader(text));
return dbf.newDocumentBuilder().parse(is).getDocumentElement();
} catch (SAXException x) {
@@ -131,7 +132,7 @@
// no package name is specified.
try {
t = JPrimitiveType.parse(owner.codeModel,type);
- } catch( IllegalArgumentException e ) {
+ } catch( IllegalArgumentException ex ) {
// otherwise treat it as a class name in the current package
type = owner.getTargetPackage().name()+'.'+type;
}
@@ -142,8 +143,8 @@
JDefinedClass cls = owner.codeModel._class(type);
cls.hide();
t = cls;
- } catch( JClassAlreadyExistsException e ) {
- t = e.getExistingClass();
+ } catch( JClassAlreadyExistsException ex ) {
+ t = ex.getExistingClass();
}
}
@@ -168,7 +169,7 @@
try {
JPackage pkg = owner.getTargetPackage();
adapter = pkg._class("Adapter"+id);
- } catch (JClassAlreadyExistsException e) {
+ } catch (JClassAlreadyExistsException ex) {
// try another name in search for an unique name.
// this isn't too efficient, but we expect people to usually use
// a very small number of adapters.
--- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/BindInfo.java 2013-04-04 15:27:12.420612848 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/BindInfo.java 2013-04-04 15:27:12.364612848 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -52,6 +52,8 @@
import com.sun.tools.internal.xjc.util.ErrorReceiverFilter;
import com.sun.tools.internal.xjc.util.ForkContentHandler;
+import com.sun.xml.internal.bind.v2.util.XmlFactory;
+import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.xml.sax.InputSource;
@@ -301,9 +303,9 @@
// /-> extensionChecker -> validator
// parser-> -<
// \-> DOM builder
- SAXParserFactory pf = SAXParserFactory.newInstance();
- pf.setNamespaceAware(true);
- DOMBuilder builder = new DOMBuilder();
+ SAXParserFactory pf = XmlFactory.createParserFactory(model.options.disableXmlSecurity);
+ DocumentBuilderFactory domFactory = XmlFactory.createDocumentBuilderFactory(model.options.disableXmlSecurity);
+ DOMBuilder builder = new DOMBuilder(domFactory);
ErrorReceiverFilter controller = new ErrorReceiverFilter(receiver);
validator.setErrorHandler(controller);
--- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/DOMBuilder.java 2013-04-04 15:27:12.624612851 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/DOMBuilder.java 2013-04-04 15:27:12.572612851 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -29,6 +29,7 @@
import com.sun.xml.internal.bind.marshaller.SAX2DOMEx;
+import javax.xml.parsers.DocumentBuilderFactory;
import org.xml.sax.Attributes;
import org.xml.sax.Locator;
@@ -38,14 +39,17 @@
final class DOMBuilder extends SAX2DOMEx {
private Locator locator;
- public DOMBuilder() throws ParserConfigurationException {
+ public DOMBuilder(DocumentBuilderFactory f) throws ParserConfigurationException {
+ super(f);
}
+ @Override
public void setDocumentLocator(Locator locator) {
super.setDocumentLocator(locator);
this.locator = locator;
}
+ @Override
public void startElement(String namespace, String localName, String qName, Attributes attrs) {
super.startElement(namespace, localName, qName, attrs);
DOMLocator.setLocationInfo(getCurrentElement(),locator);
--- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/internalizer/AbstractReferenceFinderImpl.java 2013-04-04 15:27:12.848612855 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/internalizer/AbstractReferenceFinderImpl.java 2013-04-04 15:27:12.788612854 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -77,7 +77,7 @@
String relativeRef = findExternalResource(namespaceURI, localName, atts);
if (relativeRef == null) {
- return; // non found
+ return; // not found
}
try {
// absolutize URL.
@@ -97,7 +97,9 @@
// then parse this schema as well,
// but don't mark this document as a root.
- parent.parse(ref, false);
+ if (parent != null) { // this is there to allow easier testing
+ parent.parse(ref, false);
+ }
} catch (URISyntaxException e) {
String msg = e.getMessage();
if (new File(relativeRef).exists()) {
--- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/internalizer/DOMForest.java 2013-04-04 15:27:13.068612859 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/internalizer/DOMForest.java 2013-04-04 15:27:13.020612858 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, 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
@@ -57,9 +57,9 @@
import com.sun.tools.internal.xjc.ErrorReceiver;
import com.sun.tools.internal.xjc.Options;
import com.sun.tools.internal.xjc.reader.Const;
-import com.sun.tools.internal.xjc.reader.xmlschema.parser.SchemaConstraintChecker;
import com.sun.tools.internal.xjc.util.ErrorReceiverFilter;
import com.sun.xml.internal.bind.marshaller.DataWriter;
+import com.sun.xml.internal.bind.v2.util.XmlFactory;
import com.sun.xml.internal.xsom.parser.JAXPParser;
import com.sun.xml.internal.xsom.parser.XMLParser;
@@ -126,6 +126,7 @@
private final SAXParserFactory parserFactory;
private final DocumentBuilder documentBuilder;
+ private final Options options;
public DOMForest(
SAXParserFactory parserFactory, DocumentBuilder documentBuilder,
@@ -134,16 +135,18 @@
this.parserFactory = parserFactory;
this.documentBuilder = documentBuilder;
this.logic = logic;
+ this.options = null;
}
- public DOMForest( InternalizationLogic logic ) {
+ public DOMForest( InternalizationLogic logic, Options opt ) {
+
+ if (opt == null) throw new AssertionError("Options object null");
+ this.options = opt;
+
try {
- DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
- dbf.setNamespaceAware(true);
+ DocumentBuilderFactory dbf = XmlFactory.createDocumentBuilderFactory(opt.disableXmlSecurity);
this.documentBuilder = dbf.newDocumentBuilder();
-
- this.parserFactory = SAXParserFactory.newInstance();
- this.parserFactory.setNamespaceAware(true);
+ this.parserFactory = XmlFactory.createParserFactory(opt.disableXmlSecurity);
} catch( ParserConfigurationException e ) {
throw new AssertionError(e);
}
@@ -188,8 +191,9 @@
*/
private String getPath(String key) {
key = key.substring(5); // skip 'file:'
- while(key.length()>0 && key.charAt(0)=='/')
+ while(key.length()>0 && key.charAt(0)=='/') {
key = key.substring(1);
+ }
return key;
}
@@ -225,7 +229,11 @@
*/
public boolean checkSchemaCorrectness(ErrorReceiver errorHandler) {
try {
- SchemaFactory sf = SchemaFactory.newInstance(W3C_XML_SCHEMA_NS_URI);
+ boolean disableXmlSecurity = false;
+ if (options != null) {
+ disableXmlSecurity = options.disableXmlSecurity;
+ }
+ SchemaFactory sf = XmlFactory.createSchemaFactory(W3C_XML_SCHEMA_NS_URI, disableXmlSecurity);
ErrorReceiverFilter filter = new ErrorReceiverFilter(errorHandler);
sf.setErrorHandler(filter);
Set roots = getRootDocuments();
@@ -424,7 +432,7 @@
* components are built.
*/
public SCDBasedBindingSet transform(boolean enableSCD) {
- return Internalizer.transform(this,enableSCD);
+ return Internalizer.transform(this, enableSCD, options.disableXmlSecurity);
}
/**
@@ -466,16 +474,16 @@
sf.newSchema(sources.toArray(new SAXSource[0]));
} catch (SAXException e) {
// error should have been reported.
- } catch (RuntimeException e) {
+ } catch (RuntimeException re) {
// JAXP RI isn't very trustworthy when it comes to schema error check,
// and we know some cases where it just dies with NPE. So handle it gracefully.
// this masks a bug in the JAXP RI, but we need a release that we have to make.
try {
sf.getErrorHandler().warning(
new SAXParseException(Messages.format(
- Messages.ERR_GENERAL_SCHEMA_CORRECTNESS_ERROR,e.getMessage()),
- null,null,-1,-1,e));
- } catch (SAXException _) {
+ Messages.ERR_GENERAL_SCHEMA_CORRECTNESS_ERROR,re.getMessage()),
+ null,null,-1,-1,re));
+ } catch (SAXException e) {
// ignore
}
}
@@ -489,10 +497,12 @@
ContentHandlerNamespacePrefixAdapter reader = new ContentHandlerNamespacePrefixAdapter(new XMLFilterImpl() {
// XMLReader that uses XMLParser to parse. We need to use XMLFilter to indrect
// handlers, since SAX allows handlers to be changed while parsing.
+ @Override
public void parse(InputSource input) throws SAXException, IOException {
createParser().parse(input, this, this, this);
}
+ @Override
public void parse(String systemId) throws SAXException, IOException {
parse(new InputSource(systemId));
}
@@ -509,11 +519,9 @@
* instead of the original documents.
*/
public XMLParser createParser() {
- return new DOMForestParser(this,new JAXPParser());
+ return new DOMForestParser(this, new JAXPParser(XmlFactory.createParserFactory(options.disableXmlSecurity)));
}
-
-
public EntityResolver getEntityResolver() {
return entityResolver;
}
@@ -549,10 +557,16 @@
*
* This is a debug method. As such, error handling is sloppy.
*/
+ @SuppressWarnings("CallToThreadDumpStack")
public void dump( OutputStream out ) throws IOException {
try {
// create identity transformer
- Transformer it = TransformerFactory.newInstance().newTransformer();
+ boolean disableXmlSecurity = false;
+ if (options != null) {
+ disableXmlSecurity = options.disableXmlSecurity;
+ }
+ TransformerFactory tf = XmlFactory.createTransformerFactory(disableXmlSecurity);
+ Transformer it = tf.newTransformer();
for (Map.Entry e : core.entrySet()) {
out.write( ("---<< "+e.getKey()+'\n').getBytes() );
--- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/internalizer/Internalizer.java 2013-04-04 15:27:13.280612862 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/internalizer/Internalizer.java 2013-04-04 15:27:13.232612861 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -47,6 +47,7 @@
import com.sun.tools.internal.xjc.reader.Const;
import com.sun.tools.internal.xjc.util.DOMUtils;
import com.sun.xml.internal.bind.v2.util.EditDistance;
+import com.sun.xml.internal.bind.v2.util.XmlFactory;
import com.sun.xml.internal.xsom.SCD;
import java.io.File;
import java.io.IOException;
@@ -75,9 +76,9 @@
private static final String WSDL_NS = "http://schemas.xmlsoap.org/wsdl/";
- private static final XPathFactory xpf = XPathFactory.newInstance();
+ private static XPathFactory xpf = null;
- private final XPath xpath = xpf.newXPath();
+ private final XPath xpath;
/**
* Internalize all <jaxb:bindings> customizations in the given forest.
@@ -89,15 +90,21 @@
* SCDs are only for XML Schema, and doesn't make any sense for other
* schema languages.
*/
- static SCDBasedBindingSet transform( DOMForest forest, boolean enableSCD ) {
- return new Internalizer( forest, enableSCD ).transform();
+ static SCDBasedBindingSet transform( DOMForest forest, boolean enableSCD, boolean disableSecureProcessing ) {
+ return new Internalizer(forest, enableSCD, disableSecureProcessing).transform();
}
- private Internalizer( DOMForest forest, boolean enableSCD ) {
+ private Internalizer(DOMForest forest, boolean enableSCD, boolean disableSecureProcessing) {
this.errorHandler = forest.getErrorHandler();
this.forest = forest;
this.enableSCD = enableSCD;
+ synchronized (this) {
+ if (xpf == null) {
+ xpf = XmlFactory.createXPathFactory(disableSecureProcessing);
+ }
+ }
+ xpath = xpf.newXPath();
}
/**
--- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/internalizer/SCDBasedBindingSet.java 2013-04-04 15:27:13.492612865 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/internalizer/SCDBasedBindingSet.java 2013-04-04 15:27:13.440612865 +0200
@@ -31,6 +31,7 @@
import java.util.List;
import javax.xml.bind.JAXBException;
+import javax.xml.bind.Unmarshaller;
import javax.xml.bind.UnmarshallerHandler;
import javax.xml.validation.ValidatorHandler;
@@ -45,7 +46,6 @@
import com.sun.xml.internal.xsom.XSAnnotation;
import com.sun.xml.internal.xsom.XSComponent;
import com.sun.xml.internal.xsom.XSSchemaSet;
-import com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl;
import org.w3c.dom.Element;
import org.xml.sax.SAXException;
@@ -217,7 +217,7 @@
public void apply(XSSchemaSet schema, ErrorReceiver errorReceiver) {
if(topLevel!=null) {
this.errorReceiver = errorReceiver;
- UnmarshallerImpl u = BindInfo.getJAXBContext().createUnmarshaller();
+ Unmarshaller u = BindInfo.getCustomizationUnmarshaller();
this.unmarshaller = u.getUnmarshallerHandler();
ValidatorHandler v = BindInfo.bindingFileSchema.newValidator();
v.setErrorHandler(errorReceiver);
--- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/xmlschema/BGMBuilder.java 2013-04-04 15:27:13.744612869 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/xmlschema/BGMBuilder.java 2013-04-04 15:27:13.684612868 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -57,6 +57,7 @@
import com.sun.tools.internal.xjc.util.CodeModelClassFactory;
import com.sun.tools.internal.xjc.util.ErrorReceiverFilter;
import com.sun.xml.internal.bind.api.impl.NameConverter;
+import com.sun.xml.internal.bind.v2.util.XmlFactory;
import com.sun.xml.internal.xsom.XSAnnotation;
import com.sun.xml.internal.xsom.XSAttributeUse;
import com.sun.xml.internal.xsom.XSComponent;
@@ -228,7 +229,7 @@
}
// obtain the name conversion mode
- if(globalBinding.nameConverter!=null)
+ if (globalBinding.nameConverter!=null)
model.setNameConverter(globalBinding.nameConverter);
// attach global conversions to the appropriate simple types
@@ -498,8 +499,10 @@
*/
public Transformer getIdentityTransformer() {
try {
- if(identityTransformer==null)
- identityTransformer = TransformerFactory.newInstance().newTransformer();
+ if(identityTransformer==null) {
+ TransformerFactory tf = XmlFactory.createTransformerFactory(model.options.disableXmlSecurity);
+ identityTransformer = tf.newTransformer();
+ }
return identityTransformer;
} catch (TransformerConfigurationException e) {
throw new Error(e); // impossible
--- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/xmlschema/SimpleTypeBuilder.java 2013-04-04 15:27:14.016612874 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/xmlschema/SimpleTypeBuilder.java 2013-04-04 15:27:13.968612873 +0200
@@ -39,9 +39,11 @@
import java.util.Stack;
import javax.activation.MimeTypeParseException;
+import javax.xml.bind.DatatypeConverter;
import com.sun.codemodel.internal.JJavaName;
import com.sun.codemodel.internal.util.JavadocEscapeWriter;
+import com.sun.xml.internal.bind.v2.WellKnownNamespace;
import com.sun.tools.internal.xjc.ErrorReceiver;
import com.sun.tools.internal.xjc.model.CBuiltinLeafInfo;
import com.sun.tools.internal.xjc.model.CClassInfo;
@@ -62,10 +64,10 @@
import com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.BindInfo;
import com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.EnumMemberMode;
import com.sun.tools.internal.xjc.util.MimeTypeRange;
-import com.sun.xml.internal.bind.DatatypeConverterImpl;
-import com.sun.xml.internal.bind.v2.WellKnownNamespace;
+
import static com.sun.xml.internal.bind.v2.WellKnownNamespace.XML_MIME_URI;
-import com.sun.xml.internal.bind.v2.runtime.SwaRefAdapter;
+
+import com.sun.xml.internal.bind.v2.runtime.SwaRefAdapterMarker;
import com.sun.xml.internal.xsom.XSAttributeDecl;
import com.sun.xml.internal.xsom.XSComplexType;
import com.sun.xml.internal.xsom.XSComponent;
@@ -393,7 +395,7 @@
if(type.getTargetNamespace().equals(WellKnownNamespace.SWA_URI)) {
String name = type.getName();
if(name!=null && name.equals("swaRef"))
- return CBuiltinLeafInfo.STRING.makeAdapted(SwaRefAdapter.class,false);
+ return CBuiltinLeafInfo.STRING.makeAdapted(SwaRefAdapterMarker.class,false);
}
@@ -668,7 +670,7 @@
if (mem!=null) {
name = mem.name;
- if (mdoc != null) {
+ if (mdoc == null) {
mdoc = mem.javadoc;
}
}
@@ -846,7 +848,7 @@
XSFacet me = initiatingType.getFacet(facetName);
if(me==null)
return null;
- BigInteger bi = DatatypeConverterImpl._parseInteger(me.getValue().value);
+ BigInteger bi = DatatypeConverter.parseInteger(me.getValue().value);
if(offset!=0)
bi = bi.add(BigInteger.valueOf(offset));
return bi;
--- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/AnnotationParserFactoryImpl.java 2013-04-04 15:27:14.236612877 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/AnnotationParserFactoryImpl.java 2013-04-04 15:27:14.184612876 +0200
@@ -67,7 +67,7 @@
public AnnotationParser create() {
return new AnnotationParser() {
- private Unmarshaller u = BindInfo.getJAXBContext().createUnmarshaller();
+ private Unmarshaller u = BindInfo.getCustomizationUnmarshaller();
private UnmarshallerHandler handler;
--- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BindInfo.java 2013-04-04 15:27:14.468612881 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BindInfo.java 2013-04-04 15:27:14.416612880 +0200
@@ -35,6 +35,7 @@
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
+import javax.xml.bind.Unmarshaller;
import javax.xml.bind.annotation.XmlAnyElement;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlMixed;
@@ -46,6 +47,7 @@
import javax.xml.transform.stream.StreamResult;
import com.sun.codemodel.internal.JDocComment;
+import com.sun.xml.internal.bind.v2.WellKnownNamespace;
import com.sun.tools.internal.xjc.SchemaCache;
import com.sun.tools.internal.xjc.model.CCustomizations;
import com.sun.tools.internal.xjc.model.CPluginCustomization;
@@ -54,8 +56,6 @@
import com.sun.tools.internal.xjc.reader.xmlschema.BGMBuilder;
import com.sun.xml.internal.bind.annotation.XmlLocation;
import com.sun.xml.internal.bind.marshaller.MinimumEscapeHandler;
-import com.sun.xml.internal.bind.v2.WellKnownNamespace;
-import com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl;
import com.sun.xml.internal.xsom.XSComponent;
import org.w3c.dom.Element;
@@ -69,7 +69,7 @@
* @author
* Kohsuke Kawaguchi (kohsuke,kawaguchi@sun.com)
*/
-@XmlRootElement(namespace=WellKnownNamespace.XML_SCHEMA,name="annotation")
+@XmlRootElement(namespace= WellKnownNamespace.XML_SCHEMA,name="annotation")
@XmlType(namespace=WellKnownNamespace.XML_SCHEMA,name="foobar")
public final class BindInfo implements Iterable {
@@ -311,33 +311,42 @@
/**
* Lazily prepared {@link JAXBContext}.
*/
- private static JAXBContextImpl customizationContext;
+ private static volatile JAXBContext customizationContext;
- public static JAXBContextImpl getJAXBContext() {
- synchronized(AnnotationParserFactoryImpl.class) {
- try {
- if(customizationContext==null)
- customizationContext = new JAXBContextImpl.JAXBContextBuilder().setClasses(
- new Class[] {
- BindInfo.class, // for xs:annotation
- BIClass.class,
- BIConversion.User.class,
- BIConversion.UserAdapter.class,
- BIDom.class,
- BIFactoryMethod.class,
- BIInlineBinaryData.class,
- BIXDom.class,
- BIXSubstitutable.class,
- BIEnum.class,
- BIEnumMember.class,
- BIGlobalBinding.class,
- BIProperty.class,
- BISchemaBinding.class
- }).build();
- return customizationContext;
- } catch (JAXBException e) {
- throw new AssertionError(e);
+ public static JAXBContext getCustomizationContext() {
+ try {
+ if (customizationContext == null) {
+ synchronized (BindInfo.class) {
+ if (customizationContext == null) {
+ customizationContext = JAXBContext.newInstance(
+ BindInfo.class, // for xs:annotation
+ BIClass.class,
+ BIConversion.User.class,
+ BIConversion.UserAdapter.class,
+ BIDom.class,
+ BIFactoryMethod.class,
+ BIInlineBinaryData.class,
+ BIXDom.class,
+ BIXSubstitutable.class,
+ BIEnum.class,
+ BIEnumMember.class,
+ BIGlobalBinding.class,
+ BIProperty.class,
+ BISchemaBinding.class);
+ }
+ }
}
+ return customizationContext;
+ } catch (JAXBException e) {
+ throw new AssertionError(e);
+ }
+ }
+
+ public static Unmarshaller getCustomizationUnmarshaller() {
+ try {
+ return getCustomizationContext().createUnmarshaller();
+ } catch (JAXBException e) {
+ throw new AssertionError(e);
}
}
--- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/DomHandlerEx.java 2013-04-04 15:27:14.700612884 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/DomHandlerEx.java 2013-04-04 15:27:14.652612883 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -34,6 +34,8 @@
import com.sun.xml.internal.bind.marshaller.SAX2DOMEx;
+import com.sun.xml.internal.bind.v2.util.XmlFactory;
+import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.xml.sax.Locator;
@@ -76,12 +78,14 @@
ResultImpl() {
try {
- s2d = new SAX2DOMEx();
+ DocumentBuilderFactory factory = XmlFactory.createDocumentBuilderFactory(false); // safe - only used for BI
+ s2d = new SAX2DOMEx(factory);
} catch (ParserConfigurationException e) {
throw new AssertionError(e); // impossible
}
XMLFilterImpl f = new XMLFilterImpl() {
+ @Override
public void setDocumentLocator(Locator locator) {
super.setDocumentLocator(locator);
location = new LocatorImpl(locator);
--- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/xmlschema/parser/SchemaConstraintChecker.java 2013-04-04 15:27:14.980612889 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/xmlschema/parser/SchemaConstraintChecker.java 2013-04-04 15:27:14.916612888 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -36,6 +36,7 @@
import com.sun.tools.internal.xjc.ErrorReceiver;
import com.sun.tools.internal.xjc.util.ErrorReceiverFilter;
+import com.sun.xml.internal.bind.v2.util.XmlFactory;
import org.w3c.dom.ls.LSInput;
import org.w3c.dom.ls.LSResourceResolver;
import org.xml.sax.EntityResolver;
@@ -60,12 +61,14 @@
* @return true if there was no error, false if there were errors.
*/
public static boolean check(InputSource[] schemas,
- ErrorReceiver errorHandler, final EntityResolver entityResolver) {
+ ErrorReceiver errorHandler,
+ final EntityResolver entityResolver,
+ boolean disableXmlSecurity) {
ErrorReceiverFilter errorFilter = new ErrorReceiverFilter(errorHandler);
boolean hadErrors = false;
- SchemaFactory sf = SchemaFactory.newInstance(W3C_XML_SCHEMA_NS_URI);
+ SchemaFactory sf = XmlFactory.createSchemaFactory(W3C_XML_SCHEMA_NS_URI, disableXmlSecurity);
sf.setErrorHandler(errorFilter);
if( entityResolver != null ) {
sf.setResourceResolver(new LSResourceResolver() {
@@ -121,6 +124,6 @@
for (int i = 0; i < args.length; i++)
sources[i] = new InputSource(new File(args[i]).toURL().toExternalForm());
- check(sources, new ConsoleErrorReporter(), null);
+ check(sources, new ConsoleErrorReporter(), null, true);
}
}
--- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/util/DOMUtils.java 2013-04-04 15:27:15.216612892 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/util/DOMUtils.java 2013-04-04 15:27:15.164612891 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -123,25 +123,6 @@
return null;
}
-// these implementations look wrong to me, since getElementsByTagName returns
-// all the elements in descendants, not just children.
-//
-// public static Element[] getChildElements(Element parent, QName qname) {
-// NodeList children = parent.getElementsByTagNameNS(qname.uri, qname.localpart);
-// return getElements(children);
-// }
-//
-// public static Element[] getChildElements(Element parent, String namespaceURI,
-// String localName) {
-// NodeList children = parent.getElementsByTagNameNS(namespaceURI, localName);
-// return getElements(children);
-// }
-//
-// public static Element[] getChildElements(Element parent, String name) {
-// NodeList children = parent.getElementsByTagName(name);
-// return getElements(children);
-// }
-
public static Element[] getElements(NodeList children) {
Element[] elements = null;
int len = 0;
--- old/src/share/jaxws_classes/com/sun/tools/internal/xjc/util/Util.java 2013-04-04 15:27:15.448612896 +0200
+++ new/src/share/jaxws_classes/com/sun/tools/internal/xjc/util/Util.java 2013-04-04 15:27:15.388612895 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/xml/internal/bind/DatatypeConverterImpl.java 2013-04-04 15:27:15.748612901 +0200
+++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/DatatypeConverterImpl.java 2013-04-04 15:27:15.684612900 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -57,7 +57,11 @@
* @deprecated in JAXB 2.2.4 - use javax.xml.bind.DatatypeConverterImpl instead
* or let us know why you can't
*/
-public final class DatatypeConverterImpl {
+@Deprecated
+public final class DatatypeConverterImpl implements DatatypeConverterInterface {
+
+ @Deprecated
+ public static final DatatypeConverterInterface theInstance = new DatatypeConverterImpl();
protected DatatypeConverterImpl() {
// shall not be used
@@ -874,4 +878,239 @@
buf.append(n);
}
}
+
+ // DEPRECATED METHODS, KEPT FOR JAXB1 GENERATED CLASSES COMPATIBILITY, WILL BE REMOVED IN FUTURE
+
+ @Deprecated
+ public String parseString(String lexicalXSDString) {
+ return lexicalXSDString;
+ }
+
+ @Deprecated
+ public BigInteger parseInteger(String lexicalXSDInteger) {
+ return _parseInteger(lexicalXSDInteger);
+ }
+
+ @Deprecated
+ public String printInteger(BigInteger val) {
+ return _printInteger(val);
+ }
+
+ @Deprecated
+ public int parseInt(String s) {
+ return _parseInt(s);
+ }
+
+ @Deprecated
+ public long parseLong(String lexicalXSLong) {
+ return _parseLong(lexicalXSLong);
+ }
+
+ @Deprecated
+ public short parseShort(String lexicalXSDShort) {
+ return _parseShort(lexicalXSDShort);
+ }
+
+ @Deprecated
+ public String printShort(short val) {
+ return _printShort(val);
+ }
+
+ @Deprecated
+ public BigDecimal parseDecimal(String content) {
+ return _parseDecimal(content);
+ }
+
+ @Deprecated
+ public float parseFloat(String lexicalXSDFloat) {
+ return _parseFloat(lexicalXSDFloat);
+ }
+
+ @Deprecated
+ public String printFloat(float v) {
+ return _printFloat(v);
+ }
+
+ @Deprecated
+ public double parseDouble(String lexicalXSDDouble) {
+ return _parseDouble(lexicalXSDDouble);
+ }
+
+ @Deprecated
+ public boolean parseBoolean(String lexicalXSDBoolean) {
+ Boolean b = _parseBoolean(lexicalXSDBoolean);
+ return (b == null) ? false : b.booleanValue();
+ }
+
+ @Deprecated
+ public String printBoolean(boolean val) {
+ return val ? "true" : "false";
+ }
+
+ @Deprecated
+ public byte parseByte(String lexicalXSDByte) {
+ return _parseByte(lexicalXSDByte);
+ }
+
+ @Deprecated
+ public String printByte(byte val) {
+ return _printByte(val);
+ }
+
+ @Deprecated
+ public QName parseQName(String lexicalXSDQName, NamespaceContext nsc) {
+ return _parseQName(lexicalXSDQName, nsc);
+ }
+
+ @Deprecated
+ public Calendar parseDateTime(String lexicalXSDDateTime) {
+ return _parseDateTime(lexicalXSDDateTime);
+ }
+
+ @Deprecated
+ public String printDateTime(Calendar val) {
+ return _printDateTime(val);
+ }
+
+ @Deprecated
+ public byte[] parseBase64Binary(String lexicalXSDBase64Binary) {
+ return _parseBase64Binary(lexicalXSDBase64Binary);
+ }
+
+ @Deprecated
+ public byte[] parseHexBinary(String s) {
+ final int len = s.length();
+
+ // "111" is not a valid hex encoding.
+ if (len % 2 != 0) {
+ throw new IllegalArgumentException("hexBinary needs to be even-length: " + s);
+ }
+
+ byte[] out = new byte[len / 2];
+
+ for (int i = 0; i < len; i += 2) {
+ int h = hexToBin(s.charAt(i));
+ int l = hexToBin(s.charAt(i + 1));
+ if (h == -1 || l == -1) {
+ throw new IllegalArgumentException("contains illegal character for hexBinary: " + s);
+ }
+
+ out[i / 2] = (byte) (h * 16 + l);
+ }
+
+ return out;
+ }
+
+ @Deprecated
+ private static int hexToBin(char ch) {
+ if ('0' <= ch && ch <= '9') {
+ return ch - '0';
+ }
+ if ('A' <= ch && ch <= 'F') {
+ return ch - 'A' + 10;
+ }
+ if ('a' <= ch && ch <= 'f') {
+ return ch - 'a' + 10;
+ }
+ return -1;
+ }
+
+ @Deprecated
+ private static final char[] hexCode = "0123456789ABCDEF".toCharArray();
+
+ @Deprecated
+ public String printHexBinary(byte[] data) {
+ StringBuilder r = new StringBuilder(data.length * 2);
+ for (byte b : data) {
+ r.append(hexCode[(b >> 4) & 0xF]);
+ r.append(hexCode[(b & 0xF)]);
+ }
+ return r.toString();
+ }
+
+ @Deprecated
+ public long parseUnsignedInt(String lexicalXSDUnsignedInt) {
+ return _parseLong(lexicalXSDUnsignedInt);
+ }
+
+ @Deprecated
+ public String printUnsignedInt(long val) {
+ return _printLong(val);
+ }
+
+ @Deprecated
+ public int parseUnsignedShort(String lexicalXSDUnsignedShort) {
+ return _parseInt(lexicalXSDUnsignedShort);
+ }
+
+ @Deprecated
+ public Calendar parseTime(String lexicalXSDTime) {
+ return datatypeFactory.newXMLGregorianCalendar(lexicalXSDTime).toGregorianCalendar();
+ }
+
+ @Deprecated
+ public String printTime(Calendar val) {
+ return CalendarFormatter.doFormat("%h:%m:%s%z", val);
+ }
+
+ @Deprecated
+ public Calendar parseDate(String lexicalXSDDate) {
+ return datatypeFactory.newXMLGregorianCalendar(lexicalXSDDate).toGregorianCalendar();
+ }
+
+ @Deprecated
+ public String printDate(Calendar val) {
+ return _printDate(val);
+ }
+
+ @Deprecated
+ public String parseAnySimpleType(String lexicalXSDAnySimpleType) {
+ return lexicalXSDAnySimpleType;
+ }
+
+ @Deprecated
+ public String printString(String val) {
+ return val;
+ }
+
+ @Deprecated
+ public String printInt(int val) {
+ return _printInt(val);
+ }
+
+ @Deprecated
+ public String printLong(long val) {
+ return _printLong(val);
+ }
+
+ @Deprecated
+ public String printDecimal(BigDecimal val) {
+ return _printDecimal(val);
+ }
+
+ @Deprecated
+ public String printDouble(double v) {
+ return _printDouble(v);
+ }
+
+ @Deprecated
+ public String printQName(QName val, NamespaceContext nsc) {
+ return _printQName(val, nsc);
+ }
+
+ @Deprecated
+ public String printBase64Binary(byte[] val) {
+ return _printBase64Binary(val);
+ }
+
+ @Deprecated
+ public String printUnsignedShort(int val) {
+ return String.valueOf(val);
+ }
+
+ @Deprecated
+ public String printAnySimpleType(String val) {
+ return val;
+ }
+
}
--- old/src/share/jaxws_classes/com/sun/xml/internal/bind/InternalAccessorFactory.java 2013-04-04 15:27:15.996612904 +0200
+++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/InternalAccessorFactory.java 2013-04-04 15:27:15.944612904 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -31,7 +31,7 @@
/**
* A means to allow the user to provide customized Accessor
- * to be used by JAXB. Adds ability to supress warnings.
+ * to be used by JAXB. Adds ability to suppress warnings.
*/
public interface InternalAccessorFactory extends AccessorFactory {
/**
@@ -40,7 +40,7 @@
* @param bean the class to be processed.
* @param f the field within the class to be accessed.
* @param readOnly the isStatic value of the field's modifier.
- * @param supressWarnings supress reflection warnings
+ * @param supressWarnings suppress reflection warnings
* @return Accessor the accessor for this field
*
* @throws JAXBException reports failures of the method.
--- old/src/share/jaxws_classes/com/sun/xml/internal/bind/Util.java 2013-04-04 15:27:16.236612908 +0200
+++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/Util.java 2013-04-04 15:27:16.184612907 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, 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
@@ -40,10 +40,9 @@
*/
public static Logger getClassLogger() {
try {
-// StackTraceElement[] trace = Thread.currentThread().getStackTrace();
StackTraceElement[] trace = new Exception().getStackTrace();
return Logger.getLogger(trace[1].getClassName());
- } catch( SecurityException _ ) {
+ } catch( SecurityException e) {
return Logger.getLogger("com.sun.xml.internal.bind"); // use the default
}
}
--- old/src/share/jaxws_classes/com/sun/xml/internal/bind/WhiteSpaceProcessor.java 2013-04-04 15:27:16.464612911 +0200
+++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/WhiteSpaceProcessor.java 2013-04-04 15:27:16.416612911 +0200
@@ -166,7 +166,7 @@
/**
* Returns true if the specified string is all whitespace.
*/
- public static final boolean isWhiteSpace(CharSequence s) {
+ public static boolean isWhiteSpace(CharSequence s) {
for( int i=s.length()-1; i>=0; i-- )
if(!isWhiteSpace(s.charAt(i)))
return false;
@@ -174,7 +174,7 @@
}
/** returns true if the specified char is a white space character. */
- public static final boolean isWhiteSpace(char ch) {
+ public static boolean isWhiteSpace(char ch) {
// most of the characters are non-control characters.
// so check that first to quickly return false for most of the cases.
if( ch>0x20 ) return false;
@@ -187,7 +187,7 @@
* Returns true if the specified char is a white space character
* but not 0x20.
*/
- protected static final boolean isWhiteSpaceExceptSpace(char ch) {
+ protected static boolean isWhiteSpaceExceptSpace(char ch) {
// most of the characters are non-control characters.
// so check that first to quickly return false for most of the cases.
if( ch>=0x20 ) return false;
--- old/src/share/jaxws_classes/com/sun/xml/internal/bind/api/JAXBRIContext.java 2013-04-04 15:27:16.700612915 +0200
+++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/api/JAXBRIContext.java 2013-04-04 15:27:16.644612914 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -47,6 +47,7 @@
import com.sun.xml.internal.bind.v2.model.annotation.RuntimeAnnotationReader;
import com.sun.xml.internal.bind.v2.model.nav.Navigator;
import com.sun.xml.internal.bind.v2.model.runtime.RuntimeTypeInfoSet;
+import java.util.HashMap;
/**
* {@link JAXBContext} enhanced with JAXB RI specific functionalities.
@@ -93,7 +94,7 @@
@Nullable Map subclassReplacements,
@Nullable String defaultNamespaceRemap, boolean c14nSupport,
@Nullable RuntimeAnnotationReader ar) throws JAXBException {
- return ContextFactory.createContext(classes, typeRefs, subclassReplacements,
+ return newInstance(classes, typeRefs, subclassReplacements,
defaultNamespaceRemap, c14nSupport, ar, false, false, false, false);
}
@@ -135,9 +136,21 @@
@Nullable Map subclassReplacements,
@Nullable String defaultNamespaceRemap, boolean c14nSupport,
@Nullable RuntimeAnnotationReader ar,
- boolean xmlAccessorFactorySupport, boolean allNillable, boolean retainPropertyInfo, boolean supressAccessorWarnings) throws JAXBException {
- return ContextFactory.createContext(classes, typeRefs, subclassReplacements,
- defaultNamespaceRemap, c14nSupport, ar, xmlAccessorFactorySupport, allNillable, retainPropertyInfo, supressAccessorWarnings);
+ boolean xmlAccessorFactorySupport,
+ boolean allNillable,
+ boolean retainPropertyInfo,
+ boolean supressAccessorWarnings) throws JAXBException {
+ Map properties = new HashMap();
+ if (typeRefs != null) properties.put(JAXBRIContext.TYPE_REFERENCES, typeRefs);
+ if (subclassReplacements != null) properties.put(JAXBRIContext.SUBCLASS_REPLACEMENTS, subclassReplacements);
+ if (defaultNamespaceRemap != null) properties.put(JAXBRIContext.DEFAULT_NAMESPACE_REMAP, defaultNamespaceRemap);
+ if (ar != null) properties.put(JAXBRIContext.ANNOTATION_READER, ar);
+ properties.put(JAXBRIContext.CANONICALIZATION_SUPPORT, Boolean.valueOf(c14nSupport));
+ properties.put(JAXBRIContext.XMLACCESSORFACTORY_SUPPORT, Boolean.valueOf(xmlAccessorFactorySupport));
+ properties.put(JAXBRIContext.TREAT_EVERYTHING_NILLABLE, Boolean.valueOf(allNillable));
+ properties.put(JAXBRIContext.RETAIN_REFERENCE_TO_INFO, Boolean.valueOf(retainPropertyInfo));
+ properties.put(JAXBRIContext.SUPRESS_ACCESSOR_WARNINGS, Boolean.valueOf(supressAccessorWarnings));
+ return (JAXBRIContext) ContextFactory.createContext(classes, properties);
}
/**
@@ -407,7 +420,6 @@
return Navigator.REFLECTION.getBaseClass(type,baseType);
}
-
/**
* The property that you can specify to {@link JAXBContext#newInstance}
* to reassign the default namespace URI to something else at the runtime.
@@ -441,6 +453,7 @@
* and {@link Marshaller#setProperty(String, Object)}
* to enable the c14n marshalling support in the {@link JAXBContext}.
*
+ * Boolean
* @see C14nSupport_ArchitectureDocument
* @since 2.0 EA2
*/
@@ -451,6 +464,7 @@
* to allow unmarshaller to honor xsi:nil anywhere, even if they are
* not specifically allowed by the schema.
*
+ * Boolean
* @since 2.1.3
*/
public static final String TREAT_EVERYTHING_NILLABLE = "com.sun.xml.internal.bind.treatEverythingNillable";
@@ -492,6 +506,7 @@
/**
* Retains references to PropertyInfos.
*
+ * Boolean
* @since 2.1.10
*/
public static final String RETAIN_REFERENCE_TO_INFO = "retainReferenceToInfo";
@@ -499,6 +514,7 @@
/**
* Supress security warnings when trying to access fields through reflection.
*
+ * Boolean
* @since 2.1.14, 2.2.2
*/
public static final String SUPRESS_ACCESSOR_WARNINGS = "supressAccessorWarnings";
@@ -506,8 +522,17 @@
/**
* Improves handling of xsi:type used on leaf properties.
*
+ * Boolean
* @since 2.2.3
*/
public static final String IMPROVED_XSI_TYPE_HANDLING = "com.sun.xml.internal.bind.improvedXsiTypeHandling";
+ /**
+ * If true XML security features when parsing XML documents will be disabled.
+ * The default value is false.
+ *
+ * Boolean
+ * @since 2.2.6
+ */
+ public static final String DISABLE_XML_SECURITY = "com.sun.xml.internal.bind.disableXmlSecurity";
}
--- old/src/share/jaxws_classes/com/sun/xml/internal/bind/api/impl/NameConverter.java 2013-04-04 15:27:16.932612918 +0200
+++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/api/impl/NameConverter.java 2013-04-04 15:27:16.880612918 +0200
@@ -25,6 +25,7 @@
package com.sun.xml.internal.bind.api.impl;
+import javax.lang.model.SourceVersion;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
@@ -131,11 +132,6 @@
nsUri = nsUri.substring(idx+1);
}
- // issue 709; s/(.*)#(.*)/\1/
- idx = nsUri.indexOf("#");
- if(idx >= 0)
- nsUri = nsUri.substring(0, idx);
-
// tokenize string
ArrayList tokens = tokenize( nsUri, "/: " );
if( tokens.size() == 0 ) {
@@ -177,7 +173,7 @@
token = removeIllegalIdentifierChars( token );
// this will check for reserved keywords
- if( !NameUtil.isJavaIdentifier( token.toLowerCase() ) ) {
+ if (SourceVersion.isKeyword(token.toLowerCase())) {
token = '_' + token;
}
@@ -190,19 +186,16 @@
private static String removeIllegalIdentifierChars(String token) {
- StringBuffer newToken = new StringBuffer();
+ StringBuilder newToken = new StringBuilder(token.length() + 1); // max expected length
for( int i = 0; i < token.length(); i++ ) {
char c = token.charAt( i );
-
- if( i ==0 && !Character.isJavaIdentifierStart( c ) ) {
- // prefix an '_' if the first char is illegal
- newToken.append('_').append(c);
- } else if( !Character.isJavaIdentifierPart( c ) ) {
- // replace the char with an '_' if it is illegal
- newToken.append( '_' );
+ if (i == 0 && !Character.isJavaIdentifierStart(c)) { // c can't be used as FIRST char
+ newToken.append('_');
+ }
+ if (!Character.isJavaIdentifierPart(c)) { // c can't be used
+ newToken.append('_');
} else {
- // add the legal char
- newToken.append( c );
+ newToken.append(c); // c is valid
}
}
return newToken.toString();
@@ -267,7 +260,7 @@
public static final NameConverter smart = new Standard() {
public String toConstantName( String token ) {
String name = super.toConstantName(token);
- if( NameUtil.isJavaIdentifier(name) )
+ if(!SourceVersion.isKeyword(name))
return name;
else
return '_'+name;
--- old/src/share/jaxws_classes/com/sun/xml/internal/bind/api/impl/NameUtil.java 2013-04-04 15:27:17.136612922 +0200
+++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/api/impl/NameUtil.java 2013-04-04 15:27:17.084612921 +0200
@@ -26,6 +26,7 @@
package com.sun.xml.internal.bind.api.impl;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
@@ -324,108 +325,4 @@
}
return s;
}
-
-
- /**
- * Checks if a given string is usable as a Java identifier.
- */
- public static boolean isJavaIdentifier(String s) {
- if(s.length()==0) return false;
- if( reservedKeywords.contains(s) ) return false;
-
- if(!Character.isJavaIdentifierStart(s.charAt(0))) return false;
-
- for (int i = 1; i < s.length(); i++)
- if (!Character.isJavaIdentifierPart(s.charAt(i)))
- return false;
-
- return true;
- }
-
- /**
- * Checks if the given string is a valid Java package name.
- */
- public static boolean isJavaPackageName(String s) {
- while(s.length()!=0) {
- int idx = s.indexOf('.');
- if(idx==-1) idx=s.length();
- if( !isJavaIdentifier(s.substring(0,idx)) )
- return false;
-
- s = s.substring(idx);
- if(s.length()!=0) s = s.substring(1); // remove '.'
- }
- return true;
- }
-
-
- /** All reserved keywords of Java. */
- private static HashSet reservedKeywords = new HashSet();
-
- static {
- // see http://java.sun.com/docs/books/tutorial/java/nutsandbolts/_keywords.html
- String[] words = new String[]{
- "abstract",
- "boolean",
- "break",
- "byte",
- "case",
- "catch",
- "char",
- "class",
- "const",
- "continue",
- "default",
- "do",
- "double",
- "else",
- "extends",
- "final",
- "finally",
- "float",
- "for",
- "goto",
- "if",
- "implements",
- "import",
- "instanceof",
- "int",
- "interface",
- "long",
- "native",
- "new",
- "package",
- "private",
- "protected",
- "public",
- "return",
- "short",
- "static",
- "strictfp",
- "super",
- "switch",
- "synchronized",
- "this",
- "throw",
- "throws",
- "transient",
- "try",
- "void",
- "volatile",
- "while",
-
- // technically these are not reserved words but they cannot be used as identifiers.
- "true",
- "false",
- "null",
-
- // and I believe assert is also a new keyword
- "assert",
-
- // and 5.0 keywords
- "enum"
- };
- for (String word : words)
- reservedKeywords.add(word);
- }
}
--- old/src/share/jaxws_classes/com/sun/xml/internal/bind/marshaller/SAX2DOMEx.java 2013-04-04 15:27:17.356612926 +0200
+++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/marshaller/SAX2DOMEx.java 2013-04-04 15:27:17.300612924 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -23,11 +23,6 @@
* questions.
*/
-/*
- * SAX2DOMEx.java
- *
- * Created on February 22, 2002, 1:55 PM
- */
package com.sun.xml.internal.bind.marshaller;
import java.util.Stack;
@@ -38,6 +33,7 @@
import com.sun.xml.internal.bind.util.Which;
import com.sun.istack.internal.FinalArrayList;
+import com.sun.xml.internal.bind.v2.util.XmlFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -90,9 +86,19 @@
/**
* Creates a fresh empty DOM document and adds nodes under this document.
*/
+ public SAX2DOMEx(DocumentBuilderFactory f) throws ParserConfigurationException {
+ f.setValidating(false);
+ document = f.newDocumentBuilder().newDocument();
+ node = document;
+ nodeStack.push(document);
+ }
+
+ /**
+ * Creates a fresh empty DOM document and adds nodes under this document.
+ * @deprecated
+ */
public SAX2DOMEx() throws ParserConfigurationException {
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
- factory.setNamespaceAware(true);
+ DocumentBuilderFactory factory = XmlFactory.createDocumentBuilderFactory(false);
factory.setValidating(false);
document = factory.newDocumentBuilder().newDocument();
@@ -143,7 +149,7 @@
public void startElement(String namespace, String localName, String qName, Attributes attrs) {
Node parent = nodeStack.peek();
- // some broken DOM implementatino (we confirmed it with SAXON)
+ // some broken DOM implementation (we confirmed it with SAXON)
// return null from this method.
Element element = document.createElementNS(namespace, qName);
@@ -158,7 +164,7 @@
// process namespace bindings
for (int i = 0; i < unprocessedNamespaces.size(); i += 2) {
- String prefix = unprocessedNamespaces.get(i + 0);
+ String prefix = unprocessedNamespaces.get(i);
String uri = unprocessedNamespaces.get(i + 1);
namespace(element, prefix, uri);
--- old/src/share/jaxws_classes/com/sun/xml/internal/bind/util/SecureLoader.java 2013-04-04 15:27:17.600612929 +0200
+++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/util/SecureLoader.java 2013-04-04 15:27:17.544612928 +0200
@@ -37,9 +37,9 @@
if (System.getSecurityManager() == null) {
return Thread.currentThread().getContextClassLoader();
} else {
- return (ClassLoader) java.security.AccessController.doPrivileged(
- new java.security.PrivilegedAction() {
- public java.lang.Object run() {
+ return java.security.AccessController.doPrivileged(
+ new java.security.PrivilegedAction() {
+ public ClassLoader run() {
return Thread.currentThread().getContextClassLoader();
}
});
@@ -50,9 +50,9 @@
if (System.getSecurityManager() == null) {
return c.getClassLoader();
} else {
- return (ClassLoader) java.security.AccessController.doPrivileged(
- new java.security.PrivilegedAction() {
- public java.lang.Object run() {
+ return java.security.AccessController.doPrivileged(
+ new java.security.PrivilegedAction() {
+ public ClassLoader run() {
return c.getClassLoader();
}
});
@@ -63,9 +63,9 @@
if (System.getSecurityManager() == null) {
return ClassLoader.getSystemClassLoader();
} else {
- return (ClassLoader) java.security.AccessController.doPrivileged(
- new java.security.PrivilegedAction() {
- public java.lang.Object run() {
+ return java.security.AccessController.doPrivileged(
+ new java.security.PrivilegedAction() {
+ public ClassLoader run() {
return ClassLoader.getSystemClassLoader();
}
});
--- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/ClassFactory.java 2013-04-04 15:27:17.816612932 +0200
+++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/ClassFactory.java 2013-04-04 15:27:17.764612931 +0200
@@ -120,7 +120,7 @@
/**
* The same as {@link #create0} but with an error handling to make
- * the instanciation error fatal.
+ * the instantiation error fatal.
*/
public static T create( Class clazz ) {
try {
--- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/ContextFactory.java 2013-04-04 15:27:18.056612936 +0200
+++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/ContextFactory.java 2013-04-04 15:27:18.004612935 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -60,10 +60,11 @@
* @author Kohsuke Kawaguchi
*/
public class ContextFactory {
+
/**
* The API will invoke this method via reflection
*/
- public static JAXBContext createContext( Class[] classes, Map properties ) throws JAXBException {
+ public static JAXBContext createContext(Class[] classes, Map properties ) throws JAXBException {
// fool-proof check, and copy the map to make it easier to find unrecognized properties.
if(properties==null)
properties = Collections.emptyMap();
@@ -76,6 +77,10 @@
if(c14nSupport==null)
c14nSupport = false;
+ Boolean disablesecurityProcessing = getPropertyValue(properties, JAXBRIContext.DISABLE_XML_SECURITY, Boolean.class);
+ if (disablesecurityProcessing==null)
+ disablesecurityProcessing = false;
+
Boolean allNillable = getPropertyValue(properties,JAXBRIContext.TREAT_EVERYTHING_NILLABLE,Boolean.class);
if(allNillable==null)
allNillable = false;
@@ -89,8 +94,14 @@
supressAccessorWarnings = false;
Boolean improvedXsiTypeHandling = getPropertyValue(properties, JAXBRIContext.IMPROVED_XSI_TYPE_HANDLING, Boolean.class);
- if(improvedXsiTypeHandling == null)
- improvedXsiTypeHandling = true;
+ if (improvedXsiTypeHandling == null) {
+ String improvedXsiSystemProperty = Util.getSystemProperty(JAXBRIContext.IMPROVED_XSI_TYPE_HANDLING);
+ if (improvedXsiSystemProperty == null) {
+ improvedXsiTypeHandling = true;
+ } else {
+ improvedXsiTypeHandling = Boolean.valueOf(improvedXsiSystemProperty);
+ }
+ }
Boolean xmlAccessorFactorySupport = getPropertyValue(properties,
JAXBRIContext.XMLACCESSORFACTORY_SUPPORT,Boolean.class);
@@ -103,6 +114,11 @@
RuntimeAnnotationReader ar = getPropertyValue(properties,JAXBRIContext.ANNOTATION_READER,RuntimeAnnotationReader.class);
+ Collection tr = getPropertyValue(properties, JAXBRIContext.TYPE_REFERENCES, Collection.class);
+ if (tr == null) {
+ tr = Collections.emptyList();
+ }
+
Map subclassReplacements;
try {
subclassReplacements = TypeCast.checkedCast(
@@ -117,7 +133,7 @@
JAXBContextImpl.JAXBContextBuilder builder = new JAXBContextImpl.JAXBContextBuilder();
builder.setClasses(classes);
- builder.setTypeRefs(Collections.emptyList());
+ builder.setTypeRefs(tr);
builder.setSubclassReplacements(subclassReplacements);
builder.setDefaultNsUri(defaultNsUri);
builder.setC14NSupport(c14nSupport);
@@ -127,6 +143,7 @@
builder.setRetainPropertyInfo(retainPropertyInfo);
builder.setSupressAccessorWarnings(supressAccessorWarnings);
builder.setImprovedXsiTypeHandling(improvedXsiTypeHandling);
+ builder.setDisableSecurityProcessing(disablesecurityProcessing);
return builder.build();
}
@@ -144,6 +161,22 @@
return type.cast(o);
}
+ /**
+ *
+ * @param classes
+ * @param typeRefs
+ * @param subclassReplacements
+ * @param defaultNsUri
+ * @param c14nSupport
+ * @param ar
+ * @param xmlAccessorFactorySupport
+ * @param allNillable
+ * @param retainPropertyInfo
+ * @return
+ * @throws JAXBException
+ * @deprecated use createContext(Class[] classes, Map properties) method instead
+ */
+ @Deprecated
public static JAXBRIContext createContext( Class[] classes,
Collection typeRefs, Map subclassReplacements,
String defaultNsUri, boolean c14nSupport, RuntimeAnnotationReader ar,
@@ -154,6 +187,23 @@
allNillable, retainPropertyInfo, false);
}
+ /**
+ *
+ * @param classes
+ * @param typeRefs
+ * @param subclassReplacements
+ * @param defaultNsUri
+ * @param c14nSupport
+ * @param ar
+ * @param xmlAccessorFactorySupport
+ * @param allNillable
+ * @param retainPropertyInfo
+ * @param improvedXsiTypeHandling
+ * @return
+ * @throws JAXBException
+ * @deprecated use createContext( Class[] classes, Map properties) method instead
+ */
+ @Deprecated
public static JAXBRIContext createContext( Class[] classes,
Collection typeRefs, Map subclassReplacements,
String defaultNsUri, boolean c14nSupport, RuntimeAnnotationReader ar,
--- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/Messages.java 2013-04-04 15:27:18.284612940 +0200
+++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/Messages.java 2013-04-04 15:27:18.224612939 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -31,7 +31,7 @@
/**
* Formats error messages.
*/
-enum Messages {
+public enum Messages {
ILLEGAL_ENTRY, // 1 arg
ERROR_LOADING_CLASS, // 2 args
INVALID_PROPERTY_VALUE, // 2 args
@@ -39,6 +39,7 @@
BROKEN_CONTEXTPATH, // 1 arg
NO_DEFAULT_CONSTRUCTOR_IN_INNER_CLASS, // 1 arg
INVALID_TYPE_IN_MAP, // 0args
+ INVALID_JAXP_IMPLEMENTATION, // 1 arg
;
private static final ResourceBundle rb = ResourceBundle.getBundle(Messages.class.getName());
--- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/Messages.properties 2013-04-04 15:27:18.532612944 +0200
+++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/Messages.properties 2013-04-04 15:27:18.480612943 +0200
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 2012, 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
@@ -47,3 +47,6 @@
INVALID_TYPE_IN_MAP = \
Map contains a wrong type
+
+INVALID_JAXP_IMPLEMENTATION = \
+ You are running with invalid JAXP api or implementation. JAXP api/implementation of version 1.3.1 (included in JDK6) or higher is required. In case you are using ant, make sure ant 1.7.0 or higher is used - older versions of ant contain JAXP api/impl version 1.2 (in xml-apis.jar). If you want to keep using older ant versions, you have to configure it to use higher the JAXP api/impl versions.
--- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/annotation/Init.java 2013-04-04 15:27:18.748612947 +0200
+++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/annotation/Init.java 2013-04-04 15:27:18.700612946 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/annotation/XmlAttributeQuick.java 2013-04-04 15:27:18.984612950 +0200
+++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/annotation/XmlAttributeQuick.java 2013-04-04 15:27:18.924612949 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/annotation/XmlElementDeclQuick.java 2013-04-04 15:27:19.204612954 +0200
+++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/annotation/XmlElementDeclQuick.java 2013-04-04 15:27:19.152612953 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/annotation/XmlElementQuick.java 2013-04-04 15:27:19.424612957 +0200
+++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/annotation/XmlElementQuick.java 2013-04-04 15:27:19.372612957 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/annotation/XmlElementRefQuick.java 2013-04-04 15:27:19.680612961 +0200
+++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/annotation/XmlElementRefQuick.java 2013-04-04 15:27:19.632612961 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/annotation/XmlElementRefsQuick.java 2013-04-04 15:27:19.936612965 +0200
+++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/annotation/XmlElementRefsQuick.java 2013-04-04 15:27:19.884612964 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/annotation/XmlEnumQuick.java 2013-04-04 15:27:20.216612970 +0200
+++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/annotation/XmlEnumQuick.java 2013-04-04 15:27:20.156612969 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/annotation/XmlRootElementQuick.java 2013-04-04 15:27:20.476612974 +0200
+++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/annotation/XmlRootElementQuick.java 2013-04-04 15:27:20.428612973 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/annotation/XmlSchemaQuick.java 2013-04-04 15:27:20.696612978 +0200
+++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/annotation/XmlSchemaQuick.java 2013-04-04 15:27:20.648612977 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/annotation/XmlSchemaTypeQuick.java 2013-04-04 15:27:20.984612982 +0200
+++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/annotation/XmlSchemaTypeQuick.java 2013-04-04 15:27:20.924612981 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/annotation/XmlTransientQuick.java 2013-04-04 15:27:21.220612985 +0200
+++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/annotation/XmlTransientQuick.java 2013-04-04 15:27:21.172612984 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/annotation/XmlTypeQuick.java 2013-04-04 15:27:21.488612990 +0200
+++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/annotation/XmlTypeQuick.java 2013-04-04 15:27:21.436612989 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/annotation/XmlValueQuick.java 2013-04-04 15:27:21.756612994 +0200
+++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/annotation/XmlValueQuick.java 2013-04-04 15:27:21.700612993 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/core/ErrorHandler.java 2013-04-04 15:27:22.000612998 +0200
+++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/core/ErrorHandler.java 2013-04-04 15:27:21.944612996 +0200
@@ -25,24 +25,23 @@
package com.sun.xml.internal.bind.v2.model.core;
-import com.sun.xml.internal.bind.v2.model.impl.ModelBuilder;
import com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationException;
/**
* listen to static errors found during building a JAXB model from a set of classes.
- * Implemented by the client of {@link ModelBuilder}.
+ * Implemented by the client of {@link com.sun.xml.internal.bind.v2.model.impl.ModelBuilder}.
*
*
* All the static errors have to be reported while constructing a
- * model, not when a model is used (IOW, until the {@link ModelBuilder#link} completes.
- * Internally, {@link ModelBuilder} wraps an {@link ErrorHandler} and all the model
+ * model, not when a model is used (IOW, until the {@link com.sun.xml.internal.bind.v2.model.impl.ModelBuilder#link} completes.
+ * Internally, {@link com.sun.xml.internal.bind.v2.model.impl.ModelBuilder} wraps an {@link ErrorHandler} and all the model
* components should report errors through it.
*
*
* {@link IllegalAnnotationException} is a checked exception to remind
* the model classes to report it rather than to throw it.
*
- * @see ModelBuilder
+ * @see com.sun.xml.internal.bind.v2.model.impl.ModelBuilder
* @author Kohsuke Kawaguchi
*/
public interface ErrorHandler {
--- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/core/PropertyInfo.java 2013-04-04 15:27:22.212613001 +0200
+++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/core/PropertyInfo.java 2013-04-04 15:27:22.160613000 +0200
@@ -98,7 +98,7 @@
Collection extends TypeInfo> ref();
/**
- * Gets the kind of this proeprty.
+ * Gets the kind of this property.
*
* @return
* always non-null.
--- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/core/PropertyKind.java 2013-04-04 15:27:22.440613004 +0200
+++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/core/PropertyKind.java 2013-04-04 15:27:22.376613003 +0200
@@ -29,9 +29,6 @@
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlInlineBinaryData;
-import com.sun.xml.internal.bind.v2.runtime.property.PropertyFactory;
-
-
/**
* An Enum that indicates if the property is
* Element, ElementRef, Value, or Attribute.
@@ -60,7 +57,7 @@
public final boolean isOrdered;
/**
- * {@link PropertyFactory} benefits from having index numbers assigned to
+ * {@link com.sun.xml.internal.bind.v2.runtime.property.PropertyFactory} benefits from having index numbers assigned to
* {@link #ELEMENT}, {@link #REFERENCE}, and {@link #MAP} in this order.
*/
public final int propertyIndex;
--- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/core/Ref.java 2013-04-04 15:27:22.644613008 +0200
+++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/core/Ref.java 2013-04-04 15:27:22.580613007 +0200
@@ -29,7 +29,7 @@
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import com.sun.xml.internal.bind.v2.model.annotation.AnnotationReader;
-import com.sun.xml.internal.bind.v2.model.impl.ModelBuilder;
+import com.sun.xml.internal.bind.v2.model.impl.ModelBuilderI;
import com.sun.xml.internal.bind.v2.model.nav.Navigator;
/**
@@ -68,8 +68,8 @@
this.valueList = valueList;
}
- public Ref(ModelBuilder builder, T type, XmlJavaTypeAdapter xjta, XmlList xl ) {
- this(builder.reader,builder.nav,type,xjta,xl);
+ public Ref(ModelBuilderI builder, T type, XmlJavaTypeAdapter xjta, XmlList xl ) {
+ this(builder.getReader(),builder.getNavigator(),type,xjta,xl);
}
public Ref(AnnotationReader reader,
--- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/core/RegistryInfo.java 2013-04-04 15:27:22.852613011 +0200
+++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/core/RegistryInfo.java 2013-04-04 15:27:22.804613010 +0200
@@ -29,13 +29,11 @@
import javax.xml.bind.annotation.XmlRegistry;
-import com.sun.xml.internal.bind.v2.model.impl.ModelBuilder;
-
/**
* Represents the information in a class with {@link XmlRegistry} annotaion.
*
*
- * This interface is only meant to be used as a return type from {@link ModelBuilder}.
+ * This interface is only meant to be used as a return type from {@link com.sun.xml.internal.bind.v2.model.impl.ModelBuilder}.
*
* @author Kohsuke Kawaguchi
*/
--- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/impl/ArrayInfoImpl.java 2013-04-04 15:27:23.064613014 +0200
+++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/impl/ArrayInfoImpl.java 2013-04-04 15:27:23.008613014 +0200
@@ -27,11 +27,10 @@
import javax.xml.namespace.QName;
-import com.sun.xml.internal.bind.v2.TODO;
-import com.sun.xml.internal.bind.v2.WellKnownNamespace;
import com.sun.xml.internal.bind.v2.model.annotation.Locatable;
import com.sun.xml.internal.bind.v2.model.core.ArrayInfo;
import com.sun.xml.internal.bind.v2.model.core.NonElement;
+import com.sun.xml.internal.bind.v2.model.util.ArrayInfoUtil;
import com.sun.xml.internal.bind.v2.runtime.Location;
import com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationException;
@@ -68,20 +67,7 @@
nav().getTypeName(componentType)),this));
n = new QName("#dummy"); // for error recovery
}
- this.typeName = calcArrayTypeName(n);
- }
-
- /**
- * Computes the type name of the array from that of the item type.
- */
- public static QName calcArrayTypeName(QName n) {
- String uri;
- if(n.getNamespaceURI().equals(WellKnownNamespace.XML_SCHEMA)) {
- TODO.checkSpec("this URI");
- uri = "http://jaxb.dev.java.net/array";
- } else
- uri = n.getNamespaceURI();
- return new QName(uri,n.getLocalPart()+"Array");
+ this.typeName = ArrayInfoUtil.calcArrayTypeName(n);
}
public NonElement getItemType() {
--- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/impl/ModelBuilder.java 2013-04-04 15:27:23.268613018 +0200
+++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/impl/ModelBuilder.java 2013-04-04 15:27:23.220613017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -25,9 +25,14 @@
package com.sun.xml.internal.bind.v2.model.impl;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.Map;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import javax.xml.bind.JAXBElement;
import javax.xml.bind.annotation.XmlAttachmentRef;
import javax.xml.bind.annotation.XmlRegistry;
import javax.xml.bind.annotation.XmlSchema;
@@ -50,10 +55,10 @@
import com.sun.xml.internal.bind.v2.model.core.TypeInfo;
import com.sun.xml.internal.bind.v2.model.core.TypeInfoSet;
import com.sun.xml.internal.bind.v2.model.nav.Navigator;
+import com.sun.xml.internal.bind.v2.model.runtime.RuntimePropertyInfo;
import com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationException;
import com.sun.xml.internal.bind.WhiteSpaceProcessor;
-
/**
* Builds a {@link TypeInfoSet} (a set of JAXB properties)
* by using {@link ElementInfoImpl} and {@link ClassInfoImpl}.
@@ -66,7 +71,8 @@
*
* @author Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
*/
-public class ModelBuilder {
+public class ModelBuilder implements ModelBuilderI {
+ private static final Logger logger;
/**
* {@link TypeInfo}s that are built will go into this set.
@@ -183,6 +189,13 @@
}
}
+ /**
+ * Logger init
+ */
+ static {
+ logger = Logger.getLogger(ModelBuilder.class.getName());
+ }
+
protected TypeInfoSetImpl createTypeInfoSet() {
return new TypeInfoSetImpl(nav,reader,BuiltinLeafInfoImpl.createLeaves(nav));
}
@@ -233,12 +246,14 @@
for( PropertyInfo p : ci.getProperties() ) {
if(p.kind()== PropertyKind.REFERENCE) {
// make sure that we have a registry for this package
- String pkg = nav.getPackageName(ci.getClazz());
- if(!registries.containsKey(pkg)) {
- // insert the package's object factory
- C c = nav.findClass(pkg + ".ObjectFactory",ci.getClazz());
- if(c!=null)
- addRegistry(c,(Locatable)p);
+ addToRegistry(clazz, (Locatable) p);
+ Class[] prmzdClasses = getParametrizedTypes(p);
+ if (prmzdClasses != null) {
+ for (Class prmzdClass : prmzdClasses) {
+ if (prmzdClass != clazz) {
+ addToRegistry((C) prmzdClass, (Locatable) p);
+ }
+ }
}
}
@@ -266,6 +281,46 @@
}
/**
+ * Adding package's ObjectFactory methods to registry
+ * @param clazz which package will be used
+ * @param p location
+ */
+ private void addToRegistry(C clazz, Locatable p) {
+ String pkg = nav.getPackageName(clazz);
+ if (!registries.containsKey(pkg)) {
+ // insert the package's object factory
+ C c = nav.findClass(pkg + ".ObjectFactory", clazz);
+ if (c != null)
+ addRegistry(c, p);
+ }
+ }
+
+ /**
+ * Getting parametrized classes of {@code JAXBElement<...>} property
+ * @param p property which parametrized types we will try to get
+ * @return null - if it's not JAXBElement property, or it's not parametrized, and array of parametrized classes in other case
+ */
+ private Class[] getParametrizedTypes(PropertyInfo p) {
+ try {
+ Type pType = ((RuntimePropertyInfo) p).getIndividualType();
+ if (pType instanceof ParameterizedType) {
+ ParameterizedType prmzdType = (ParameterizedType) pType;
+ if (prmzdType.getRawType() == JAXBElement.class) {
+ Type[] actualTypes = prmzdType.getActualTypeArguments();
+ Class[] result = new Class[actualTypes.length];
+ for (int i = 0; i < actualTypes.length; i++) {
+ result[i] = (Class) actualTypes[i];
+ }
+ return result;
+ }
+ }
+ } catch (Exception e) {
+ logger.log(Level.FINE, "Error in ModelBuilder.getParametrizedTypes. " + e.getMessage());
+ }
+ return null;
+ }
+
+ /**
* Checks the uniqueness of the type name.
*/
private void addTypeName(NonElement r) {
@@ -417,4 +472,14 @@
public boolean isReplaced(C sc) {
return subclassReplacements.containsKey(sc);
}
+
+ @Override
+ public Navigator getNavigator() {
+ return nav;
+ }
+
+ @Override
+ public AnnotationReader getReader() {
+ return reader;
+ }
}
--- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/impl/ReferencePropertyInfoImpl.java 2013-04-04 15:27:23.500613021 +0200
+++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/impl/ReferencePropertyInfoImpl.java 2013-04-04 15:27:23.440613020 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -64,7 +64,7 @@
* @see #getElements()
*/
private Set> types;
- private Set> subTypes = new LinkedHashSet>();
+ private Set> subTypes = new LinkedHashSet>();
private final boolean isMixed;
@@ -186,10 +186,7 @@
}
}
- Iterator> i = subTypes.iterator();
- while (i.hasNext()) {
-
- ReferencePropertyInfoImpl info = (ReferencePropertyInfoImpl) i.next();
+ for (ReferencePropertyInfoImpl info : subTypes) {
PropertySeed sd = info.seed;
refs = sd.readAnnotation(XmlElementRefs.class);
ref = sd.readAnnotation(XmlElementRef.class);
@@ -377,7 +374,8 @@
}
public final void addType(PropertyInfoImpl info) {
- subTypes.add(info);
+ //noinspection unchecked
+ subTypes.add((ReferencePropertyInfoImpl)info);
}
public final boolean isMixed() {
--- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeBuiltinLeafInfoImpl.java 2013-04-04 15:27:23.740613025 +0200
+++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeBuiltinLeafInfoImpl.java 2013-04-04 15:27:23.680613024 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, 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
@@ -25,7 +25,10 @@
package com.sun.xml.internal.bind.v2.model.impl;
-import java.awt.*;
+import java.awt.Component;
+import java.awt.Graphics;
+import java.awt.Image;
+import java.awt.MediaTracker;
import java.awt.image.BufferedImage;
import java.io.ByteArrayInputStream;
import java.io.File;
--- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeTypeInfoSetImpl.java 2013-04-04 15:27:24.004613029 +0200
+++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/impl/RuntimeTypeInfoSetImpl.java 2013-04-04 15:27:23.952613028 +0200
@@ -34,7 +34,6 @@
import com.sun.xml.internal.bind.v2.model.annotation.AnnotationReader;
import com.sun.xml.internal.bind.v2.model.core.TypeInfoSet;
-import com.sun.xml.internal.bind.v2.model.core.NonElement;
import com.sun.xml.internal.bind.v2.model.nav.Navigator;
import com.sun.xml.internal.bind.v2.model.nav.ReflectionNavigator;
import com.sun.xml.internal.bind.v2.model.runtime.RuntimeNonElement;
--- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/nav/ParameterizedTypeImpl.java 2013-04-04 15:27:24.212613032 +0200
+++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/nav/ParameterizedTypeImpl.java 2013-04-04 15:27:24.160613031 +0200
@@ -59,10 +59,11 @@
if (formals.length != actualTypeArguments.length) {
throw new MalformedParameterizedTypeException();
}
+/*
for (int i = 0; i < actualTypeArguments.length; i++) {
// check actuals against formals' bounds
}
-
+*/
}
public Type[] getActualTypeArguments() {
@@ -96,6 +97,7 @@
Type thatOwner = that.getOwnerType();
Type thatRawType = that.getRawType();
+/*
if (false) { // Debugging
boolean ownerEquality = (ownerType == null ?
thatOwner == null :
@@ -114,6 +116,7 @@
ownerEquality, rawEquality, typeArgEquality);
return ownerEquality && rawEquality && typeArgEquality;
}
+*/
return
--- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/nav/ReflectionNavigator.java 2013-04-04 15:27:24.448613036 +0200
+++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/nav/ReflectionNavigator.java 2013-04-04 15:27:24.396613035 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, 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
@@ -342,26 +342,26 @@
*/
private static final TypeVisitor eraser = new TypeVisitor() {
- public Class onClass(Class c, Void _) {
+ public Class onClass(Class c, Void v) {
return c;
}
- public Class onParameterizdType(ParameterizedType p, Void _) {
+ public Class onParameterizdType(ParameterizedType p, Void v) {
// TODO: why getRawType returns Type? not Class?
return visit(p.getRawType(), null);
}
- public Class onGenericArray(GenericArrayType g, Void _) {
+ public Class onGenericArray(GenericArrayType g, Void v) {
return Array.newInstance(
visit(g.getGenericComponentType(), null),
0).getClass();
}
- public Class onVariable(TypeVariable v, Void _) {
- return visit(v.getBounds()[0], null);
+ public Class onVariable(TypeVariable tv, Void v) {
+ return visit(tv.getBounds()[0], null);
}
- public Class onWildcard(WildcardType w, Void _) {
+ public Class onWildcard(WildcardType w, Void v) {
return visit(w.getUpperBounds()[0], null);
}
};
--- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/nav/SecureLoader.java 2013-04-04 15:27:24.692613039 +0200
+++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/nav/SecureLoader.java 2013-04-04 15:27:24.640613039 +0200
@@ -37,9 +37,9 @@
if (System.getSecurityManager() == null) {
return Thread.currentThread().getContextClassLoader();
} else {
- return (ClassLoader) java.security.AccessController.doPrivileged(
- new java.security.PrivilegedAction() {
- public java.lang.Object run() {
+ return java.security.AccessController.doPrivileged(
+ new java.security.PrivilegedAction() {
+ public ClassLoader run() {
return Thread.currentThread().getContextClassLoader();
}
});
@@ -50,9 +50,9 @@
if (System.getSecurityManager() == null) {
return c.getClassLoader();
} else {
- return (ClassLoader) java.security.AccessController.doPrivileged(
- new java.security.PrivilegedAction() {
- public java.lang.Object run() {
+ return java.security.AccessController.doPrivileged(
+ new java.security.PrivilegedAction() {
+ public ClassLoader run() {
return c.getClassLoader();
}
});
@@ -63,9 +63,9 @@
if (System.getSecurityManager() == null) {
return ClassLoader.getSystemClassLoader();
} else {
- return (ClassLoader) java.security.AccessController.doPrivileged(
- new java.security.PrivilegedAction() {
- public java.lang.Object run() {
+ return java.security.AccessController.doPrivileged(
+ new java.security.PrivilegedAction() {
+ public ClassLoader run() {
return ClassLoader.getSystemClassLoader();
}
});
--- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeNonElement.java 2013-04-04 15:27:24.932613043 +0200
+++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeNonElement.java 2013-04-04 15:27:24.880613042 +0200
@@ -29,7 +29,6 @@
import com.sun.xml.internal.bind.v2.model.core.NonElement;
import com.sun.xml.internal.bind.v2.runtime.Transducer;
-import com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl;
/**
* @author Kohsuke Kawaguchi
--- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeTypeInfoSet.java 2013-04-04 15:27:25.172613047 +0200
+++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/model/runtime/RuntimeTypeInfoSet.java 2013-04-04 15:27:25.116613046 +0200
@@ -33,7 +33,6 @@
import javax.xml.namespace.QName;
import com.sun.xml.internal.bind.v2.model.core.TypeInfoSet;
-import com.sun.xml.internal.bind.v2.model.core.NonElement;
import com.sun.xml.internal.bind.v2.model.nav.ReflectionNavigator;
/**
--- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/ClassBeanInfoImpl.java 2013-04-04 15:27:25.436613051 +0200
+++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/ClassBeanInfoImpl.java 2013-04-04 15:27:25.380613050 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -48,6 +48,7 @@
import com.sun.xml.internal.bind.v2.ClassFactory;
import com.sun.xml.internal.bind.v2.WellKnownNamespace;
import com.sun.xml.internal.bind.v2.model.core.ID;
+import com.sun.xml.internal.bind.v2.model.nav.Navigator;
import com.sun.xml.internal.bind.v2.model.runtime.RuntimeClassInfo;
import com.sun.xml.internal.bind.v2.model.runtime.RuntimePropertyInfo;
import com.sun.xml.internal.bind.v2.runtime.property.AttributeProperty;
@@ -190,10 +191,11 @@
Property[] props = bi.properties;
if (props == null) break;
for (Property superProperty : props) {
- if (superProperty == null) break;
- String spName = superProperty.getFieldName();
- if ((spName != null) && (spName.equals(p.getFieldName()))) {
- superProperty.setHiddenByOverride(true);
+ if (superProperty != null) {
+ String spName = superProperty.getFieldName();
+ if ((spName != null) && (spName.equals(p.getFieldName()))) {
+ superProperty.setHiddenByOverride(true);
+ }
}
}
}
@@ -339,8 +341,15 @@
if (retainPropertyInfo) {
target.currentProperty.set(p);
}
- if (!(p.isHiddenByOverride() && !bean.getClass().equals(jaxbType))) {
+ boolean isThereAnOverridingProperty = p.isHiddenByOverride();
+ if (!isThereAnOverridingProperty || bean.getClass().equals(jaxbType)) {
p.serializeBody(bean, target, null);
+ } else if (isThereAnOverridingProperty) {
+ // need to double check the override - it should be safe to do after the model has been created because it's targeted to override properties only
+ Class beanClass = bean.getClass();
+ if (Navigator.REFLECTION.getDeclaredField(beanClass, p.getFieldName()) == null) {
+ p.serializeBody(bean, target, null);
+ }
}
}
} catch (AccessorException e) {
--- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/JAXBContextImpl.java 2013-04-04 15:27:25.664613055 +0200
+++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/JAXBContextImpl.java 2013-04-04 15:27:25.612613054 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -71,6 +71,7 @@
import com.sun.istack.internal.NotNull;
import com.sun.istack.internal.Pool;
+import com.sun.xml.internal.bind.v2.WellKnownNamespace;
import com.sun.xml.internal.bind.api.AccessorException;
import com.sun.xml.internal.bind.api.Bridge;
import com.sun.xml.internal.bind.api.BridgeContext;
@@ -81,7 +82,6 @@
import com.sun.xml.internal.bind.api.TypeReference;
import com.sun.xml.internal.bind.unmarshaller.DOMScanner;
import com.sun.xml.internal.bind.util.Which;
-import com.sun.xml.internal.bind.v2.WellKnownNamespace;
import com.sun.xml.internal.bind.v2.model.annotation.RuntimeAnnotationReader;
import com.sun.xml.internal.bind.v2.model.annotation.RuntimeInlineAnnotationReader;
import com.sun.xml.internal.bind.v2.model.core.Adapter;
@@ -110,6 +110,7 @@
import com.sun.xml.internal.bind.v2.schemagen.XmlSchemaGenerator;
import com.sun.xml.internal.bind.v2.util.EditDistance;
import com.sun.xml.internal.bind.v2.util.QNameMap;
+import com.sun.xml.internal.bind.v2.util.XmlFactory;
import com.sun.xml.internal.txw2.output.ResultFactory;
import org.w3c.dom.Document;
@@ -220,7 +221,7 @@
public final boolean retainPropertyInfo;
/**
- * Supress reflection accessor warnings.
+ * Suppress reflection accessor warnings.
*/
public final boolean supressAccessorWarnings;
@@ -229,6 +230,11 @@
*/
public final boolean improvedXsiTypeHandling;
+ /**
+ * Disable security processing.
+ */
+ public final boolean disableSecurityProcessing;
+
private WeakReference typeInfoSetCache;
private @NotNull RuntimeAnnotationReader annotationReader;
@@ -237,7 +243,7 @@
private final @NotNull Map subclassReplacements;
/**
- * If true, we aim for faster {@link JAXBContext} instanciation performance,
+ * If true, we aim for faster {@link JAXBContext} instantiation performance,
* instead of going after efficient sustained unmarshalling/marshalling performance.
*
* @since 2.0.4
@@ -267,6 +273,7 @@
this.allNillable = builder.allNillable;
this.supressAccessorWarnings = builder.supressAccessorWarnings;
this.improvedXsiTypeHandling = builder.improvedXsiTypeHandling;
+ this.disableSecurityProcessing = builder.disableSecurityProcessing;
Collection typeRefs = builder.typeRefs;
@@ -278,8 +285,6 @@
}
this.fastBoot = fastB;
- System.arraycopy(classes,0,this.classes,0,classes.length);
-
RuntimeTypeInfoSet typeSet = getTypeInfoSet();
// at least prepare the empty table so that we don't have to check for null later
@@ -701,12 +706,12 @@
/**
* Creates a new identity transformer.
*/
- static Transformer createTransformer() {
+ static Transformer createTransformer(boolean disableSecureProcessing) {
try {
if (tf==null) {
synchronized(JAXBContextImpl.class) {
if (tf==null) {
- tf = (SAXTransformerFactory)TransformerFactory.newInstance();
+ tf = (SAXTransformerFactory)XmlFactory.createTransformerFactory(disableSecureProcessing);
}
}
}
@@ -719,12 +724,12 @@
/**
* Creates a new identity transformer.
*/
- public static TransformerHandler createTransformerHandler() {
+ public static TransformerHandler createTransformerHandler(boolean disableSecureProcessing) {
try {
if (tf==null) {
synchronized(JAXBContextImpl.class) {
if (tf==null) {
- tf = (SAXTransformerFactory)TransformerFactory.newInstance();
+ tf = (SAXTransformerFactory)XmlFactory.createTransformerFactory(disableSecureProcessing);
}
}
}
@@ -737,12 +742,11 @@
/**
* Creates a new DOM document.
*/
- static Document createDom() {
+ static Document createDom(boolean disableSecurityProcessing) {
synchronized(JAXBContextImpl.class) {
if(db==null) {
try {
- DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
- dbf.setNamespaceAware(true);
+ DocumentBuilderFactory dbf = XmlFactory.createDocumentBuilderFactory(disableSecurityProcessing);
db = dbf.newDocumentBuilder();
} catch (ParserConfigurationException e) {
// impossible
@@ -1055,6 +1059,7 @@
private boolean xmlAccessorFactorySupport = false;
private boolean allNillable;
private boolean improvedXsiTypeHandling = true;
+ private boolean disableSecurityProcessing = true;
public JAXBContextBuilder() {};
@@ -1069,6 +1074,7 @@
this.typeRefs = baseImpl.bridges.keySet();
this.xmlAccessorFactorySupport = baseImpl.xmlAccessorFactorySupport;
this.allNillable = baseImpl.allNillable;
+ this.disableSecurityProcessing = baseImpl.disableSecurityProcessing;
}
public JAXBContextBuilder setRetainPropertyInfo(boolean val) {
@@ -1126,6 +1132,11 @@
return this;
}
+ public JAXBContextBuilder setDisableSecurityProcessing(boolean val) {
+ this.disableSecurityProcessing = val;
+ return this;
+ }
+
public JAXBContextImpl build() throws JAXBException {
// fool-proof
--- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/LeafBeanInfoImpl.java 2013-04-04 15:27:25.868613058 +0200
+++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/LeafBeanInfoImpl.java 2013-04-04 15:27:25.816613057 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, 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
@@ -79,6 +79,7 @@
tagName = null;
}
+ @Override
public QName getTypeName(BeanT instance) {
QName tn = xducer.getTypeName(instance);
if(tn!=null) return tn;
@@ -86,11 +87,11 @@
return super.getTypeName(instance);
}
- public final String getElementNamespaceURI(BeanT _) {
+ public final String getElementNamespaceURI(BeanT t) {
return tagName.nsUri;
}
- public final String getElementLocalName(BeanT _) {
+ public final String getElementLocalName(BeanT t) {
return tagName.localName;
}
--- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/MarshallerImpl.java 2013-04-04 15:27:26.104613061 +0200
+++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/MarshallerImpl.java 2013-04-04 15:27:26.048613061 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -183,7 +183,7 @@
final Node node = ((DOMResult) result).getNode();
if (node == null) {
- Document doc = JAXBContextImpl.createDom();
+ Document doc = JAXBContextImpl.createDom(getContext().disableSecurityProcessing);
((DOMResult) result).setNode(doc);
return new SAXOutput(new SAX2DOMEx(doc));
} else {
--- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/RuntimeUtil.java 2013-04-04 15:27:26.356613065 +0200
+++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/RuntimeUtil.java 2013-04-04 15:27:26.300613065 +0200
@@ -29,16 +29,7 @@
import java.util.HashMap;
import java.util.Map;
-import javax.xml.bind.ValidationEvent;
import javax.xml.bind.annotation.adapters.XmlAdapter;
-import javax.xml.bind.helpers.PrintConversionEventImpl;
-import javax.xml.bind.helpers.ValidationEventImpl;
-import javax.xml.bind.helpers.ValidationEventLocatorImpl;
-
-import com.sun.xml.internal.bind.util.ValidationEventLocatorExImpl;
-
-import org.xml.sax.SAXException;
-
/**
* @author Kohsuke Kawaguchi
@@ -95,6 +86,7 @@
/**
* Reports a print conversion error while marshalling.
*/
+/*
public static void handlePrintConversionException(
Object caller, Exception e, XMLSerializer serializer ) throws SAXException {
@@ -109,10 +101,12 @@
new ValidationEventLocatorImpl(caller), e );
serializer.reportError(ve);
}
+*/
/**
* Reports that the type of an object in a property is unexpected.
*/
+/*
public static void handleTypeMismatchError( XMLSerializer serializer,
Object parentObject, String fieldName, Object childObject ) throws SAXException {
@@ -126,6 +120,7 @@
serializer.reportError(ve);
}
+*/
private static String getTypeName( Object o ) {
return o.getClass().getName();
--- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/XMLSerializer.java 2013-04-04 15:27:26.580613069 +0200
+++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/XMLSerializer.java 2013-04-04 15:27:26.532613068 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -794,8 +794,8 @@
}
public Transformer getIdentityTransformer() {
- if(identityTransformer==null)
- identityTransformer = JAXBContextImpl.createTransformer();
+ if (identityTransformer==null)
+ identityTransformer = JAXBContextImpl.createTransformer(grammar.disableSecurityProcessing);
return identityTransformer;
}
--- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/property/ListElementProperty.java 2013-04-04 15:27:26.852613073 +0200
+++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/property/ListElementProperty.java 2013-04-04 15:27:26.796613072 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, 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
@@ -43,7 +43,9 @@
import com.sun.xml.internal.bind.v2.runtime.reflect.TransducedAccessor;
import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor;
import com.sun.xml.internal.bind.v2.runtime.unmarshaller.ChildLoader;
+import com.sun.xml.internal.bind.v2.runtime.unmarshaller.DefaultValueLoaderDecorator;
import com.sun.xml.internal.bind.v2.runtime.unmarshaller.LeafPropertyLoader;
+import com.sun.xml.internal.bind.v2.runtime.unmarshaller.Loader;
import org.xml.sax.SAXException;
@@ -56,6 +58,8 @@
final class ListElementProperty extends ArrayProperty {
private final Name tagName;
+ private final String defaultValue;
+
/**
* Converts all the values to a list and back.
*/
@@ -69,6 +73,7 @@
RuntimeTypeRef ref = prop.getTypes().get(0);
tagName = grammar.nameBuilder.createElementName(ref.getTagName());
+ defaultValue = ref.getDefaultValue();
// transducer for each item
Transducer xducer = ref.getTransducer();
@@ -81,7 +86,9 @@
}
public void buildChildElementUnmarshallers(UnmarshallerChain chain, QNameMap handlers) {
- handlers.put(tagName, new ChildLoader(new LeafPropertyLoader(xacc),null));
+ Loader l = new LeafPropertyLoader(xacc);
+ l = new DefaultValueLoaderDecorator(l, defaultValue);
+ handlers.put(tagName, new ChildLoader(l,null));
}
@Override
--- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/property/SingleElementLeafProperty.java 2013-04-04 15:27:27.140613078 +0200
+++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/property/SingleElementLeafProperty.java 2013-04-04 15:27:27.084613076 +0200
@@ -26,13 +26,17 @@
package com.sun.xml.internal.bind.v2.runtime.property;
import java.io.IOException;
+import java.lang.reflect.Modifier;
+import javax.xml.bind.JAXBElement;
import javax.xml.stream.XMLStreamException;
import com.sun.xml.internal.bind.api.AccessorException;
+import com.sun.xml.internal.bind.v2.model.core.ID;
import com.sun.xml.internal.bind.v2.model.core.PropertyKind;
import com.sun.xml.internal.bind.v2.model.runtime.RuntimeElementPropertyInfo;
import com.sun.xml.internal.bind.v2.model.runtime.RuntimeTypeRef;
+import com.sun.xml.internal.bind.v2.runtime.ClassBeanInfoImpl;
import com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl;
import com.sun.xml.internal.bind.v2.runtime.Name;
import com.sun.xml.internal.bind.v2.runtime.XMLSerializer;
@@ -61,6 +65,7 @@
private final String defaultValue;
private final TransducedAccessor xacc;
private final boolean improvedXsiTypeHandling;
+ private final boolean idRef;
public SingleElementLeafProperty(JAXBContextImpl context, RuntimeElementPropertyInfo prop) {
super(context, prop);
@@ -75,6 +80,7 @@
assert xacc != null;
improvedXsiTypeHandling = context.improvedXsiTypeHandling;
+ idRef = ref.getSource().id() == ID.IDREF;
}
public void reset(BeanT o) throws AccessorException {
@@ -100,16 +106,11 @@
Class valueType = acc.getValueType();
// check for different type than expected. If found, add xsi:type declaration
- if (improvedXsiTypeHandling && !acc.isAdapted() &&
- (obj!=null) && ( !obj.getClass().equals(valueType))&&
- (!valueType.isPrimitive() && acc.isValueTypeAbstractable() )) {
-
+ if (xsiTypeNeeded(o, w, obj, valueType)) {
w.startElement(tagName, outerPeer);
- w.childAsXsiType(obj, fieldName, w.grammar.getBeanInfo(valueType), nillable);
+ w.childAsXsiType(obj, fieldName, w.grammar.getBeanInfo(valueType), false);
w.endElement();
-
} else { // current type is expected
-
if (hasValue) {
xacc.writeLeafElement(w, tagName, o, fieldName);
} else if (nillable) {
@@ -120,6 +121,47 @@
}
}
+ /**
+ * Checks if xsi type needed to be specified
+ */
+ private boolean xsiTypeNeeded(BeanT bean, XMLSerializer w, Object value, Class valueTypeClass) {
+ if (!improvedXsiTypeHandling) // improved xsi type set
+ return false;
+ if (acc.isAdapted()) // accessor is not adapted
+ return false;
+ if (value == null) // value is not null
+ return false;
+ if (value.getClass().equals(valueTypeClass)) // value represented by different class
+ return false;
+ if (idRef) // IDREF
+ return false;
+ if (valueTypeClass.isPrimitive()) // is not primitive
+ return false;
+ return acc.isValueTypeAbstractable() || isNillableAbstract(bean, w.grammar, value, valueTypeClass);
+ }
+
+ /**
+ * Checks if element is nillable and represented by abstract class.
+ */
+ private boolean isNillableAbstract(BeanT bean, JAXBContextImpl context, Object value, Class valueTypeClass) {
+ if (!nillable) // check if element is nillable
+ return false;
+ if (valueTypeClass != Object.class) // required type wasn't recognized
+ return false;
+ if (bean.getClass() != JAXBElement.class) // is JAXBElement
+ return false;
+ JAXBElement jaxbElement = (JAXBElement) bean;
+ Class valueClass = value.getClass();
+ Class declaredTypeClass = jaxbElement.getDeclaredType();
+ if (declaredTypeClass.equals(valueClass)) // JAXBElement is different from unadapted class)
+ return false;
+ if (!declaredTypeClass.isAssignableFrom(valueClass)) // and is subclass from it
+ return false;
+ if (!Modifier.isAbstract(declaredTypeClass.getModifiers())) // declared class is abstract
+ return false;
+ return acc.isAbstractable(declaredTypeClass); // and is not builtin type
+ }
+
public void buildChildElementUnmarshallers(UnmarshallerChain chain, QNameMap handlers) {
Loader l = new LeafPropertyLoader(xacc);
if (defaultValue != null)
@@ -128,7 +170,7 @@
l = new XsiNilLoader.Single(l, acc);
// LeafPropertyXsiLoader doesn't work well with nillable elements
- if (improvedXsiTypeHandling && !nillable)
+ if (improvedXsiTypeHandling)
l = new LeafPropertyXsiLoader(l, xacc, acc);
handlers.put(tagName, new ChildLoader(l, null));
--- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/property/SingleMapNodeProperty.java 2013-04-04 15:27:27.444613083 +0200
+++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/property/SingleMapNodeProperty.java 2013-04-04 15:27:27.384613081 +0200
@@ -142,6 +142,7 @@
private ThreadLocal target = new ThreadLocal();
private ThreadLocal map = new ThreadLocal();
+ private int depthCounter = 0; // needed to clean ThreadLocals
@Override
public void startElement(UnmarshallingContext.State state, TagName ea) throws SAXException {
@@ -149,6 +150,7 @@
try {
target.set((BeanT)state.prev.target);
map.set(acc.get(target.get()));
+ depthCounter++;
if(map.get() == null) {
map.set(ClassFactory.create(mapImplClass));
}
@@ -166,7 +168,10 @@
super.leaveElement(state, ea);
try {
acc.set(target.get(), map.get());
- target.remove();
+ if (--depthCounter == 0) {
+ target.remove();
+ map.remove();
+ }
} catch (AccessorException ex) {
handleGenericException(ex,true);
}
--- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/reflect/Accessor.java 2013-04-04 15:27:27.720613087 +0200
+++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/reflect/Accessor.java 2013-04-04 15:27:27.664613086 +0200
@@ -34,8 +34,6 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import java.util.List;
-import java.util.Arrays;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -54,8 +52,6 @@
import com.sun.xml.internal.bind.v2.runtime.unmarshaller.Loader;
import com.sun.xml.internal.bind.v2.runtime.unmarshaller.Receiver;
import com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext;
-import com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl;
-import com.sun.istack.internal.Nullable;
import org.xml.sax.SAXException;
@@ -184,6 +180,15 @@
}
/**
+ * Checks if it is not builtin jaxb class
+ * @param clazz to be checked
+ * @return true if it is NOT builtin class
+ */
+ public boolean isAbstractable(Class clazz) {
+ return !nonAbstractableClasses.contains(clazz);
+ }
+
+ /**
* Wraps this {@link Accessor} into another {@link Accessor}
* and performs the type adaption as necessary.
*/
--- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/reflect/Lister.java 2013-04-04 15:27:28.004613091 +0200
+++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/reflect/Lister.java 2013-04-04 15:27:27.948613090 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, 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
@@ -300,7 +300,9 @@
// invoke set when possible (see Issue 488)
try {
- acc.set(bean,collection);
+ if (acc.isAdapted()) {
+ acc.set(bean,collection);
+ }
} catch (AccessorException ae) {
if(acc.isAdapted()) throw ae;
}
--- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/AccessorInjector.java 2013-04-04 15:27:28.264613095 +0200
+++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/AccessorInjector.java 2013-04-04 15:27:28.208613094 +0200
@@ -91,7 +91,7 @@
* Customizes a class file by replacing constant pools.
*
* @param templateClassName
- * The resouce that contains the template class file.
+ * The resource that contains the template class file.
* @param replacements
* A list of pair of strings that specify the substitution
* {@code String[]{search_0, replace_0, search_1, replace_1, ..., search_n, replace_n }
--- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/OptimizedAccessorFactory.java 2013-04-04 15:27:28.476613098 +0200
+++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/OptimizedAccessorFactory.java 2013-04-04 15:27:28.428613097 +0200
@@ -134,7 +134,7 @@
/**
- * Gets the optimizd {@link Accessor} that accesses the given field.
+ * Gets the optimized {@link Accessor} that accesses the given field.
*
* @return null
* if for some reason it fails to create an optimized version.
--- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/DomLoader.java 2013-04-04 15:27:28.680613102 +0200
+++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/DomLoader.java 2013-04-04 15:27:28.628613101 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -25,7 +25,6 @@
package com.sun.xml.internal.bind.v2.runtime.unmarshaller;
-import com.sun.xml.internal.bind.v2.WellKnownNamespace;
import javax.xml.bind.annotation.DomHandler;
import javax.xml.transform.Result;
import javax.xml.transform.sax.TransformerHandler;
@@ -47,8 +46,9 @@
* This instance is created for each unmarshalling episode.
*/
private final class State {
+
/** This handler will receive SAX events. */
- private final TransformerHandler handler = JAXBContextImpl.createTransformerHandler();
+ private TransformerHandler handler = null;
/** {@link #handler} will produce this result. */
private final ResultT result;
@@ -57,6 +57,7 @@
int depth = 1;
public State( UnmarshallingContext context ) throws SAXException {
+ handler = JAXBContextImpl.createTransformerHandler(context.getJAXBContext().disableSecurityProcessing);
result = dom.createUnmarshaller(context);
handler.setResult(result);
--- old/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/UnmarshallerImpl.java 2013-04-04 15:27:28.920613106 +0200
+++ new/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/UnmarshallerImpl.java 2013-04-04 15:27:28.856613105 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -60,8 +60,11 @@
import com.sun.xml.internal.bind.v2.runtime.AssociationMap;
import com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl;
import com.sun.xml.internal.bind.v2.runtime.JaxBeanInfo;
+import com.sun.xml.internal.bind.v2.util.XmlFactory;
import java.io.Closeable;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParserFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -80,7 +83,7 @@
* @author
* Kohsuke KAWAGUCHI
*/
-public final class UnmarshallerImpl extends AbstractUnmarshallerImpl implements ValidationEventHandler, Closeable
+ public final class UnmarshallerImpl extends AbstractUnmarshallerImpl implements ValidationEventHandler, Closeable
{
/** Owning {@link JAXBContext} */
protected final JAXBContextImpl context;
@@ -116,10 +119,43 @@
return getUnmarshallerHandler(true,null);
}
+ private XMLReader reader = null;
+
+ /**
+ * Obtains a configured XMLReader.
+ *
+ * This method is used when the client-specified
+ * {@link SAXSource} object doesn't have XMLReader.
+ *
+ * {@link Unmarshaller} is not re-entrant, so we will
+ * only use one instance of XMLReader.
+ *
+ * Overriden in order to fix potential security issue.
+ */
+ @Override
+ protected XMLReader getXMLReader() throws JAXBException {
+ if (reader == null) {
+ try {
+ SAXParserFactory parserFactory = XmlFactory.createParserFactory(context.disableSecurityProcessing);
+ // there is no point in asking a validation because
+ // there is no guarantee that the document will come with
+ // a proper schemaLocation.
+ parserFactory.setValidating(false);
+ reader = parserFactory.newSAXParser().getXMLReader();
+ } catch (ParserConfigurationException e) {
+ throw new JAXBException(e);
+ } catch (SAXException e) {
+ throw new JAXBException(e);
+ }
+ }
+ return reader;
+ }
+
private SAXConnector getUnmarshallerHandler( boolean intern, JaxBeanInfo expectedType ) {
- XmlVisitor h = createUnmarshallerHandler(null,false,expectedType);
- if(intern)
+ XmlVisitor h = createUnmarshallerHandler(null, false, expectedType);
+ if (intern) {
h = new InterningXmlVisitor(h);
+ }
return new SAXConnector(h,null);
}
@@ -142,11 +178,13 @@
XmlVisitor unmarshaller = coordinator;
// delegate to JAXP 1.3 for validation if the client provided a schema
- if (schema != null)
+ if (schema != null) {
unmarshaller = new ValidatingUnmarshaller(schema,unmarshaller);
+ }
- if(attachmentUnmarshaller!=null && attachmentUnmarshaller.isXOPPackage())
+ if(attachmentUnmarshaller!=null && attachmentUnmarshaller.isXOPPackage()) {
unmarshaller = new MTOMDecorator(this,unmarshaller,attachmentUnmarshaller);
+ }
return unmarshaller;
}
@@ -162,8 +200,9 @@
}
try {
- if( reader.getFeature("http://xml.org/sax/features/string-interning") )
+ if (reader.getFeature("http://xml.org/sax/features/string-interning")) {
return false; // no need for intern
+ }
} catch (SAXException e) {
// unrecognized/unsupported
}
@@ -176,8 +215,9 @@
}
protected JAXBElement unmarshal( XMLReader reader, InputSource source, Class expectedType ) throws JAXBException {
- if(expectedType==null)
+ if(expectedType==null) {
throw new IllegalArgumentException();
+ }
return (JAXBElement)unmarshal0(reader,source,getBeanInfo(expectedType));
}
@@ -222,40 +262,44 @@
@Override
public JAXBElement unmarshal( Source source, Class expectedType ) throws JAXBException {
- if(source instanceof SAXSource) {
- SAXSource ss = (SAXSource)source;
+ if (source instanceof SAXSource) {
+ SAXSource ss = (SAXSource) source;
- XMLReader reader = ss.getXMLReader();
- if( reader == null )
- reader = getXMLReader();
+ XMLReader locReader = ss.getXMLReader();
+ if (locReader == null) {
+ locReader = getXMLReader();
+ }
- return unmarshal( reader, ss.getInputSource(), expectedType );
+ return unmarshal(locReader, ss.getInputSource(), expectedType);
}
- if(source instanceof StreamSource) {
- return unmarshal( getXMLReader(), streamSourceToInputSource((StreamSource)source), expectedType );
+ if (source instanceof StreamSource) {
+ return unmarshal(getXMLReader(), streamSourceToInputSource((StreamSource) source), expectedType);
+ }
+ if (source instanceof DOMSource) {
+ return unmarshal(((DOMSource) source).getNode(), expectedType);
}
- if(source instanceof DOMSource)
- return unmarshal( ((DOMSource)source).getNode(), expectedType );
// we don't handle other types of Source
throw new IllegalArgumentException();
}
public Object unmarshal0( Source source, JaxBeanInfo expectedType ) throws JAXBException {
- if(source instanceof SAXSource) {
- SAXSource ss = (SAXSource)source;
+ if (source instanceof SAXSource) {
+ SAXSource ss = (SAXSource) source;
- XMLReader reader = ss.getXMLReader();
- if( reader == null )
- reader = getXMLReader();
+ XMLReader locReader = ss.getXMLReader();
+ if (locReader == null) {
+ locReader = getXMLReader();
+ }
- return unmarshal0( reader, ss.getInputSource(), expectedType );
+ return unmarshal0(locReader, ss.getInputSource(), expectedType);
}
- if(source instanceof StreamSource) {
- return unmarshal0( getXMLReader(), streamSourceToInputSource((StreamSource)source), expectedType );
+ if (source instanceof StreamSource) {
+ return unmarshal0(getXMLReader(), streamSourceToInputSource((StreamSource) source), expectedType);
+ }
+ if (source instanceof DOMSource) {
+ return unmarshal0(((DOMSource) source).getNode(), expectedType);
}
- if(source instanceof DOMSource)
- return unmarshal0( ((DOMSource)source).getNode(), expectedType );
// we don't handle other types of Source
throw new IllegalArgumentException();
@@ -283,8 +327,9 @@
@Override
public JAXBElement unmarshal(Node node, Class expectedType) throws JAXBException {
- if(expectedType==null)
+ if (expectedType == null) {
throw new IllegalArgumentException();
+ }
return (JAXBElement)unmarshal0(node,getBeanInfo(expectedType));
}
@@ -305,14 +350,13 @@
InterningXmlVisitor handler = new InterningXmlVisitor(createUnmarshallerHandler(null,false,expectedType));
scanner.setContentHandler(new SAXConnector(handler,scanner));
- if(node.getNodeType() == Node.ELEMENT_NODE)
+ if(node.getNodeType() == Node.ELEMENT_NODE) {
scanner.scan((Element)node);
- else
- if(node.getNodeType() == Node.DOCUMENT_NODE)
+ } else if(node.getNodeType() == Node.DOCUMENT_NODE) {
scanner.scan((Document)node);
- else
- // no other type of input is supported
+ } else {
throw new IllegalArgumentException("Unexpected node type: "+node);
+ }
Object retVal = handler.getContext().getResult();
handler.getContext().clearResult();
@@ -329,8 +373,9 @@
@Override
public JAXBElement unmarshal(XMLStreamReader reader, Class expectedType) throws JAXBException {
- if(expectedType==null)
+ if (expectedType==null) {
throw new IllegalArgumentException();
+ }
return (JAXBElement)unmarshal0(reader,getBeanInfo(expectedType));
}
@@ -364,8 +409,9 @@
@Override
public JAXBElement