# HG changeset patch # User aefimov # Date 1428666860 -10800 # Node ID 6d5d546e953ba3819a1350e1c500d39270f9f3a8 # Parent fe5fd9871a13584f768eec0c66a03f2b8b19da3a 8076549: Update JAX-WS RI integration to latest version (2.2.11-b150402.1412) Reviewed-by: joehw diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/ClassFactory.java --- a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/ClassFactory.java Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/ClassFactory.java Fri Apr 10 14:54:20 2015 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2015, 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,8 +30,6 @@ import java.lang.reflect.Method; import java.lang.reflect.Modifier; import java.lang.ref.WeakReference; -import java.security.AccessController; -import java.security.PrivilegedAction; import java.util.Map; import java.util.WeakHashMap; import java.util.logging.Level; @@ -87,25 +85,19 @@ if(consRef!=null) cons = consRef.get(); if(cons==null) { - cons = AccessController.doPrivileged(new PrivilegedAction>() { - @Override - public Constructor run() { - try { - return clazz.getDeclaredConstructor(emptyClass); - } catch (NoSuchMethodException e) { - logger.log(Level.INFO,"No default constructor found on "+clazz,e); - NoSuchMethodError exp; - if(clazz.getDeclaringClass()!=null && !Modifier.isStatic(clazz.getModifiers())) { - exp = new NoSuchMethodError(Messages.NO_DEFAULT_CONSTRUCTOR_IN_INNER_CLASS - .format(clazz.getName())); - } else { - exp = new NoSuchMethodError(e.getMessage()); - } - exp.initCause(e); - throw exp; - } + try { + cons = clazz.getDeclaredConstructor(emptyClass); + } catch (NoSuchMethodException e) { + logger.log(Level.INFO,"No default constructor found on "+clazz,e); + NoSuchMethodError exp; + if(clazz.getDeclaringClass()!=null && !Modifier.isStatic(clazz.getModifiers())) { + exp = new NoSuchMethodError(Messages.NO_DEFAULT_CONSTRUCTOR_IN_INNER_CLASS.format(clazz.getName())); + } else { + exp = new NoSuchMethodError(e.getMessage()); } - }); + exp.initCause(e); + throw exp; + } int classMod = clazz.getModifiers(); diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/org/jvnet/mimepull/MIMEMessage.java --- a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/org/jvnet/mimepull/MIMEMessage.java Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/org/jvnet/mimepull/MIMEMessage.java Fri Apr 10 14:54:20 2015 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2015, 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,12 +25,18 @@ package com.sun.xml.internal.org.jvnet.mimepull; +import java.io.Closeable; import java.io.IOException; import java.io.InputStream; import java.io.UnsupportedEncodingException; import java.net.URLDecoder; import java.nio.ByteBuffer; -import java.util.*; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; import java.util.logging.Level; import java.util.logging.Logger; @@ -40,19 +46,21 @@ * * @author Jitendra Kotamraju */ -public class MIMEMessage { +public class MIMEMessage implements Closeable { + private static final Logger LOGGER = Logger.getLogger(MIMEMessage.class.getName()); MIMEConfig config; private final InputStream in; - private final List partsList; - private final Map partsMap; private final Iterator it; private boolean parsed; // true when entire message is parsed private MIMEPart currentPart; private int currentIndex; + private final List partsList = new ArrayList(); + private final Map partsMap = new HashMap(); + /** * @see MIMEMessage(InputStream, String, MIMEConfig) */ @@ -64,9 +72,9 @@ * Creates a MIME message from the content's stream. The content stream * is closed when EOF is reached. * - * @param in MIME message stream + * @param in MIME message stream * @param boundary the separator for parts(pass it without --) - * @param config various configuration parameters + * @param config various configuration parameters */ public MIMEMessage(InputStream in, String boundary, MIMEConfig config) { this.in = in; @@ -74,8 +82,6 @@ MIMEParser parser = new MIMEParser(in, boundary, config); it = parser.iterator(); - partsList = new ArrayList(); - partsMap = new HashMap(); if (config.isParseEagerly()) { parseAll(); } @@ -108,14 +114,14 @@ LOGGER.log(Level.FINE, "index={0}", index); MIMEPart part = (index < partsList.size()) ? partsList.get(index) : null; if (parsed && part == null) { - throw new MIMEParsingException("There is no "+index+" attachment part "); + throw new MIMEParsingException("There is no " + index + " attachment part "); } if (part == null) { // Parsing will done lazily and will be driven by reading the part part = new MIMEPart(this); partsList.add(index, part); } - LOGGER.log(Level.FINE, "Got attachment at index={0} attachment={1}", new Object[]{index, part}); + LOGGER.log(Level.FINE, "Got attachment at index={0} attachment={1}", new Object[] {index, part}); return part; } @@ -132,14 +138,14 @@ LOGGER.log(Level.FINE, "Content-ID={0}", contentId); MIMEPart part = getDecodedCidPart(contentId); if (parsed && part == null) { - throw new MIMEParsingException("There is no attachment part with Content-ID = "+contentId); + throw new MIMEParsingException("There is no attachment part with Content-ID = " + contentId); } if (part == null) { // Parsing is done lazily and is driven by reading the part part = new MIMEPart(this, contentId); partsMap.put(contentId, part); } - LOGGER.log(Level.FINE, "Got attachment for Content-ID={0} attachment={1}", new Object[]{contentId, part}); + LOGGER.log(Level.FINE, "Got attachment for Content-ID={0} attachment={1}", new Object[] {contentId, part}); return part; } @@ -151,7 +157,7 @@ try { String tempCid = URLDecoder.decode(cid, "utf-8"); part = partsMap.get(tempCid); - } catch(UnsupportedEncodingException ue) { + } catch (UnsupportedEncodingException ue) { // Ignore it } } @@ -159,22 +165,43 @@ return part; } - /** * Parses the whole MIME message eagerly */ public final void parseAll() { - while(makeProgress()) { + while (makeProgress()) { // Nothing to do } } + /** + * Closes all parsed {@link com.sun.xml.internal.org.jvnet.mimepull.MIMEPart parts}. + * This method is safe to call even if parsing of message failed. + *

+ * Does not throw {@link com.sun.xml.internal.org.jvnet.mimepull.MIMEParsingException} if an + * error occurred during closing a MIME part. The exception (if any) is + * still logged. + */ + @Override + public void close() { + close(partsList); + close(partsMap.values()); + } + + private void close(final Collection parts) { + for (final MIMEPart part : parts) { + try { + part.close(); + } catch (final MIMEParsingException closeError) { + LOGGER.log(Level.FINE, "Exception during closing MIME part", closeError); + } + } + } /** * Parses the MIME message in a pull fashion. * - * @return - * false if the parsing is completed. + * @return false if the parsing is completed. */ public synchronized boolean makeProgress() { if (!it.hasNext()) { @@ -183,23 +210,23 @@ MIMEEvent event = it.next(); - switch(event.getEventType()) { - case START_MESSAGE : + switch (event.getEventType()) { + case START_MESSAGE: LOGGER.log(Level.FINE, "MIMEEvent={0}", MIMEEvent.EVENT_TYPE.START_MESSAGE); break; - case START_PART : + case START_PART: LOGGER.log(Level.FINE, "MIMEEvent={0}", MIMEEvent.EVENT_TYPE.START_PART); break; - case HEADERS : + case HEADERS: LOGGER.log(Level.FINE, "MIMEEvent={0}", MIMEEvent.EVENT_TYPE.HEADERS); - MIMEEvent.Headers headers = (MIMEEvent.Headers)event; + MIMEEvent.Headers headers = (MIMEEvent.Headers) event; InternetHeaders ih = headers.getHeaders(); List cids = ih.getHeader("content-id"); - String cid = (cids != null) ? cids.get(0) : currentIndex+""; - if (cid.length() > 2 && cid.charAt(0)=='<') { - cid = cid.substring(1,cid.length()-1); + String cid = (cids != null) ? cids.get(0) : currentIndex + ""; + if (cid.length() > 2 && cid.charAt(0) == '<') { + cid = cid.substring(1, cid.length() - 1); } MIMEPart listPart = (currentIndex < partsList.size()) ? partsList.get(currentIndex) : null; MIMEPart mapPart = getDecodedCidPart(cid); @@ -219,31 +246,31 @@ currentPart.setHeaders(ih); break; - case CONTENT : + case CONTENT: LOGGER.log(Level.FINER, "MIMEEvent={0}", MIMEEvent.EVENT_TYPE.CONTENT); - MIMEEvent.Content content = (MIMEEvent.Content)event; + MIMEEvent.Content content = (MIMEEvent.Content) event; ByteBuffer buf = content.getData(); currentPart.addBody(buf); break; - case END_PART : + case END_PART: LOGGER.log(Level.FINE, "MIMEEvent={0}", MIMEEvent.EVENT_TYPE.END_PART); currentPart.doneParsing(); ++currentIndex; break; - case END_MESSAGE : + case END_MESSAGE: LOGGER.log(Level.FINE, "MIMEEvent={0}", MIMEEvent.EVENT_TYPE.END_MESSAGE); parsed = true; try { in.close(); - } catch(IOException ioe) { + } catch (IOException ioe) { throw new MIMEParsingException(ioe); } break; - default : - throw new MIMEParsingException("Unknown Parser state = "+event.getEventType()); + default: + throw new MIMEParsingException("Unknown Parser state = " + event.getEventType()); } return true; } diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/org/jvnet/mimepull/MIMEPart.java --- a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/org/jvnet/mimepull/MIMEPart.java Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/org/jvnet/mimepull/MIMEPart.java Fri Apr 10 14:54:20 2015 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2015, 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.xml.internal.org.jvnet.mimepull; +import java.io.Closeable; import java.io.File; import java.io.InputStream; import java.nio.ByteBuffer; @@ -42,10 +43,11 @@ * * @author Jitendra Kotamraju, Martin Grebac */ -public class MIMEPart { +public class MIMEPart implements Closeable { private static final Logger LOGGER = Logger.getLogger(MIMEPart.class.getName()); + private volatile boolean closed; private volatile InternetHeaders headers; private volatile String contentId; private String contentType; @@ -55,6 +57,8 @@ final MIMEMessage msg; private final DataHead dataHead; + private final Object lock = new Object(); + MIMEPart(MIMEMessage msg) { this.msg = msg; this.dataHead = new DataHead(this); @@ -91,8 +95,16 @@ * the temp file that is used to serve this part's content). After * calling this, one shouldn't call {@link #read()} or {@link #readOnce()} */ + @Override public void close() { - dataHead.close(); + if (!closed) { + synchronized (lock) { + if (!closed) { + dataHead.close(); + closed = true; + } + } + } } /** @@ -242,6 +254,15 @@ this.contentTransferEncoding = cte; } + /** + * Return {@code true} if this part has already been closed, {@code false} otherwise. + * + * @return {@code true} if this part has already been closed, {@code false} otherwise. + */ + public boolean isClosed() { + return closed; + } + @Override public String toString() { return "Part="+contentId+":"+contentTransferEncoding; diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/org/jvnet/mimepull/MemoryData.java --- a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/org/jvnet/mimepull/MemoryData.java Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/org/jvnet/mimepull/MemoryData.java Fri Apr 10 14:54:20 2015 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2015, 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 @@ -84,9 +84,6 @@ if (LOGGER.isLoggable(Level.FINE)) { LOGGER.log(Level.FINE, "Created temp file = {0}", tempFile); } - // delete the temp file when VM exits as a last resort for file clean up - tempFile.deleteOnExit(); - if (LOGGER.isLoggable(Level.FINE)) {LOGGER.log(Level.FINE, "Created temp file = {0}", tempFile);} dataHead.dataFile = new DataFile(tempFile); } catch (IOException ioe) { throw new MIMEParsingException(ioe); diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/java.xml.bind/share/classes/javax/xml/bind/ContextFinder.java --- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/ContextFinder.java Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/ContextFinder.java Fri Apr 10 14:54:20 2015 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, 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 javax.xml.bind; -import java.util.Iterator; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; @@ -34,15 +33,13 @@ import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.net.URL; +import java.security.AccessController; import java.util.Map; import java.util.Properties; import java.util.StringTokenizer; import java.util.logging.ConsoleHandler; import java.util.logging.Level; import java.util.logging.Logger; -import java.security.AccessController; - -import static javax.xml.bind.JAXBContext.JAXB_CONTEXT_FACTORY; /** @@ -55,7 +52,24 @@ * @see JAXBContext */ class ContextFinder { + + /** + * When JAXB is in J2SE, rt.jar has to have a JAXB implementation. + * However, rt.jar cannot have META-INF/services/javax.xml.bind.JAXBContext + * because if it has, it will take precedence over any file that applications have + * in their jar files. + * + *

+ * When the user bundles his own JAXB implementation, we'd like to use it, and we + * want the platform default to be used only when there's no other JAXB provider. + * + *

+ * For this reason, we have to hard-code the class name into the API. + */ + private static final String PLATFORM_DEFAULT_FACTORY_CLASS = "com.sun.xml.internal.bind.v2.ContextFactory"; + private static final Logger logger; + static { logger = Logger.getLogger("javax.xml.bind"); try { @@ -72,7 +86,7 @@ // to honor what other frameworks // have done on configurations. } - } catch(Throwable t) { + } catch (Throwable t) { // just to be extra safe. in particular System.getProperty may throw // SecurityException. } @@ -84,15 +98,15 @@ */ private static void handleInvocationTargetException(InvocationTargetException x) throws JAXBException { Throwable t = x.getTargetException(); - if( t != null ) { - if( t instanceof JAXBException ) + if (t != null) { + if (t instanceof JAXBException) // one of our exceptions, just re-throw - throw (JAXBException)t; - if( t instanceof RuntimeException ) + throw (JAXBException) t; + if (t instanceof RuntimeException) // avoid wrapping exceptions unnecessarily - throw (RuntimeException)t; - if( t instanceof Error ) - throw (Error)t; + throw (RuntimeException) t; + if (t instanceof Error) + throw (Error) t; } } @@ -121,18 +135,17 @@ /** * Create an instance of a class using the specified ClassLoader */ - static JAXBContext newInstance( String contextPath, - String className, - ClassLoader classLoader, - Map properties ) - throws JAXBException { + static JAXBContext newInstance(String contextPath, + String className, + ClassLoader classLoader, + Map properties) throws JAXBException { + try { - Class spFactory = safeLoadClass(className,classLoader); + Class spFactory = ServiceLoaderUtil.safeLoadClass(className, PLATFORM_DEFAULT_FACTORY_CLASS, classLoader); return newInstance(contextPath, spFactory, classLoader, properties); } catch (ClassNotFoundException x) { - throw new JAXBException( - Messages.format( Messages.PROVIDER_NOT_FOUND, className ), - x); + throw new JAXBException(Messages.format(Messages.PROVIDER_NOT_FOUND, className), x); + } catch (RuntimeException x) { // avoid wrapping RuntimeException to JAXBException, // because it indicates a bug in this code. @@ -142,18 +155,12 @@ // reflection. Root element collisions detected in the call to // createContext() are reported as JAXBExceptions - just re-throw it // some other type of exception - just wrap it - throw new JAXBException( - Messages.format( Messages.COULD_NOT_INSTANTIATE, className, x ), - x); + throw new JAXBException(Messages.format(Messages.COULD_NOT_INSTANTIATE, className, x), x); } } - static JAXBContext newInstance( String contextPath, - Class spFactory, - ClassLoader classLoader, - Map properties ) - throws JAXBException - { + static JAXBContext newInstance(String contextPath, Class spFactory, ClassLoader classLoader, Map properties) throws JAXBException { + try { /* * javax.xml.bind.context.factory points to a class which has a @@ -166,35 +173,35 @@ // first check the method that takes Map as the third parameter. // this is added in 2.0. try { - Method m = spFactory.getMethod("createContext",String.class,ClassLoader.class,Map.class); + Method m = spFactory.getMethod("createContext", String.class, ClassLoader.class, Map.class); // any failure in invoking this method would be considered fatal - context = m.invoke(null,contextPath,classLoader,properties); + context = m.invoke(null, contextPath, classLoader, properties); } catch (NoSuchMethodException e) { // it's not an error for the provider not to have this method. } - if(context==null) { + if (context == null) { // try the old method that doesn't take properties. compatible with 1.0. // it is an error for an implementation not to have both forms of the createContext method. - Method m = spFactory.getMethod("createContext",String.class,ClassLoader.class); + Method m = spFactory.getMethod("createContext", String.class, ClassLoader.class); // any failure in invoking this method would be considered fatal - context = m.invoke(null,contextPath,classLoader); + context = m.invoke(null, contextPath, classLoader); } - if(!(context instanceof JAXBContext)) { + if (!(context instanceof JAXBContext)) { // the cast would fail, so generate an exception with a nice message throw handleClassCastException(context.getClass(), JAXBContext.class); } - return (JAXBContext)context; + return (JAXBContext) context; } catch (InvocationTargetException x) { handleInvocationTargetException(x); // for other exceptions, wrap the internal target exception // with a JAXBException Throwable e = x; - if(x.getTargetException()!=null) + if (x.getTargetException() != null) e = x.getTargetException(); - throw new JAXBException( Messages.format( Messages.COULD_NOT_INSTANTIATE, spFactory, e ), e ); + throw new JAXBException(Messages.format(Messages.COULD_NOT_INSTANTIATE, spFactory, e), e); } catch (RuntimeException x) { // avoid wrapping RuntimeException to JAXBException, // because it indicates a bug in this code. @@ -204,29 +211,23 @@ // reflection. Root element collisions detected in the call to // createContext() are reported as JAXBExceptions - just re-throw it // some other type of exception - just wrap it - throw new JAXBException( - Messages.format( Messages.COULD_NOT_INSTANTIATE, spFactory, x ), - x); + throw new JAXBException(Messages.format(Messages.COULD_NOT_INSTANTIATE, spFactory, x), x); } } - /** * Create an instance of a class using the thread context ClassLoader */ - static JAXBContext newInstance( - Class[] classes, - Map properties, - String className) throws JAXBException { - ClassLoader cl = getContextClassLoader(); + static JAXBContext newInstance(Class[] classes, Map properties, String className) throws JAXBException { + Class spi; try { - spi = safeLoadClass(className,cl); + spi = ServiceLoaderUtil.safeLoadClass(className, PLATFORM_DEFAULT_FACTORY_CLASS, getContextClassLoader()); } catch (ClassNotFoundException e) { throw new JAXBException(e); } - if(logger.isLoggable(Level.FINE)) { + if (logger.isLoggable(Level.FINE)) { // extra check to avoid costly which operation if not logged logger.log(Level.FINE, "loaded {0} from {1}", new Object[]{className, which(spi)}); } @@ -237,19 +238,16 @@ static JAXBContext newInstance(Class[] classes, Map properties, Class spFactory) throws JAXBException { - Method m; try { - m = spFactory.getMethod("createContext", Class[].class, Map.class); - } catch (NoSuchMethodException e) { - throw new JAXBException(e); - } - try { + Method m = spFactory.getMethod("createContext", Class[].class, Map.class); Object context = m.invoke(null, classes, properties); - if(!(context instanceof JAXBContext)) { + if (!(context instanceof JAXBContext)) { // the cast would fail, so generate an exception with a nice message throw handleClassCastException(context.getClass(), JAXBContext.class); } - return (JAXBContext)context; + return (JAXBContext) context; + } catch (NoSuchMethodException e) { + throw new JAXBException(e); } catch (IllegalAccessException e) { throw new JAXBException(e); } catch (InvocationTargetException e) { @@ -263,241 +261,139 @@ } } - static JAXBContext find(String factoryId, String contextPath, ClassLoader classLoader, Map properties ) throws JAXBException { + static JAXBContext find(String factoryId, String contextPath, ClassLoader classLoader, Map properties) throws JAXBException { // TODO: do we want/need another layer of searching in $java.home/lib/jaxb.properties like JAXP? - final String jaxbContextFQCN = JAXBContext.class.getName(); - - // search context path for jaxb.properties first - StringBuilder propFileName; - StringTokenizer packages = new StringTokenizer( contextPath, ":" ); - String factoryClassName; - - if(!packages.hasMoreTokens()) + StringTokenizer packages = new StringTokenizer(contextPath, ":"); + if (!packages.hasMoreTokens()) { // no context is specified throw new JAXBException(Messages.format(Messages.NO_PACKAGE_IN_CONTEXTPATH)); - - - logger.fine("Searching jaxb.properties"); - - while( packages.hasMoreTokens() ) { - String packageName = packages.nextToken(":").replace('.','/'); - // com.acme.foo - > com/acme/foo/jaxb.properties - propFileName = new StringBuilder().append(packageName).append("/jaxb.properties"); + } - Properties props = loadJAXBProperties( classLoader, propFileName.toString() ); - if (props != null) { - if (props.containsKey(factoryId)) { - factoryClassName = props.getProperty(factoryId); - return newInstance( contextPath, factoryClassName, classLoader, properties ); - } else { - throw new JAXBException(Messages.format(Messages.MISSING_PROPERTY, packageName, factoryId)); - } - } + // search for jaxb.properties in the class loader of each class first + logger.fine("Searching jaxb.properties"); + while (packages.hasMoreTokens()) { + // com.acme.foo - > com/acme/foo/jaxb.properties + String className = classNameFromPackageProperties(factoryId, classLoader, packages.nextToken(":").replace('.', '/')); + if (className != null) return newInstance(contextPath, className, classLoader, properties); } - logger.fine("Searching the system property"); + String factoryName = classNameFromSystemProperties(); + if (factoryName != null) return newInstance(contextPath, factoryName, classLoader, properties); - // search for a system property second (javax.xml.bind.JAXBContext) - factoryClassName = AccessController.doPrivileged(new GetPropertyAction(JAXBContext.JAXB_CONTEXT_FACTORY)); - if( factoryClassName != null ) { - return newInstance( contextPath, factoryClassName, classLoader, properties ); - } else { // leave this here to assure compatibility - factoryClassName = AccessController.doPrivileged(new GetPropertyAction(jaxbContextFQCN)); - if( factoryClassName != null ) { - return newInstance( contextPath, factoryClassName, classLoader, properties ); - } - } - - // OSGi search - Class jaxbContext = lookupJaxbContextUsingOsgiServiceLoader(); - if (jaxbContext != null) { - logger.fine("OSGi environment detected"); - return newInstance(contextPath, jaxbContext, classLoader, properties); + Class ctxFactory = (Class) ServiceLoaderUtil.lookupUsingOSGiServiceLoader("javax.xml.bind.JAXBContext", logger); + if (ctxFactory != null) { + return newInstance(contextPath, ctxFactory, classLoader, properties); } - logger.fine("Searching META-INF/services"); - // search META-INF services next - BufferedReader r = null; - try { - final StringBuilder resource = new StringBuilder().append("META-INF/services/").append(jaxbContextFQCN); - final InputStream resourceStream = - classLoader.getResourceAsStream(resource.toString()); + // TODO: SPEC change required! This is supposed to be! + // JAXBContext obj = firstByServiceLoader(JAXBContext.class, EXCEPTION_HANDLER); + // if (obj != null) return obj; - if (resourceStream != null) { - r = new BufferedReader(new InputStreamReader(resourceStream, "UTF-8")); - factoryClassName = r.readLine(); - if (factoryClassName != null) { - factoryClassName = factoryClassName.trim(); - } - r.close(); - return newInstance(contextPath, factoryClassName, classLoader, properties); - } else { - logger.log(Level.FINE, "Unable to load:{0}", resource.toString()); - } - } catch (UnsupportedEncodingException e) { - // should never happen - throw new JAXBException(e); - } catch (IOException e) { - throw new JAXBException(e); - } finally { - try { - if (r != null) { - r.close(); - } - } catch (IOException ex) { - Logger.getLogger(ContextFinder.class.getName()).log(Level.SEVERE, null, ex); - } - } + // TODO: Deprecated - SPEC change required! + factoryName = firstByServiceLoaderDeprecated(JAXBContext.class, classLoader); + if (factoryName != null) return newInstance(contextPath, factoryName, classLoader, properties); // else no provider found logger.fine("Trying to create the platform default provider"); return newInstance(contextPath, PLATFORM_DEFAULT_FACTORY_CLASS, classLoader, properties); } - static JAXBContext find( Class[] classes, Map properties ) throws JAXBException { - - final String jaxbContextFQCN = JAXBContext.class.getName(); - String factoryClassName; + static JAXBContext find(Class[] classes, Map properties) throws JAXBException { // search for jaxb.properties in the class loader of each class first + logger.fine("Searching jaxb.properties"); for (final Class c : classes) { // this classloader is used only to load jaxb.properties, so doing this should be safe. - ClassLoader classLoader = getClassClassLoader(c); - Package pkg = c.getPackage(); - if(pkg==null) - continue; // this is possible for primitives, arrays, and classes that are loaded by poorly implemented ClassLoaders - String packageName = pkg.getName().replace('.', '/'); + if (c.getPackage() == null) continue; // this is possible for primitives, arrays, and classes that are loaded by poorly implemented ClassLoaders // TODO: do we want to optimize away searching the same package? org.Foo, org.Bar, com.Baz - // classes from the same package might come from different class loades, so it might be a bad idea - + // classes from the same package might come from different class loades, so it might be a bad idea // TODO: it's easier to look things up from the class // c.getResourceAsStream("jaxb.properties"); - // build the resource name and use the property loader code - String resourceName = packageName+"/jaxb.properties"; - logger.log(Level.FINE, "Trying to locate {0}", resourceName); - Properties props = loadJAXBProperties(classLoader, resourceName); - if (props == null) { - logger.fine(" not found"); - } else { - logger.fine(" found"); - if (props.containsKey(JAXB_CONTEXT_FACTORY)) { - // trim() seems redundant, but adding to satisfy customer complaint - factoryClassName = props.getProperty(JAXB_CONTEXT_FACTORY).trim(); - return newInstance(classes, properties, factoryClassName); - } else { - throw new JAXBException(Messages.format(Messages.MISSING_PROPERTY, packageName, JAXB_CONTEXT_FACTORY)); - } - } - } - - // search for a system property second (javax.xml.bind.JAXBContext) - logger.log(Level.FINE, "Checking system property {0}", JAXBContext.JAXB_CONTEXT_FACTORY); - factoryClassName = AccessController.doPrivileged(new GetPropertyAction(JAXBContext.JAXB_CONTEXT_FACTORY)); - if (factoryClassName != null) { - logger.log(Level.FINE, " found {0}", factoryClassName); - return newInstance( classes, properties, factoryClassName ); - } else { // leave it here for compatibility reasons - logger.fine(" not found"); - logger.log(Level.FINE, "Checking system property {0}", jaxbContextFQCN); - factoryClassName = AccessController.doPrivileged(new GetPropertyAction(jaxbContextFQCN)); - if (factoryClassName != null) { - logger.log(Level.FINE, " found {0}", factoryClassName); - return newInstance( classes, properties, factoryClassName ); - } else { - logger.fine(" not found"); - } + String className = classNameFromPackageProperties(JAXBContext.JAXB_CONTEXT_FACTORY, getClassClassLoader(c), c.getPackage().getName().replace('.', '/')); + if (className != null) return newInstance(classes, properties, className); } - // OSGi search - Class jaxbContext = lookupJaxbContextUsingOsgiServiceLoader(); - if (jaxbContext != null) { - logger.fine("OSGi environment detected"); - return newInstance(classes, properties, jaxbContext); + String factoryName = classNameFromSystemProperties(); + if (factoryName != null) return newInstance(classes, properties, factoryName); + + Class ctxFactoryClass = (Class) ServiceLoaderUtil.lookupUsingOSGiServiceLoader("javax.xml.bind.JAXBContext", logger); + if (ctxFactoryClass != null) { + return newInstance(classes, properties, ctxFactoryClass); } - // search META-INF services next - logger.fine("Checking META-INF/services"); - BufferedReader r = null; - try { - final String resource = new StringBuilder("META-INF/services/").append(jaxbContextFQCN).toString(); - ClassLoader classLoader = getContextClassLoader(); - URL resourceURL; - if(classLoader==null) - resourceURL = ClassLoader.getSystemResource(resource); - else - resourceURL = classLoader.getResource(resource); + // TODO: to be removed - deprecated!!! Requires SPEC change!!! + String className = firstByServiceLoaderDeprecated(JAXBContext.class, getContextClassLoader()); + if (className != null) return newInstance(classes, properties, className); - if (resourceURL != null) { - logger.log(Level.FINE, "Reading {0}", resourceURL); - r = new BufferedReader(new InputStreamReader(resourceURL.openStream(), "UTF-8")); - factoryClassName = r.readLine(); - if (factoryClassName != null) { - factoryClassName = factoryClassName.trim(); - } - return newInstance(classes, properties, factoryClassName); - } else { - logger.log(Level.FINE, "Unable to find: {0}", resource); - } - } catch (UnsupportedEncodingException e) { - // should never happen - throw new JAXBException(e); - } catch (IOException e) { - throw new JAXBException(e); - } finally { - if (r != null) { - try { - r.close(); - } catch (IOException ex) { - logger.log(Level.FINE, "Unable to close stream", ex); - } - } - } + // // TODO: supposed to be: + // obj = firstByServiceLoader(JAXBContext.class, EXCEPTION_HANDLER); + // if (obj != null) return obj; // else no provider found logger.fine("Trying to create the platform default provider"); return newInstance(classes, properties, PLATFORM_DEFAULT_FACTORY_CLASS); } - private static Class lookupJaxbContextUsingOsgiServiceLoader() { - try { - // Use reflection to avoid having any dependency on ServiceLoader class - Class target = Class.forName("com.sun.org.glassfish.hk2.osgiresourcelocator.ServiceLoader"); - Method m = target.getMethod("lookupProviderClasses", Class.class); - Iterator iter = ((Iterable) m.invoke(null, JAXBContext.class)).iterator(); - return iter.hasNext() ? (Class)iter.next() : null; - } catch(Exception e) { - logger.log(Level.FINE, "Unable to find from OSGi: javax.xml.bind.JAXBContext"); - return null; + + private static String classNameFromPackageProperties(String factoryId, ClassLoader classLoader, String packageName) throws JAXBException { + String resourceName = packageName + "/jaxb.properties"; + logger.log(Level.FINE, "Trying to locate {0}", resourceName); + Properties props = loadJAXBProperties(classLoader, resourceName); + if (props != null) { + if (props.containsKey(factoryId)) { + return props.getProperty(factoryId); + } else { + throw new JAXBException(Messages.format(Messages.MISSING_PROPERTY, packageName, factoryId)); + } } + return null; } - private static Properties loadJAXBProperties( ClassLoader classLoader, - String propFileName ) - throws JAXBException { + private static String classNameFromSystemProperties() throws JAXBException { + logger.log(Level.FINE, "Checking system property {0}", JAXBContext.JAXB_CONTEXT_FACTORY); + // search for a system property second (javax.xml.bind.JAXBContext) + String factoryClassName = AccessController.doPrivileged(new GetPropertyAction(JAXBContext.JAXB_CONTEXT_FACTORY)); + if (factoryClassName != null) { + logger.log(Level.FINE, " found {0}", factoryClassName); + return factoryClassName; + } else { // leave this here to assure compatibility + logger.fine(" not found"); + logger.log(Level.FINE, "Checking system property {0}", JAXBContext.class.getName()); + factoryClassName = AccessController.doPrivileged(new GetPropertyAction(JAXBContext.class.getName())); + if (factoryClassName != null) { + logger.log(Level.FINE, " found {0}", factoryClassName); + return factoryClassName; + } else { + logger.fine(" not found"); + } + } + return null; + } + + private static Properties loadJAXBProperties(ClassLoader classLoader, String propFileName) throws JAXBException { Properties props = null; - try { URL url; - if(classLoader==null) + if (classLoader == null) url = ClassLoader.getSystemResource(propFileName); else - url = classLoader.getResource( propFileName ); + url = classLoader.getResource(propFileName); - if( url != null ) { + if (url != null) { logger.log(Level.FINE, "loading props from {0}", url); props = new Properties(); InputStream is = url.openStream(); - props.load( is ); + props.load(is); is.close(); } - } catch( IOException ioe ) { - logger.log(Level.FINE,"Unable to load "+propFileName,ioe); - throw new JAXBException( ioe.toString(), ioe ); + } catch (IOException ioe) { + logger.log(Level.FINE, "Unable to load " + propFileName, ioe); + throw new JAXBException(ioe.toString(), ioe); } return props; @@ -520,7 +416,7 @@ String classnameAsResource = clazz.getName().replace('.', '/') + ".class"; - if(loader == null) { + if (loader == null) { loader = getSystemClassLoader(); } @@ -543,50 +439,7 @@ return which(clazz, getClassClassLoader(clazz)); } - /** - * When JAXB is in J2SE, rt.jar has to have a JAXB implementation. - * However, rt.jar cannot have META-INF/services/javax.xml.bind.JAXBContext - * because if it has, it will take precedence over any file that applications have - * in their jar files. - * - *

- * When the user bundles his own JAXB implementation, we'd like to use it, and we - * want the platform default to be used only when there's no other JAXB provider. - * - *

- * For this reason, we have to hard-code the class name into the API. - */ - private static final String PLATFORM_DEFAULT_FACTORY_CLASS = "com.sun.xml.internal.bind.v2.ContextFactory"; - - /** - * Loads the class, provided that the calling thread has an access to the class being loaded. - */ - private static Class safeLoadClass(String className, ClassLoader classLoader) throws ClassNotFoundException { - logger.log(Level.FINE, "Trying to load {0}", className); - try { - // make sure that the current thread has an access to the package of the given name. - SecurityManager s = System.getSecurityManager(); - if (s != null) { - int i = className.lastIndexOf('.'); - if (i != -1) { - s.checkPackageAccess(className.substring(0,i)); - } - } - - if (classLoader == null) { - return Class.forName(className); - } else { - return classLoader.loadClass(className); - } - } catch (SecurityException se) { - // anyone can access the platform default factory class without permission - if (PLATFORM_DEFAULT_FACTORY_CLASS.equals(className)) { - return Class.forName(className); - } - throw se; - } - } - + @SuppressWarnings("unchecked") private static ClassLoader getContextClassLoader() { if (System.getSecurityManager() == null) { return Thread.currentThread().getContextClassLoader(); @@ -600,6 +453,7 @@ } } + @SuppressWarnings("unchecked") private static ClassLoader getClassClassLoader(final Class c) { if (System.getSecurityManager() == null) { return c.getClassLoader(); @@ -626,4 +480,50 @@ } } + // TODO: to be removed - SPEC change required + // ServiceLoaderUtil.firstByServiceLoaderDeprecated should be used instead. + @Deprecated + static String firstByServiceLoaderDeprecated(Class spiClass, ClassLoader classLoader) throws JAXBException { + final String jaxbContextFQCN = spiClass.getName(); + + logger.fine("Searching META-INF/services"); + + // search META-INF services next + BufferedReader r = null; + final String resource = new StringBuilder().append("META-INF/services/").append(jaxbContextFQCN).toString(); + try { + final InputStream resourceStream = + (classLoader == null) ? + ClassLoader.getSystemResourceAsStream(resource) : + classLoader.getResourceAsStream(resource); + + if (resourceStream != null) { + r = new BufferedReader(new InputStreamReader(resourceStream, "UTF-8")); + String factoryClassName = r.readLine(); + if (factoryClassName != null) { + factoryClassName = factoryClassName.trim(); + } + r.close(); + logger.log(Level.FINE, "Configured factorty class:{0}", factoryClassName); + return factoryClassName; + } else { + logger.log(Level.FINE, "Unable to load:{0}", resource); + return null; + } + } catch (UnsupportedEncodingException e) { + // should never happen + throw new JAXBException(e); + } catch (IOException e) { + throw new JAXBException(e); + } finally { + try { + if (r != null) { + r.close(); + } + } catch (IOException ex) { + logger.log(Level.SEVERE, "Unable to close resource: " + resource, ex); + } + } + } + } diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/java.xml.bind/share/classes/javax/xml/bind/JAXBContext.java --- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/JAXBContext.java Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/JAXBContext.java Fri Apr 10 14:54:20 2015 +0300 @@ -63,10 +63,10 @@ * SPEC REQUIREMENT: the provider must supply an implementation * class containing the following method signatures: * - *

- * public static JAXBContext createContext( String contextPath, ClassLoader classLoader, Map<String,Object> properties ) throws JAXBException
- * public static JAXBContext createContext( Class[] classes, Map<String,Object> properties ) throws JAXBException
- * 
+ *
{@code
+ * public static JAXBContext createContext( String contextPath, ClassLoader classLoader, Map properties ) throws JAXBException
+ * public static JAXBContext createContext( Class[] classes, Map properties ) throws JAXBException
+ * }
* *

* The following JAXB 1.0 requirement is only required for schema to @@ -352,7 +352,7 @@ *

* To maintain compatibility with JAXB 1.0 schema to java * interface/implementation binding, enabled by schema customization - * <jaxb:globalBindings valueClass="false">, + * {@literal }, * the JAXB provider will ensure that each package on the context path * has a jaxb.properties file which contains a value for the * javax.xml.bind.context.factory property and that all values @@ -526,7 +526,7 @@ * Not only the new context will recognize all the classes specified, * but it will also recognize any classes that are directly/indirectly * referenced statically from the specified classes. Subclasses of - * referenced classes nor @XmlTransient referenced classes + * referenced classes nor @XmlTransient referenced classes * are not registered with JAXBContext. * * For example, in the following Java code, if you do diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/java.xml.bind/share/classes/javax/xml/bind/JAXBIntrospector.java --- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/JAXBIntrospector.java Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/JAXBIntrospector.java Fri Apr 10 14:54:20 2015 +0300 @@ -74,7 +74,7 @@ * *

Convenience method to abstract whether working with either * a javax.xml.bind.JAXBElement instance or an instance of - * @XmlRootElement annotated Java class.

+ * @XmlRootElement annotated Java class.

* * @param jaxbElement object that #isElement(Object) returns true. * diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/java.xml.bind/share/classes/javax/xml/bind/SchemaOutputResolver.java --- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/SchemaOutputResolver.java Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/SchemaOutputResolver.java Fri Apr 10 14:54:20 2015 +0300 @@ -70,11 +70,11 @@ * * If the {@link Result} object has a system ID, it must be an * absolute system ID. Those system IDs are relativized by the caller and used - * for <xs:import> statements. + * for {@literal } statements. * * If the {@link Result} object does not have a system ID, a schema * for the namespace URI is generated but it won't be explicitly - * <xs:import>ed from other schemas. + * {@literal }ed from other schemas. * * If {@code null} is returned, the schema generation for this * namespace URI will be skipped. diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/java.xml.bind/share/classes/javax/xml/bind/ServiceLoaderUtil.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/ServiceLoaderUtil.java Fri Apr 10 14:54:20 2015 +0300 @@ -0,0 +1,192 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.xml.bind; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.lang.reflect.Method; +import java.security.AccessController; +import java.security.PrivilegedAction; +import java.util.Iterator; +import java.util.Properties; +import java.util.ServiceLoader; +import java.util.logging.Level; +import java.util.logging.Logger; + +/** + * Shared ServiceLoader/FactoryFinder Utils shared among SAAJ, JAXB and JAXWS + * - this class must be duplicated to all those projects, but it's + * basically generic code and we want to have it everywhere same. + * + * @author Miroslav.Kos@oracle.com + */ +class ServiceLoaderUtil { + + private static final String OSGI_SERVICE_LOADER_CLASS_NAME = "com.sun.org.glassfish.hk2.osgiresourcelocator.ServiceLoader"; + private static final String OSGI_SERVICE_LOADER_METHOD_NAME = "lookupProviderClasses"; + + static

P firstByServiceLoader(Class

spiClass, Logger logger) { + // service discovery + ServiceLoader

serviceLoader = ServiceLoader.load(spiClass); + for (P impl : serviceLoader) { + logger.fine("ServiceProvider loading Facility used; returning object [" + impl.getClass().getName() + "]"); + return impl; + } + return null; + } + + static boolean isOsgi(Logger logger) { + try { + Class.forName(OSGI_SERVICE_LOADER_CLASS_NAME); + return true; + } catch (ClassNotFoundException ignored) { + logger.log(Level.FINE, "OSGi classes not found, OSGi not available.", ignored); + } + return false; + } + + static Object lookupUsingOSGiServiceLoader(String factoryId, Logger logger) { + try { + // Use reflection to avoid having any dependendcy on ServiceLoader class + Class serviceClass = Class.forName(factoryId); + Class target = Class.forName(OSGI_SERVICE_LOADER_CLASS_NAME); + Method m = target.getMethod(OSGI_SERVICE_LOADER_METHOD_NAME, Class.class); + Iterator iter = ((Iterable) m.invoke(null, serviceClass)).iterator(); + if (iter.hasNext()) { + Object next = iter.next(); + logger.fine("Found implementation using OSGi facility; returning object [" + next.getClass().getName() + "]."); + return next; + } else { + return null; + } + } catch (Exception ignored) { + logger.log(Level.FINE, "Unable to find from OSGi: [" + factoryId + "]", ignored); + return null; + } + } + + static String propertyFileLookup(final String configFullPath, final String factoryId) throws IOException { + File f = new File(configFullPath); + String factoryClassName = null; + if (f.exists()) { + Properties props = new Properties(); + FileInputStream stream = null; + try { + stream = new FileInputStream(f); + props.load(stream); + factoryClassName = props.getProperty(factoryId); + } finally { + if (stream != null) { + try { + stream.close(); + } catch (IOException ignored) { + } + } + } + } + return factoryClassName; + } + + static void checkPackageAccess(String className) { + // make sure that the current thread has an access to the package of the given name. + SecurityManager s = System.getSecurityManager(); + if (s != null) { + int i = className.lastIndexOf('.'); + if (i != -1) { + s.checkPackageAccess(className.substring(0, i)); + } + } + } + + static Class nullSafeLoadClass(String className, ClassLoader classLoader) throws ClassNotFoundException { + if (classLoader == null) { + return Class.forName(className); + } else { + return classLoader.loadClass(className); + } + } + + /** + * Returns instance of required class. It checks package access (security) unless it is defaultClassname. It means if you + * are trying to instantiate default implementation (fallback), pass the class name to both first and second parameter. + * + * @param className class to be instantiated + * @param isDefaultClassname says whether default implementation class + * @param handler exception handler - necessary for wrapping exceptions and logging + * @param Type of exception being thrown (necessary to distinguish between Runtime and checked exceptions) + * @return instantiated object or throws Runtime/checked exception, depending on ExceptionHandler's type + * @throws T + */ + static Object newInstance(String className, String defaultImplClassName, final ExceptionHandler handler) throws T { + try { + return safeLoadClass(className, defaultImplClassName, contextClassLoader(handler)).newInstance(); + } catch (ClassNotFoundException x) { + throw handler.createException(x, "Provider " + className + " not found"); + } catch (Exception x) { + throw handler.createException(x, "Provider " + className + " could not be instantiated: " + x); + } + } + + static Class safeLoadClass(String className, String defaultImplClassName, ClassLoader classLoader) throws ClassNotFoundException { + try { + checkPackageAccess(className); + } catch (SecurityException se) { + // anyone can access the platform default factory class without permission + if (defaultImplClassName != null && defaultImplClassName.equals(className)) { + return Class.forName(className); + } + // not platform default implementation ... + throw se; + } + return nullSafeLoadClass(className, classLoader); + } + + static String getJavaHomeLibConfigPath(String filename) { + String javah = AccessController.doPrivileged(new PrivilegedAction() { + @Override + public String run() { + return System.getProperty("java.home"); + } + }); + return javah + File.separator + "lib" + File.separator + filename; + } + + static ClassLoader contextClassLoader(ExceptionHandler exceptionHandler) throws Exception { + try { + return Thread.currentThread().getContextClassLoader(); + } catch (Exception x) { + throw exceptionHandler.createException(x, x.toString()); + } + } + + static abstract class ExceptionHandler { + + public abstract T createException(Throwable throwable, String message); + + } + +} diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/java.xml.bind/share/classes/javax/xml/bind/Unmarshaller.java --- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/Unmarshaller.java Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/Unmarshaller.java Fri Apr 10 14:54:20 2015 +0300 @@ -73,12 +73,12 @@ * Unmarshalling from a StringBuffer using a * javax.xml.transform.stream.StreamSource: *

- *
+ *    
{@code
  *       JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" );
  *       Unmarshaller u = jc.createUnmarshaller();
- *       StringBuffer xmlStr = new StringBuffer( "<?xml version="1.0"?>..." );
+ *       StringBuffer xmlStr = new StringBuffer( "..." );
  *       Object o = u.unmarshal( new StreamSource( new StringReader( xmlStr.toString() ) ) );
- *    
+ * }
*
* *

@@ -238,7 +238,7 @@ * to a JAXB mapped class by {@link JAXBContext}, that the root * element's xsi:type attribute takes * precedence over the unmarshal methods declaredType parameter. - * These methods always return a JAXBElement<declaredType> + * These methods always return a {@literal JAXBElement} * instance. The table below shows how the properties of the returned JAXBElement * instance are set. * @@ -281,21 +281,21 @@ *

* Unmarshal by declaredType from a org.w3c.dom.Node: *

- *
+ *    
{@code
  *       Schema fragment for example
- *       <xs:schema>
- *          <xs:complexType name="FooType">...<\xs:complexType>
- *          <!-- global element declaration "PurchaseOrder" -->
- *          <xs:element name="PurchaseOrder">
- *              <xs:complexType>
- *                 <xs:sequence>
- *                    <!-- local element declaration "foo" -->
- *                    <xs:element name="foo" type="FooType"/>
+ *       
+ *          ...<\xs:complexType>
+ *          
+ *          
+ *              
+ *                 
+ *                    
+ *                    
  *                    ...
- *                 </xs:sequence>
- *              </xs:complexType>
- *          </xs:element>
- *       </xs:schema>
+ *                 
+ *              
+ *          
+ *       
  *
  *       JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" );
  *       Unmarshaller u = jc.createUnmarshaller();
@@ -308,8 +308,8 @@
  *                                  // local element declaration in schema.
  *
  *       // FooType is the JAXB mapping of the type of local element declaration foo.
- *       JAXBElement<FooType> foo = u.unmarshal( fooSubtree, FooType.class);
- *    
+ * JAXBElement foo = u.unmarshal( fooSubtree, FooType.class); + * }
*
* *

diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlAnyElement.java --- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlAnyElement.java Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlAnyElement.java Fri Apr 10 14:54:20 2015 +0300 @@ -94,15 +94,15 @@ *

Schema To Java example

* * The following schema would produce the following Java class: - *
- * <xs:complexType name="foo">
- *   <xs:sequence>
- *     <xs:element name="a" type="xs:int" />
- *     <xs:element name="b" type="xs:int" />
- *     <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
- *   </xs:sequence>
- * </xs:complexType>
- * 
+ *
{@code
+ * 
+ *   
+ *     
+ *     
+ *     
+ *   
+ * 
+ * }
* *
  * class Foo {
@@ -115,30 +115,30 @@
  *
  * It can unmarshal instances like
  *
- * 
- * <foo xmlns:e="extra">
- *   <a>1</a>
- *   <e:other />  // this will be bound to DOM, because unmarshalling is orderless
- *   <b>3</b>
- *   <e:other />
- *   <c>5</c>     // this will be bound to DOM, because the annotation doesn't remember namespaces.
- * </foo>
- * 
+ *
{@code
+ * 
+ *   1
+ *     // this will be bound to DOM, because unmarshalling is orderless
+ *   3
+ *   
+ *   5     // this will be bound to DOM, because the annotation doesn't remember namespaces.
+ * 
+ * }
* * * * The following schema would produce the following Java class: - *
- * <xs:complexType name="bar">
- *   <xs:complexContent>
- *   <xs:extension base="foo">
- *     <xs:sequence>
- *       <xs:element name="c" type="xs:int" />
- *       <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
- *     </xs:sequence>
- *   </xs:extension>
- * </xs:complexType>
- * 
+ *
{@code
+ * 
+ *   
+ *   
+ *     
+ *       
+ *       
+ *     
+ *   
+ * 
+ * }
* *
  * class Bar extends Foo {
@@ -150,16 +150,16 @@
  *
  * It can unmarshal instances like
  *
- * 
- * <bar xmlns:e="extra">
- *   <a>1</a>
- *   <e:other />  // this will be bound to DOM, because unmarshalling is orderless
- *   <b>3</b>
- *   <e:other />
- *   <c>5</c>     // this now goes to Bar.c
- *   <e:other />  // this will go to Foo.any
- * </bar>
- * 
+ *
{@code
+ * 
+ *   1
+ *     // this will be bound to DOM, because unmarshalling is orderless
+ *   3
+ *   
+ *   5     // this now goes to Bar.c
+ *     // this will go to Foo.any
+ * 
+ * }
* * * @@ -171,15 +171,15 @@ * *

* The following schema would produce the following Java class: - *

- * <xs:complexType name="foo">
- *   <xs:choice maxOccurs="unbounded" minOccurs="0">
- *     <xs:element name="a" type="xs:int" />
- *     <xs:element name="b" type="xs:int" />
- *     <xs:any namespace="##other" processContents="lax" />
- *   </xs:choice>
- * </xs:complexType>
- * 
+ *
{@code
+ * 
+ *   
+ *     
+ *     
+ *     
+ *   
+ * 
+ * }
* *
  * class Foo {
@@ -204,11 +204,11 @@
  * It can unmarshal instances like
  *
  * 
- * <foo xmlns:e="extra">
- *   <a>1</a>     // this will unmarshal to a {@link JAXBElement} instance whose value is 1.
- *   <e:other />  // this will unmarshal to a DOM {@link Element}.
- *   <b>3</b>     // this will unmarshal to a {@link JAXBElement} instance whose value is 1.
- * </foo>
+ *{@code }
+ *{@code   1}     // this will unmarshal to a {@link JAXBElement} instance whose value is 1.
+ *{@code   }  // this will unmarshal to a DOM {@link Element}.
+ *{@code   3}     // this will unmarshal to a {@link JAXBElement} instance whose value is 1.
+ *{@code }
  * 
* * @@ -225,11 +225,11 @@ * } *
* then the following document will unmarshal like this: - *
- * <foo>
- *   <unknown />
- *   <foo />
- * </foo>
+ * 
{@code
+ * 
+ *   
+ *   
+ * 
  *
  * Foo foo = unmarshal();
  * // 1 for 'unknown', another for 'foo'
@@ -239,7 +239,7 @@
  * // because of lax=true, the 'foo' element eagerly
  * // unmarshals to a Foo object.
  * assert foo.others[1] instanceof Foo;
- * 
+ * }
* * @author Kohsuke Kawaguchi * @since 1.6, JAXB 2.0 diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlAttachmentRef.java --- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlAttachmentRef.java Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlAttachmentRef.java Fri Apr 10 14:54:20 2015 +0300 @@ -51,16 +51,16 @@ * } *
* The above code maps to the following XML: - *
- * <xs:element name="foo" xmlns:ref="http://ws-i.org/profiles/basic/1.1/xsd">
- *   <xs:complexType>
- *     <xs:sequence>
- *       <xs:element name="body" type="ref:swaRef" minOccurs="0" />
- *     </xs:sequence>
- *     <xs:attribute name="data" type="ref:swaRef" use="optional" />
- *   </xs:complexType>
- * </xs:element>
- * 
+ *
{@code
+ * 
+ *   
+ *     
+ *       
+ *     
+ *     
+ *   
+ * 
+ * }
* *

* The above binding supports WS-I AP 1.0 WS-I Attachments Profile Version 1.0. diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlAttribute.java --- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlAttribute.java Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlAttribute.java Fri Apr 10 14:54:20 2015 +0300 @@ -89,14 +89,15 @@ * public java.math.BigDecimal getPrice() {...} ; * public void setPrice(java.math.BigDecimal ) {...}; * } + * {@code * - * <!-- Example: XML Schema fragment --> - * <xs:complexType name="USPrice"> - * <xs:sequence> - * </xs:sequence> - * <xs:attribute name="price" type="xs:decimal"/> - * </xs:complexType> - *

+ * + * + * + * + * + * + * } * *

Example 2: Map a JavaBean property to an XML attribute with anonymous type.

* See Example 7 in @{@link XmlType}. @@ -108,17 +109,18 @@ * ... * @XmlAttribute List<Integer> items; * } + * {@code * - * <!-- Example: XML Schema fragment --> - * <xs:complexType name="foo"> + * + * * ... - * <xs:attribute name="items"> - * <xs:simpleType> - * <xs:list itemType="xs:int"/> - * </xs:simpleType> - * </xs:complexType> + * + * + * + * + * * - * + * } * @author Sekhar Vajjhala, Sun Microsystems, Inc. * @see XmlType * @since 1.6, JAXB 2.0 diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlElement.java --- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlElement.java Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlElement.java Fri Apr 10 14:54:20 2015 +0300 @@ -82,14 +82,15 @@ * @XmlElement(name="itemprice") * public java.math.BigDecimal price; * } + * {@code * - * <!-- Example: Local XML Schema element --> - * <xs:complexType name="USPrice"/> - * <xs:sequence> - * <xs:element name="itemprice" type="xs:decimal" minOccurs="0"/> - * </sequence> - * </xs:complexType> - * + * + * + * + * + * + * + * } *

* * Example 2: Map a field to a nillable element. @@ -100,14 +101,15 @@ * @XmlElement(nillable=true) * public java.math.BigDecimal price; * } + * {@code * - * <!-- Example: Local XML Schema element --> - * <xs:complexType name="USPrice"> - * <xs:sequence> - * <xs:element name="price" type="xs:decimal" nillable="true" minOccurs="0"/> - * </sequence> - * </xs:complexType> - * + * + * + * + * + * + * + * } *

* Example 3: Map a field to a nillable, required element. *

@@ -117,14 +119,15 @@
  *         @XmlElement(nillable=true, required=true)
  *         public java.math.BigDecimal price;
  *     }
+ * {@code
  *
- *     <!-- Example: Local XML Schema element -->
- *     <xs:complexType name="USPrice">
- *       <xs:sequence>
- *         <xs:element name="price" type="xs:decimal" nillable="true" minOccurs="1"/>
- *       </sequence>
- *     </xs:complexType>
- *   
+ * + * + * + * + * + * + * } * *

Example 4: Map a JavaBean property to an XML element * with anonymous type.

@@ -179,7 +182,7 @@ * the enclosing class. * *
  • - * Otherwise '' (which produces unqualified element in the default + * Otherwise {@literal ''} (which produces unqualified element in the default * namespace. * */ diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlElementDecl.java --- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlElementDecl.java Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlElementDecl.java Fri Apr 10 14:54:20 2015 +0300 @@ -65,21 +65,22 @@ * JAXBElement<String> createFoo(String s) { ... } * } * - *
    - *     <!-- XML input -->
    - *       <foo>string</foo>
    + * 
     {@code
    + *
    + *     
    + *     string
      *
      *     // Example: code fragment corresponding to XML input
    - *     JAXBElement<String> o =
    - *     (JAXBElement<String>)unmarshaller.unmarshal(aboveDocument);
    + *     JAXBElement o =
    + *     (JAXBElement)unmarshaller.unmarshal(aboveDocument);
      *     // print JAXBElement instance to show values
      *     System.out.println(o.getName());   // prints  "{}foo"
      *     System.out.println(o.getValue());  // prints  "string"
      *     System.out.println(o.getValue().getClass()); // prints "java.lang.String"
      *
    - *     <!-- Example: XML schema definition -->
    - *     <xs:element name="foo" type="xs:string"/>
    - * 
    + * + * + * }
    * *

    Example 2: Element declaration with non local scope *

    @@ -90,18 +91,18 @@ * The following example may be replaced in a future revision of * this javadoc. * - *

    - *     <!-- Example: XML schema definition -->
    - *     <xs:schema>
    - *       <xs:complexType name="pea">
    - *         <xs:choice maxOccurs="unbounded">
    - *           <xs:element name="foo" type="xs:string"/>
    - *           <xs:element name="bar" type="xs:string"/>
    - *         </xs:choice>
    - *       </xs:complexType>
    - *       <xs:element name="foo" type="xs:int"/>
    - *     </xs:schema>
    - * 
    + *
    {@code
    + *     
    + *     
    + *       
    + *         
    + *           
    + *           
    + *         
    + *       
    + *       
    + *     
    + * }
    *
      *     // Example: expected default binding
      *     class Pea {
    diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlElementRef.java
    --- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlElementRef.java	Thu Apr 09 06:40:17 2015 -0700
    +++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlElementRef.java	Fri Apr 10 14:54:20 2015 +0300
    @@ -56,10 +56,10 @@
      * support for substitution groups using an element property,
      * (section 5.5.5, "Element Property" of JAXB 2.0 specification). An
      * element property method signature is of the form:
    - * 
    - *     public void setTerm(JAXBElement<? extends Operator>);
    - *     public JAXBElement<? extends Operator> getTerm();
    - * 
    + *
    {@code
    + *     public void setTerm(JAXBElement);
    + *     public JAXBElement getTerm();
    + * }
    *

    * An element factory method annotated with {@link XmlElementDecl} is * used to create a JAXBElement instance, containing an XML @@ -121,19 +121,20 @@ * class JavacTask extends Task { * ... * } + * {@code * - * <!-- XML Schema fragment --> - * <xs:element name="target" type="Target"> - * <xs:complexType name="Target"> - * <xs:sequence> - * <xs:choice maxOccurs="unbounded"> - * <xs:element ref="jar"> - * <xs:element ref="javac"> - * </xs:choice> - * </xs:sequence> - * </xs:complexType> + * + * + * + * + * + * + * + * + * + * * - *

    + * } *

    * Thus the following code fragment: *

    @@ -143,16 +144,16 @@
      *     marshal(target);
      * 
    * will produce the following XML output: - *
    - *     <target>
    - *       <jar>
    + * 
    {@code
    + *     
    + *       
      *         ....
    - *       </jar>
    - *       <javac>
    + *       
    + *       
      *         ....
    - *       </javac>
    - *     </target>
    - * 
    + * + * + * }
    *

    * It is not an error to have a class that extends Task * that doesn't have {@link XmlRootElement}. But they can't show up in an @@ -207,11 +208,11 @@ * marshal(m); * * will produce the following XML output: - *

    - *     <math>
    - *       <add>...</add>
    - *     </math>
    - * 
    + *
    {@code
    + *     
    + *       ...
    + *     
    + * }
    * * * @author
    • Kohsuke Kawaguchi, Sun Microsystems,Inc.
    • Sekhar Vajjhala, Sun Microsystems, Inc.
    diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlElementWrapper.java --- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlElementWrapper.java Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlElementWrapper.java Fri Apr 10 14:54:20 2015 +0300 @@ -39,21 +39,21 @@ * XML element around collections. The annotation therefore supports * two forms of serialization shown below. * - *
    + * 
    {@code
      *    //Example: code fragment
      *      int[] names;
      *
      *    // XML Serialization Form 1 (Unwrapped collection)
    - *    <names> ... </names>
    - *    <names> ... </names>
    + *     ... 
    + *     ... 
      *
      *    // XML Serialization Form 2 ( Wrapped collection )
    - *    <wrapperElement>
    - *       <names> value-of-item </names>
    - *       <names> value-of-item </names>
    + *    
    + *        value-of-item 
    + *        value-of-item 
      *       ....
    - *    </wrapperElement>
    - * 
    + * + * }
    * *

    The two serialized XML forms allow a null collection to be * represented either by absence or presence of an element with a diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlElements.java --- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlElements.java Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlElements.java Fri Apr 10 14:54:20 2015 +0300 @@ -44,7 +44,7 @@ * @XmlElements({ @XmlElement(...),@XmlElement(...) }) * * - *

    The @XmlElements annnotation can be used with the + *

    The @XmlElements annotation can be used with the * following program elements:

    *
      *
    • a JavaBean property
    • @@ -78,28 +78,29 @@ * @XmlElements( * @XmlElement(name="A", type=Integer.class), * @XmlElement(name="B", type=Float.class) - * } + * ) * public List items; * } + * {@code * - * <!-- XML Representation for a List of {1,2.5} - * XML output is not wrapped using another element --> + * * ... - * <A> 1 </A> - * <B> 2.5 </B> + * 1 + * 2.5 * ... * - * <!-- XML Schema fragment --> - * <xs:complexType name="Foo"> - * <xs:sequence> - * <xs:choice minOccurs="0" maxOccurs="unbounded"> - * <xs:element name="A" type="xs:int"/> - * <xs:element name="B" type="xs:float"/> - * <xs:choice> - * </xs:sequence> - * </xs:complexType> + * + * + * + * + * + * + * + * + * * - * + * } * *

      Example 2: Map to a list of elements wrapped with another element *

      @@ -114,21 +115,22 @@ * } * public List items; * } + * {@code * - * <!-- XML Schema fragment --> - * <xs:complexType name="Foo"> - * <xs:sequence> - * <xs:element name="bar"> - * <xs:complexType> - * <xs:choice minOccurs="0" maxOccurs="unbounded"> - * <xs:element name="A" type="xs:int"/> - * <xs:element name="B" type="xs:float"/> - * </xs:choice> - * </xs:complexType> - * </xs:element> - * </xs:sequence> - * </xs:complexType> - * + * + * + * + * + * + * + * + * + * + * + * + * + * + * } * *

      Example 3: Change element name based on type using an adapter. *

      @@ -145,21 +147,22 @@ * @XmlType abstract class P {...} * @XmlType(name="PX") class PX extends P {...} * @XmlType(name="PY") class PY extends P {...} + * {@code * - * <!-- XML Schema fragment --> - * <xs:complexType name="Foo"> - * <xs:sequence> - * <xs:element name="bar"> - * <xs:complexType> - * <xs:choice minOccurs="0" maxOccurs="unbounded"> - * <xs:element name="A" type="PX"/> - * <xs:element name="B" type="PY"/> - * </xs:choice> - * </xs:complexType> - * </xs:element> - * </xs:sequence> - * </xs:complexType> - * + * + * + * + * + * + * + * + * + * + * + * + * + * + * } * * @author
      • Kohsuke Kawaguchi, Sun Microsystems, Inc.
      • Sekhar Vajjhala, Sun Microsystems, Inc.
      * @see XmlElement diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlEnumValue.java --- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlEnumValue.java Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlEnumValue.java Fri Apr 10 14:54:20 2015 +0300 @@ -56,23 +56,24 @@ *

      In the absence of this annotation, {@link Enum#name()} is used * as the XML representation. * - *

      Example 1: Map enum constant name -> enumeration facet

      + *

      Example 1: Map enum constant name {@literal ->} enumeration facet

      *
        *     //Example: Code fragment
        *     @XmlEnum(String.class)
        *     public enum Card { CLUBS, DIAMONDS, HEARTS, SPADES }
      + * {@code
        *
      - *     <!-- Example: XML Schema fragment -->
      - *     <xs:simpleType name="Card">
      - *       <xs:restriction base="xs:string"/>
      - *         <xs:enumeration value="CLUBS"/>
      - *         <xs:enumeration value="DIAMONDS"/>
      - *         <xs:enumeration value="HEARTS"/>
      - *         <xs:enumeration value="SPADES"/>
      - *     </xs:simpleType>
      - * 
      + * + * + * + * + * + * + * + * + * } * - *

      Example 2: Map enum constant name(value) -> enumeration facet

      + *

      Example 2: Map enum constant name(value) {@literal ->} enumeration facet

      *
        *     //Example: code fragment
        *     @XmlType
      @@ -82,19 +83,20 @@
        *         @XmlEnumValue("5") NICKEL(5),
        *         @XmlEnumValue("10") DIME(10),
        *         @XmlEnumValue("25") QUARTER(25) }
      + * {@code
        *
      - *     <!-- Example: XML Schema fragment -->
      - *     <xs:simpleType name="Coin">
      - *       <xs:restriction base="xs:int">
      - *         <xs:enumeration value="1"/>
      - *         <xs:enumeration value="5"/>
      - *         <xs:enumeration value="10"/>
      - *         <xs:enumeration value="25"/>
      - *       </xs:restriction>
      - *     </xs:simpleType>
      - * 
      + * + * + * + * + * + * + * + * + * + * } * - *

      Example 3: Map enum constant name -> enumeration facet

      + *

      Example 3: Map enum constant name {@literal ->} enumeration facet

      * *
        *     //Code fragment
      @@ -104,15 +106,16 @@
        *         @XmlEnumValue("1") ONE,
        *         @XmlEnumValue("2") TWO;
        *     }
      + * {@code
        *
      - *     <!-- Example: XML Schema fragment -->
      - *     <xs:simpleType name="Code">
      - *       <xs:restriction base="xs:int">
      - *         <xs:enumeration value="1"/>
      - *         <xs:enumeration value="2"/>
      - *       </xs:restriction>
      - *     </xs:simpleType>
      - * 
      + * + * + * + * + * + * + * + * } * * @since 1.6, JAXB 2.0 */ diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlID.java --- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlID.java Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlID.java Fri Apr 10 14:54:20 2015 +0300 @@ -73,17 +73,18 @@ * public void setCustomerID(String id); * .... other properties not shown * } + * {@code * - * <!-- Example: XML Schema fragment --> - * <xs:complexType name="Customer"> - * <xs:complexContent> - * <xs:sequence> + * + * + * + * * .... - * </xs:sequence> - * <xs:attribute name="customerID" type="xs:ID"/> - * </xs:complexContent> - * </xs:complexType> - * + * + * + * + * + * } * * @author Sekhar Vajjhala, Sun Microsystems, Inc. * @see XmlIDREF diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlIDREF.java --- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlIDREF.java Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlIDREF.java Fri Apr 10 14:54:20 2015 +0300 @@ -37,7 +37,7 @@ *

      * To preserve referential integrity of an object graph across XML * serialization followed by a XML deserialization, requires an object - * reference to be marshalled by reference or containment + * reference to be marshaled by reference or containment * appropriately. Annotations @XmlID and @XmlIDREF * together allow a customized mapping of a JavaBean property's * type by containment or reference. @@ -82,18 +82,19 @@ * public void setCustomer(Customer customer); * .... * } + * {@code * - * <!-- Example: XML Schema fragment --> - * <xs:complexType name="Shipping"> - * <xs:complexContent> - * <xs:sequence> - * <xs:element name="customer" type="xs:IDREF"/> + * + * + * + * + * * .... - * </xs:sequence> - * </xs:complexContent> - * </xs:complexType> + * + * + * * - * + * } * * *

      Example 2: The following is a complete example of @@ -142,64 +143,65 @@ * // maps reference to Invoice by containment by default. * public Invoice getInvoice(); * } + * {@code * - * <!-- XML Schema mapping for above code frament --> + * * - * <xs:complexType name="Invoice"> - * <xs:complexContent> - * <xs:sequence> - * <xs:element name="customer" type="xs:IDREF"/> + * + * + * + * * .... - * </xs:sequence> - * </xs:complexContent> - * </xs:complexType> + * + * + * * - * <xs:complexType name="Shipping"> - * <xs:complexContent> - * <xs:sequence> - * <xs:element name="customer" type="xs:IDREF"/> + * + * + * + * * .... - * </xs:sequence> - * </xs:complexContent> - * </xs:complexType> + * + * + * * - * <xs:complexType name="Customer"> - * <xs:complexContent> - * <xs:sequence> + * + * + * * .... - * </xs:sequence> - * <xs:attribute name="CustomerID" type="xs:ID"/> - * </xs:complexContent> - * </xs:complexType> + * + * + * + * * - * <xs:complexType name="CustomerData"> - * <xs:complexContent> - * <xs:sequence> - * <xs:element name="customer" type="xs:Customer"/> - * <xs:element name="shipping" type="xs:Shipping"/> - * <xs:element name="invoice" type="xs:Invoice"/> - * </xs:sequence> - * </xs:complexContent> - * </xs:complexType> + * + * + * + * + * + * + * + * + * * - * <xs:element name"customerData" type="xs:CustomerData"/> + * * - * <!-- Instance document conforming to the above XML Schema --> - * <customerData> - * <customer customerID="Alice"> + * + * + * * .... - * </customer> + * * - * <shipping customer="Alice"> + * * .... - * </shipping> + * * - * <invoice customer="Alice"> + * * .... - * </invoice> - * </customerData> + * + * * - * + * } * *

      Example 3: Mapping List to repeating element of type IDREF *

      @@ -209,16 +211,17 @@
        *         @XmlElement(name="Alice")
        *             public List customers;
        *     }
      + * {@code
        *
      - *     <!-- XML schema fragment -->
      - *     <xs:complexType name="Shipping">
      - *       <xs:sequence>
      - *         <xs:choice minOccurs="0" maxOccurs="unbounded">
      - *           <xs:element name="Alice" type="xs:IDREF"/>
      - *         </xs:choice>
      - *       </xs:sequence>
      - *     </xs:complexType>
      - * 
      + * + * + * + * + * + * + * + * + * } * *

      Example 4: Mapping a List to a list of elements of type IDREF. *

      @@ -230,17 +233,18 @@
        *              @XmlElement(name="John", type="InternationalCustomer.class")
        *         public List customers;
        *     }
      + * {@code
        *
      - *     <!-- XML Schema fragment -->
      - *     <xs:complexType name="Shipping">
      - *       <xs:sequence>
      - *         <xs:choice minOccurs="0" maxOccurs="unbounded">
      - *           <xs:element name="Alice" type="xs:IDREF"/>
      - *           <xs:element name="John" type="xs:IDREF"/>
      - *         </xs:choice>
      - *       </xs:sequence>
      - *     </xs:complexType>
      - * 
      + * + * + * + * + * + * + * + * + * + * } * @author Sekhar Vajjhala, Sun Microsystems, Inc. * @see XmlID * @since 1.6, JAXB 2.0 diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlList.java --- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlList.java Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlList.java Fri Apr 10 14:54:20 2015 +0300 @@ -59,12 +59,12 @@ * * would produce XML like this: * - *
      - * <foo>
      - *   <data>abc</data>
      - *   <data>def</data>
      - * </foo>
      - * 
      + *
      {@code
      + * 
      + *   abc
      + *   def
      + * 
      + * }
      * * @XmlList annotation, on the other hand, allows multiple values to be * represented as whitespace-separated tokens in a single element. For example, @@ -80,11 +80,11 @@ * * the above code will produce XML like this: * - *
      - * <foo>
      - *   <data>abc def</data>
      - * </foo>
      - * 
      + *
      {@code
      + * 
      + *   abc def
      + * 
      + * }
      * *

      This annotation can be used with the following annotations: * {@link XmlElement}, diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlMixed.java --- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlMixed.java Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlMixed.java Fri Apr 10 14:54:20 2015 +0300 @@ -56,32 +56,33 @@ *

    * * Below is an example of binding and creation of mixed content. - *
    - *  <!-- schema fragment having  mixed content -->
    - *  <xs:complexType name="letterBody" mixed="true">
    - *    <xs:sequence>
    - *      <xs:element name="name" type="xs:string"/>
    - *      <xs:element name="quantity" type="xs:positiveInteger"/>
    - *      <xs:element name="productName" type="xs:string"/>
    - *      <!-- etc. -->
    - *    </xs:sequence>
    - *  </xs:complexType>
    - *  <xs:element name="letterBody" type="letterBody"/>
    + * 
    {@code
    + *
    + *  
    + *  
    + *    
    + *      
    + *      
    + *      
    + *      
    + *    
    + *  
    + *  
      *
      * // Schema-derived Java code:
      * // (Only annotations relevant to mixed content are shown below,
    - * //  others are ommitted.)
    + * //  others are omitted.)
      * import java.math.BigInteger;
      * public class ObjectFactory {
      *      // element instance factories
    - *      JAXBElement<LetterBody> createLetterBody(LetterBody value);
    - *      JAXBElement<String>     createLetterBodyName(String value);
    - *      JAXBElement<BigInteger> createLetterBodyQuantity(BigInteger value);
    - *      JAXBElement<String>     createLetterBodyProductName(String value);
    + *      JAXBElement createLetterBody(LetterBody value);
    + *      JAXBElement     createLetterBodyName(String value);
    + *      JAXBElement createLetterBodyQuantity(BigInteger value);
    + *      JAXBElement     createLetterBodyProductName(String value);
      *      // type instance factory
      *      LetterBody createLetterBody();
      * }
    - * 
    + * }
    *
      * public class LetterBody {
      *      // Mixed content can contain instances of Element classes
    @@ -96,17 +97,17 @@
      * }
      * 
    * The following is an XML instance document with mixed content - *
    - * <letterBody>
    - * Dear Mr.<name>Robert Smith</name>
    - * Your order of <quantity>1</quantity> <productName>Baby
    - * Monitor</productName> shipped from our warehouse. ....
    - * </letterBody>
    - * 
    + *
    {@code
    + * 
    + * Dear Mr.Robert Smith
    + * Your order of 1 Baby
    + * Monitor shipped from our warehouse. ....
    + * 
    + * }
    * that can be constructed using following JAXB API calls. - *
    + * 
    {@code
      * LetterBody lb = ObjectFactory.createLetterBody();
    - * JAXBElement<LetterBody> lbe = ObjectFactory.createLetterBody(lb);
    + * JAXBElement lbe = ObjectFactory.createLetterBody(lb);
      * List gcl = lb.getContent();  //add mixed content to general content property.
      * gcl.add("Dear Mr.");  // add text information item as a String.
      *
    @@ -119,7 +120,7 @@
      *                      createLetterBodyQuantity(new BigInteger("1")));
      * gcl.add(ObjectFactory.createLetterBodyProductName("Baby Monitor"));
      * gcl.add("shipped from our warehouse");  // add text information item
    - * 
    + * }
    * *

    See "Package Specification" in javax.xml.bind.package javadoc for * additional common information.

    diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlRootElement.java --- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlRootElement.java Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlRootElement.java Fri Apr 10 14:54:20 2015 +0300 @@ -73,28 +73,30 @@ * marshal( new Point(3,5), System.out); * * - *
    - *     <!-- Example: XML output -->
    - *     <point>
    - *       <x> 3 </x>
    - *       <y> 5 </y>
    - *     </point>
    - * 
    + *
    {@code
    + *
    + *     
    + *     
    + *        3 
    + *        5 
    + *     
    + * }
    * * The annotation causes an global element declaration to be produced * in the schema. The global element declaration is associated with * the XML schema type to which the class is mapped. * - *
    - *     <!-- Example: XML schema definition -->
    - *     <xs:element name="point" type="point"/>
    - *     <xs:complexType name="point">
    - *       <xs:sequence>
    - *         <xs:element name="x" type="xs:int"/>
    - *         <xs:element name="y" type="xs:int"/>
    - *       </xs:sequence>
    - *     </xs:complexType>
    - * 
    + *
    {@code
    + *
    + *     
    + *     
    + *     
    + *       
    + *         
    + *         
    + *       
    + *     
    + * }
    * *

    * @@ -113,27 +115,28 @@ * * //Example: Code fragment corresponding to XML output * * marshal( new Point3D(3,5,0), System.out ); + * {@code * - * <!-- Example: XML output --> - * <!-- The element name is point3D not point --> - * <point3D> - * <x>3</x> - * <y>5</y> - * <z>0</z> - * </point3D> + * + * + * + * 3 + * 5 + * 0 + * * - * <!-- Example: XML schema definition --> - * <xs:element name="point3D" type="point3D"/> - * <xs:complexType name="point3D"> - * <xs:complexContent> - * <xs:extension base="point"> - * <xs:sequence> - * <xs:element name="z" type="xs:int"/> - * </xs:sequence> - * </xs:extension> - * </xs:complexContent> - * </xs:complexType> - * + * + * + * + * + * + * + * + * + * + * + * + * } * * Example 3: Associate a global element with XML Schema type * to which the class is mapped. @@ -144,15 +147,16 @@ * @XmlElement * public java.math.BigDecimal price; * } + * {@code * - * <!-- Example: XML schema definition --> - * <xs:element name="PriceElement" type="USPrice"/> - * <xs:complexType name="USPrice"> - * <xs:sequence> - * <xs:element name="price" type="xs:decimal"/> - * </sequence> - * </xs:complexType> - * + * + * + * + * + * + * + * + * } * * @author Sekhar Vajjhala, Sun Microsystems, Inc. * @since 1.6, JAXB 2.0 diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlSchema.java --- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlSchema.java Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlSchema.java Fri Apr 10 14:54:20 2015 +0300 @@ -63,16 +63,17 @@ * @javax.xml.bind.annotation.XmlSchema ( * namespace = "http://www.example.com/MYPO1" * ) + * {@code * - * <!-- XML Schema fragment --> - * <schema + * + * + * > + * + * } * *

    Example 2: Customize namespace prefix, namespace URI * mapping

    @@ -86,16 +87,17 @@ * * @javax.xml.bind.annotation.XmlNs(prefix="xs", * namespaceURI="http://www.w3.org/2001/XMLSchema") - * ) + * } * ) + * {@code * - * <!-- XML Schema fragment --> - * <schema + * + * * - * + * } * *

    Example 3: Customize elementFormDefault

    *
    @@ -103,14 +105,15 @@
      *      elementFormDefault=XmlNsForm.UNQUALIFIED
      *      ...
      *    )
    + * {@code
      *
    - *    <!-- XML Schema fragment -->
    - *    <schema
    + *    
    + *    
      *
    - * 
    + * } * @author Sekhar Vajjhala, Sun Microsystems, Inc. * @since 1.6, JAXB 2.0 diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlSchemaType.java --- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlSchemaType.java Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlSchemaType.java Fri Apr 10 14:54:20 2015 +0300 @@ -65,14 +65,15 @@ * @XmlSchemaType(name="date") * public XMLGregorianCalendar date; * } + * {@code * - * <!-- Example: Local XML Schema element --> - * <xs:complexType name="USPrice"/> - * <xs:sequence> - * <xs:element name="date" type="xs:date"/> - * </sequence> - * </xs:complexType> - * + * + * + * + * + * + * + * } * *

    Example 2: Customize mapping of XMLGregorianCalendar at package * level

    diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlTransient.java --- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlTransient.java Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlTransient.java Fri Apr 10 14:54:20 2015 +0300 @@ -78,14 +78,15 @@ * String setName() {..}; * } * + * {@code * - * <!-- Example: XML Schema fragment --> - * <xs:complexType name="USAddress"> - * <xs:sequence> - * <xs:element name="name" type="xs:string"/> - * </xs:sequence> - * </xs:complexType> - * + * + * + * + * + * + * + * } * * @author Sekhar Vajjhala, Sun Microsystems, Inc. * @since 1.6, JAXB 2.0 diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlType.java --- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlType.java Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlType.java Fri Apr 10 14:54:20 2015 +0300 @@ -112,7 +112,7 @@ * The following table shows the mapping of the class to a XML Schema * complex type or simple type. The notational symbols used in the table are: *
      - *
    • -> : represents a mapping
    • + *
    • {@literal ->} : represents a mapping
    • *
    • [x]+ : one or more occurances of x
    • *
    • [ @XmlValue property ]: JavaBean property annotated with * @XmlValue
    • @@ -132,7 +132,7 @@ * * Class * {} - * [property]+ -> elements + * [property]+ {@literal ->} elements * complexcontent
      xs:all * * @@ -140,7 +140,7 @@ * * Class * non empty - * [property]+ -> elements + * [property]+ {@literal ->} elements * complexcontent
      xs:sequence * * @@ -148,7 +148,7 @@ * * Class * X - * no property -> element + * no property {@literal ->} element * complexcontent
      empty sequence * * @@ -156,7 +156,7 @@ * * Class * X - * 1 [@XmlValue property] {@literal &&}
      [property]+ -> attributes + * 1 [@XmlValue property] {@literal &&}
      [property]+ {@literal ->} attributes * simplecontent * * @@ -164,7 +164,7 @@ * * Class * X - * 1 [@XmlValue property] {@literal &&}
      no properties -> attribute + * 1 [@XmlValue property] {@literal &&}
      no properties {@literal ->} attribute * * simpletype * @@ -208,35 +208,37 @@ * java.math.BigDecimal getZip() {..}; * void setZip(java.math.BigDecimal) {..}; * } + * {@code * - * <!-- XML Schema mapping for USAddress --> - * <xs:complexType name="USAddress"> - * <xs:sequence> - * <xs:element name="street" type="xs:string"/> - * <xs:element name="city" type="xs:string"/> - * <xs:element name="state" type="xs:string"/> - * <xs:element name="zip" type="xs:decimal"/> - * <xs:element name="name" type="xs:string"/> - * </xs:all> - * </xs:complexType> - * + * + * + * + * + * + * + * + * + * + * + * } *

      Example 2: Map a class to a complex type with * xs:all

      *
        * @XmlType(propOrder={})
        * public class USAddress { ...}
      + * {@code
        *
      - * <!-- XML Schema mapping for USAddress -->
      - * <xs:complexType name="USAddress">
      - *   <xs:all>
      - *     <xs:element name="name" type="xs:string"/>
      - *     <xs:element name="street" type="xs:string"/>
      - *     <xs:element name="city" type="xs:string"/>
      - *     <xs:element name="state" type="xs:string"/>
      - *     <xs:element name="zip" type="xs:decimal"/>
      - *   </xs:sequence>
      - * </xs:complexType>
      - *
      + * + * + * + * + * + * + * + * + * + * + *} *

      Example 3: Map a class to a global element with an * anonymous type. *

      @@ -244,20 +246,21 @@ * @XmlRootElement * @XmlType(name="") * public class USAddress { ...} + * {@code * - * <!-- XML Schema mapping for USAddress --> - * <xs:element name="USAddress"> - * <xs:complexType> - * <xs:sequence> - * <xs:element name="name" type="xs:string"/> - * <xs:element name="street" type="xs:string"/> - * <xs:element name="city" type="xs:string"/> - * <xs:element name="state" type="xs:string"/> - * <xs:element name="zip" type="xs:decimal"/> - * </xs:sequence> - * </xs:complexType> - * </xs:element> - * + * + * + * + * + * + * + * + * + * + * + * + * + * } * *

      Example 4: Map a property to a local element with * anonymous type. @@ -271,22 +274,23 @@ * @XmlType(name="") * public class USAddress { ... } * } + * {@code * - * <!-- XML Schema mapping for USAddress --> - * <xs:complexType name="Invoice"> - * <xs:sequence> - * <xs:element name="addr"> - * <xs:complexType> - * <xs:element name="name", type="xs:string"/> - * <xs:element name="city", type="xs:string"/> - * <xs:element name="city" type="xs:string"/> - * <xs:element name="state" type="xs:string"/> - * <xs:element name="zip" type="xs:decimal"/> - * </xs:complexType> + * + * + * + * + * + * + * + * + * + * + * * ... - * </xs:sequence> - * </xs:complexType> - * + * + * + * } * *

      Example 5: Map a property to an attribute with * anonymous type. @@ -306,19 +310,20 @@ * @XmlValue * public java.math.BigDecimal price; * } + * {@code * - * <!-- Example: XML Schema fragment --> - * <xs:complexType name="Item"> - * <xs:sequence> - * <xs:element name="name" type="xs:string"/> - * <xs:attribute name="price"> - * <xs:simpleType> - * <xs:restriction base="xs:decimal"/> - * </xs:simpleType> - * </xs:attribute> - * </xs:sequence> - * </xs:complexType> - * + * + * + * + * + * + * + * + * + * + * + * + * } * *

      Example 6: Define a factoryClass and factoryMethod * diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlValue.java --- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlValue.java Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlValue.java Fri Apr 10 14:54:20 2015 +0300 @@ -87,13 +87,14 @@ * @XmlValue * public java.math.BigDecimal price; * } + * {@code * - * <!-- Example 1: XML Schema fragment --> - * <xs:simpleType name="USPrice"> - * <xs:restriction base="xs:decimal"/> - * </xs:simpleType> + * + * + * + * * - * + * } * *

      Example 2: Map a class to XML Schema complexType with * with simpleContent.

      @@ -108,17 +109,18 @@ * @XmlAttribute * public String currency; * } + * {@code * - * <!-- Example 2: XML Schema fragment --> - * <xs:complexType name="InternationalPrice"> - * <xs:simpleContent> - * <xs:extension base="xs:decimal"> - * <xs:attribute name="currency" type="xs:string"/> - * </xs:extension> - * </xs:simpleContent> - * </xs:complexType> + * + * + * + * + * + * + * + * * - * + * } * * @author Sekhar Vajjhala, Sun Microsystems, Inc. * @see XmlType diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/adapters/CollapsedStringAdapter.java --- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/adapters/CollapsedStringAdapter.java Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/adapters/CollapsedStringAdapter.java Fri Apr 10 14:54:20 2015 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, 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,7 @@ * *

      * This adapter removes leading and trailing whitespaces, then truncate any - * sequnce of tab, CR, LF, and SP by a single whitespace character ' '. + * sequence of tab, CR, LF, and SP by a single whitespace character ' '. * * @author Kohsuke Kawaguchi * @since 1.6, JAXB 2.0 @@ -41,7 +41,7 @@ /** * Removes leading and trailing whitespaces of the string * given as the parameter, then truncate any - * sequnce of tab, CR, LF, and SP by a single whitespace character ' '. + * sequence of tab, CR, LF, and SP by a single whitespace character ' '. */ public String unmarshal(String text) { if(text==null) return null; // be defensive diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/adapters/XmlAdapter.java --- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/adapters/XmlAdapter.java Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/adapters/XmlAdapter.java Fri Apr 10 14:54:20 2015 +0300 @@ -75,35 +75,35 @@ * *

      Step 1: Determine the desired XML representation for HashMap. * - *

      - *     <hashmap>
      - *         <entry key="id123">this is a value</entry>
      - *         <entry key="id312">this is another value</entry>
      + * 
      {@code
      + *     
      + *         this is a value
      + *         this is another value
        *         ...
      - *       </hashmap>
      - * 
      + * + * }
      * *

      Step 2: Determine the schema definition that the * desired XML representation shown above should follow. * - *

      + * 
      {@code
        *
      - *     <xs:complexType name="myHashMapType">
      - *       <xs:sequence>
      - *         <xs:element name="entry" type="myHashMapEntryType"
      - *                        minOccurs = "0" maxOccurs="unbounded"/>
      - *       </xs:sequence>
      - *     </xs:complexType>
      + *     
      + *       
      + *         
      + *       
      + *     
        *
      - *     <xs:complexType name="myHashMapEntryType">
      - *       <xs:simpleContent>
      - *         <xs:extension base="xs:string">
      - *           <xs:attribute name="key" type="xs:int"/>
      - *         </xs:extension>
      - *       </xs:simpleContent>
      - *     </xs:complexType>
      + *     
      + *       
      + *         
      + *           
      + *         
      + *       
      + *     
        *
      - * 
      + * }
      * *

      Step 3: Write value types that can generate the above * schema definition. @@ -125,11 +125,11 @@ *

      Step 4: Write the adapter that adapts the value type, * MyHashMapType to a bound type, HashMap, used by the application. * - *

      + * 
      {@code
        *     public final class MyHashMapAdapter extends
      - *                        XmlAdapter<MyHashMapType,HashMap> { ... }
      + *                        XmlAdapter { ... }
        *
      - * 
      + * }
      * *

      Step 5: Use the adapter. * @@ -143,13 +143,13 @@ * * The above code fragment will map to the following schema: * - *

      - *     <xs:complexType name="Foo">
      - *       <xs:sequence>
      - *         <xs:element name="hashmap" type="myHashMapType">
      - *       </xs:sequence>
      - *     </xs:complexType>
      - * 
      + *
      {@code
      + *     
      + *       
      + *         
      + *       
      + *     
      + * }
      * * @param * The type that JAXB doesn't know how to handle. An adapter is written diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/adapters/XmlJavaTypeAdapters.java --- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/adapters/XmlJavaTypeAdapters.java Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/adapters/XmlJavaTypeAdapters.java Fri Apr 10 14:54:20 2015 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, 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 @@ -42,7 +42,7 @@ * @XmlJavaTypeAdapters ({ @XmlJavaTypeAdapter(...),@XmlJavaTypeAdapter(...) }) * * - *

      The @XmlJavaTypeAdapters annnotation is useful for + *

      The @XmlJavaTypeAdapters annotation is useful for * defining {@link XmlJavaTypeAdapter} annotations for different types * at the package level. * diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/addressing/EPRHeader.java --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/addressing/EPRHeader.java Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/addressing/EPRHeader.java Fri Apr 10 14:54:20 2015 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2015, 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 @@ -119,7 +119,7 @@ epr.writeTo(localName, w); w.flush(); ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray()); - DocumentBuilderFactory fac = DocumentBuilderFactory.newInstance(); + DocumentBuilderFactory fac = XmlUtil.newDocumentBuilderFactory(false); fac.setNamespaceAware(true); Node eprNode = fac.newDocumentBuilder().parse(bais).getDocumentElement(); Node eprNodeToAdd = header.getOwnerDocument().importNode(eprNode, true); diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/message/stream/StreamHeader.java --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/message/stream/StreamHeader.java Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/message/stream/StreamHeader.java Fri Apr 10 14:54:20 2015 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2015, 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 @@ -194,7 +194,7 @@ // TODO what about in-scope namespaces // Not very efficient consider implementing a stream buffer // processor that produces a DOM node from the buffer. - TransformerFactory tf = XmlUtil.newTransformerFactory(); + TransformerFactory tf = XmlUtil.newTransformerFactory(true); Transformer t = tf.newTransformer(); XMLStreamBufferSource source = new XMLStreamBufferSource(_mark); DOMResult result = new DOMResult(); diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/spi/db/BindingHelper.java --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/spi/db/BindingHelper.java Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/spi/db/BindingHelper.java Fri Apr 10 14:54:20 2015 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2015, 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,9 @@ //TODO DOMHeader DOMMessage SAAJMessage StatefulInstanceResolver import com.sun.xml.internal.bind.unmarshaller.DOMScanner; +//TODO MtomCodec +import com.sun.xml.internal.bind.v2.runtime.output.Encoded; + //TODO ExceptionBean import com.sun.xml.internal.bind.marshaller.NamespacePrefixMapper; diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/DOMUtil.java --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/DOMUtil.java Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/DOMUtil.java Fri Apr 10 14:54:20 2015 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2015, 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 @@ -56,7 +56,7 @@ synchronized (DOMUtil.class) { if (db == null) { try { - DocumentBuilderFactory dbf = XmlUtil.newDocumentBuilderFactory(); + DocumentBuilderFactory dbf = XmlUtil.newDocumentBuilderFactory(true); dbf.setNamespaceAware(true); db = dbf.newDocumentBuilder(); } catch (ParserConfigurationException e) { diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/pipe/AbstractSchemaValidationTube.java --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/pipe/AbstractSchemaValidationTube.java Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/pipe/AbstractSchemaValidationTube.java Fri Apr 10 14:54:20 2015 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2015, 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 @@ -92,7 +92,7 @@ super(next); this.binding = binding; feature = binding.getFeature(SchemaValidationFeature.class); - sf = allowExternalAccess(SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI), "file", false); + sf = allowExternalAccess(SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI), "all", false); } protected AbstractSchemaValidationTube(AbstractSchemaValidationTube that, TubeCloner cloner) { diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/version.properties --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/version.properties Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/version.properties Fri Apr 10 14:54:20 2015 +0300 @@ -1,5 +1,5 @@ # -# Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2012, 2015, 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,7 +23,7 @@ # questions. # -build-id=2.2.11-b150127.1410 -build-version=JAX-WS RI 2.2.11-b150127.1410 +build-id=2.2.11-b150402.1412 +build-version=JAX-WS RI 2.2.11-b150402.1412 major-version=2.2.11 -svn-revision=28121d09ed8ac02b76788709ccb4cdb66e03bbfa +svn-revision=f923291dedcf386c5f408263984a99d7cedf0012 diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/xml/XMLStreamReaderToXMLStreamWriter.java --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/xml/XMLStreamReaderToXMLStreamWriter.java Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/xml/XMLStreamReaderToXMLStreamWriter.java Fri Apr 10 14:54:20 2015 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2015, 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 @@ -187,14 +187,11 @@ protected void handleStartElement() throws XMLStreamException { String nsUri = in.getNamespaceURI(); - if(nsUri==null) - out.writeStartElement(in.getLocalName()); - else - out.writeStartElement( - fixNull(in.getPrefix()), - in.getLocalName(), - nsUri - ); + out.writeStartElement( + fixNull(in.getPrefix()), + in.getLocalName(), + fixNull(nsUri) + ); // start namespace bindings int nsCount = in.getNamespaceCount(); diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/xml/XmlUtil.java --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/xml/XmlUtil.java Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/xml/XmlUtil.java Fri Apr 10 14:54:20 2015 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2015, 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 @@ -231,7 +231,7 @@ static final ContextClassloaderLocal saxParserFactory = new ContextClassloaderLocal() { @Override protected SAXParserFactory initialValue() throws Exception { - SAXParserFactory factory = SAXParserFactory.newInstance(); + SAXParserFactory factory = newSAXParserFactory(true); factory.setNamespaceAware(true); return factory; } @@ -371,57 +371,49 @@ } }; - public static DocumentBuilderFactory newDocumentBuilderFactory() { - return newDocumentBuilderFactory(true); - } - - public static DocumentBuilderFactory newDocumentBuilderFactory(boolean secureXmlProcessing) { + public static DocumentBuilderFactory newDocumentBuilderFactory(boolean disableSecurity) { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); try { - factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, isXMLSecurityDisabled(secureXmlProcessing)); + factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, !xmlSecurityDisabled(disableSecurity)); } catch (ParserConfigurationException e) { LOGGER.log(Level.WARNING, "Factory [{0}] doesn't support secure xml processing!", new Object[] { factory.getClass().getName() } ); } return factory; } - public static TransformerFactory newTransformerFactory(boolean secureXmlProcessingEnabled) { + public static TransformerFactory newTransformerFactory(boolean disableSecurity) { TransformerFactory factory = TransformerFactory.newInstance(); try { - factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, isXMLSecurityDisabled(secureXmlProcessingEnabled)); + factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, !xmlSecurityDisabled(disableSecurity)); } catch (TransformerConfigurationException e) { LOGGER.log(Level.WARNING, "Factory [{0}] doesn't support secure xml processing!", new Object[]{factory.getClass().getName()}); } return factory; } - public static TransformerFactory newTransformerFactory() { - return newTransformerFactory(true); - } - - public static SAXParserFactory newSAXParserFactory(boolean secureXmlProcessingEnabled) { + public static SAXParserFactory newSAXParserFactory(boolean disableSecurity) { SAXParserFactory factory = SAXParserFactory.newInstance(); try { - factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, isXMLSecurityDisabled(secureXmlProcessingEnabled)); + factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, !xmlSecurityDisabled(disableSecurity)); } catch (Exception e) { LOGGER.log(Level.WARNING, "Factory [{0}] doesn't support secure xml processing!", new Object[]{factory.getClass().getName()}); } return factory; } - public static XPathFactory newXPathFactory(boolean secureXmlProcessingEnabled) { + public static XPathFactory newXPathFactory(boolean disableSecurity) { XPathFactory factory = XPathFactory.newInstance(); try { - factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, isXMLSecurityDisabled(secureXmlProcessingEnabled)); + factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, !xmlSecurityDisabled(disableSecurity)); } catch (XPathFactoryConfigurationException e) { LOGGER.log(Level.WARNING, "Factory [{0}] doesn't support secure xml processing!", new Object[] { factory.getClass().getName() } ); } return factory; } - public static XMLInputFactory newXMLInputFactory(boolean secureXmlProcessingEnabled) { + public static XMLInputFactory newXMLInputFactory(boolean disableSecurity) { XMLInputFactory factory = XMLInputFactory.newInstance(); - if (isXMLSecurityDisabled(secureXmlProcessingEnabled)) { + if (xmlSecurityDisabled(disableSecurity)) { // TODO-Miran: are those apppropriate defaults? factory.setProperty(XMLInputFactory.SUPPORT_DTD, false); factory.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, false); @@ -429,14 +421,14 @@ return factory; } - private static boolean isXMLSecurityDisabled(boolean runtimeDisabled) { + private static boolean xmlSecurityDisabled(boolean runtimeDisabled) { return XML_SECURITY_DISABLED || runtimeDisabled; } - public static SchemaFactory allowExternalAccess(SchemaFactory sf, String value, boolean disableSecureProcessing) { + public static SchemaFactory allowExternalAccess(SchemaFactory sf, String value, boolean disableSecurity) { // if xml security (feature secure processing) disabled, nothing to do, no restrictions applied - if (isXMLSecurityDisabled(disableSecureProcessing)) { + if (xmlSecurityDisabled(disableSecurity)) { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.log(Level.FINE, "Xml Security disabled, no JAXP xsd external access configuration necessary."); } diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle.properties --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle.properties Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle.properties Fri Apr 10 14:54:20 2015 +0300 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2015, 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,10 +30,10 @@ Non-existent directory: {0} VERSION = \ - schemagen 2.2.12-b150126.1924 + schemagen 2.2.12-b150331.1824 FULLVERSION = \ - schemagen full version "2.2.12-b150126.1924" + schemagen full version "2.2.12-b150331.1824" USAGE = \ Usage: schemagen [-options ...] \n\ diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_de.properties --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_de.properties Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_de.properties Fri Apr 10 14:54:20 2015 +0300 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2015, 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,8 +27,8 @@ BASEDIR_DOESNT_EXIST = Nicht vorhandenes Verzeichnis: {0} -VERSION = schemagen 2.2.12-b150126.1924 +VERSION = schemagen 2.2.12-b150331.1824 -FULLVERSION = schemagen vollst\u00E4ndige Version "2.2.12-b150126.1924" +FULLVERSION = schemagen vollst\u00E4ndige Version "2.2.12-b150331.1824" USAGE = Verwendung: schemagen [-options ...] \nOptionen: \n\\ \\ \\ \\ -d : Gibt an, wo die von Prozessor und javac generierten Klassendateien gespeichert werden sollen\n\\ \\ \\ \\ -cp : Gibt an, wo die vom Benutzer angegebenen Dateien gespeichert sind\n\\ \\ \\ \\ -classpath : Gibt an, wo die vom Benutzer angegebenen Dateien gespeichert sind\n\\ \\ \\ \\ -encoding : Gibt die Codierung f\u00FCr die Annotationsverarbeitung/den javac-Aufruf an \n\\ \\ \\ \\ -episode : Generiert Episodendatei f\u00FCr separate Kompilierung\n\\ \\ \\ \\ -version : Zeigt Versionsinformation an\n\\ \\ \\ \\ -fullversion : Zeigt vollst\u00E4ndige Versionsinformationen an\n\\ \\ \\ \\ -help : Zeigt diese Verwendungsmeldung an diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_es.properties --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_es.properties Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_es.properties Fri Apr 10 14:54:20 2015 +0300 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2015, 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,8 +27,8 @@ BASEDIR_DOESNT_EXIST = Directorio no existente: {0} -VERSION = schemagen 2.2.12-b150126.1924 +VERSION = schemagen 2.2.12-b150331.1824 -FULLVERSION = versi\u00F3n completa de schemagen "2.2.12-b150126.1924" +FULLVERSION = versi\u00F3n completa de schemagen "2.2.12-b150331.1824" USAGE = Sintaxis: schemagen [-options ...] \nOpciones: \n\\ \\ \\ \\ -d : especifique d\u00F3nde se colocan los archivos de clase generados por javac y el procesador\n\\ \\ \\ \\ -cp : especifique d\u00F3nde se encuentran los archivos especificados por el usuario\n\\ \\ \\ \\ -encoding : especifique la codificaci\u00F3n que se va a utilizar para el procesamiento de anotaciones/llamada de javac\n\\ \\ \\ \\ -episode : genera un archivo de episodio para una compilaci\u00F3n diferente\n\\ \\ \\ \\ -version : muestra la informaci\u00F3n de la versi\u00F3n\n\\ \\ \\ \\ -fullversion : muestra la informaci\u00F3n completa de la versi\u00F3n\n\\ \\ \\ \\ -help : muestra este mensaje de sintaxis diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_fr.properties --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_fr.properties Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_fr.properties Fri Apr 10 14:54:20 2015 +0300 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2015, 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,8 +27,8 @@ BASEDIR_DOESNT_EXIST = R\u00E9pertoire {0} inexistant -VERSION = schemagen 2.2.12-b150126.1924 +VERSION = schemagen 2.2.12-b150331.1824 -FULLVERSION = version compl\u00E8te de schemagen "2.2.12-b150126.1924" +FULLVERSION = version compl\u00E8te de schemagen "2.2.12-b150331.1824" USAGE = Syntaxe : schemagen [-options ...] \nOptions : \n\ \ \ \ -d : indiquez o\u00F9 placer les fichiers de classe g\u00E9n\u00E9r\u00E9s par le processeur et le compilateur javac\n\ \ \ \ -cp : indiquez o\u00F9 trouver les fichiers sp\u00E9cifi\u00E9s par l'utilisateur\n\ \ \ \ -classpath : indiquez o\u00F9 trouver les fichiers sp\u00E9cifi\u00E9s par l'utilisateur\n\ \ \ \ -encoding : indiquez l'encodage \u00E0 utiliser pour l'appel de javac/traitement de l'annotation \n\ \ \ \ -episode : g\u00E9n\u00E9rez un fichier d'\u00E9pisode pour la compilation s\u00E9par\u00E9e\n\ \ \ \ -version : affichez les informations de version\n\ \ \ \ -fullversion : affichez les informations compl\u00E8tes de version\n\ \ \ \ -help : affichez ce message de syntaxe diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_it.properties --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_it.properties Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_it.properties Fri Apr 10 14:54:20 2015 +0300 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2015, 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,8 +27,8 @@ BASEDIR_DOESNT_EXIST = Directory non esistente: {0} -VERSION = schemagen 2.2.12-b150126.1924 +VERSION = schemagen 2.2.12-b150331.1824 -FULLVERSION = versione completa schemagen "2.2.12-b150126.1924" +FULLVERSION = versione completa schemagen "2.2.12-b150331.1824" USAGE = Uso: schemagen [-options ...] \nOpzioni: \n\ \ \ \ -d : specifica dove posizionare il processore e i file della classe generata javac\n\ \ \ \ -cp : specifica dove trovare i file specificati dall'utente\n\ \ \ \ -classpath : specifica dove trovare i file specificati dall'utente\n\ \ \ \ -encoding : specifica la codifica da usare per l'elaborazione dell'annotazione/richiamo javac \n\ \ \ \ -episode : genera il file di episodio per la compilazione separata\n\ \ \ \ -version : visualizza le informazioni sulla versione\n\ \ \ \ -fullversion : visualizza le informazioni sulla versione completa\n\ \ \ \ -help : visualizza questo messaggio sull'uso diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_ja.properties --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_ja.properties Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_ja.properties Fri Apr 10 14:54:20 2015 +0300 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2015, 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,8 +27,8 @@ BASEDIR_DOESNT_EXIST = \u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304C\u5B58\u5728\u3057\u307E\u305B\u3093: {0} -VERSION = schemagen 2.2.12-b150126.1924 +VERSION = schemagen 2.2.12-b150331.1824 -FULLVERSION = schemagen\u30D5\u30EB\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3"2.2.12-b150126.1924" +FULLVERSION = schemagen\u30D5\u30EB\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3"2.2.12-b150331.1824" USAGE = \u4F7F\u7528\u65B9\u6CD5: schemagen [-options ...] \n\u30AA\u30D7\u30B7\u30E7\u30F3: \n\ \ \ \ -d : \u30D7\u30ED\u30BB\u30C3\u30B5\u304A\u3088\u3073javac\u304C\u751F\u6210\u3057\u305F\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u7F6E\u304F\u4F4D\u7F6E\u3092\u6307\u5B9A\u3057\u307E\u3059\n\ \ \ \ -cp : \u30E6\u30FC\u30B6\u30FC\u304C\u6307\u5B9A\u3057\u305F\u30D5\u30A1\u30A4\u30EB\u3092\u691C\u7D22\u3059\u308B\u4F4D\u7F6E\u3092\u6307\u5B9A\u3057\u307E\u3059\n\ \ \ \ -classpath : \u30E6\u30FC\u30B6\u30FC\u304C\u6307\u5B9A\u3057\u305F\u30D5\u30A1\u30A4\u30EB\u3092\u691C\u7D22\u3059\u308B\u4F4D\u7F6E\u3092\u6307\u5B9A\u3057\u307E\u3059\n\ \ \ \ -encoding : \u6CE8\u91C8\u51E6\u7406/javac\u547C\u51FA\u3057\u306B\u4F7F\u7528\u3059\u308B\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u3092\u6307\u5B9A\u3057\u307E\u3059\n\ \ \ \ -episode : \u30B3\u30F3\u30D1\u30A4\u30EB\u3054\u3068\u306B\u30A8\u30D4\u30BD\u30FC\u30C9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u751F\u6210\u3057\u307E\u3059\n\ \ \ \ -version : \u30D0\u30FC\u30B8\u30E7\u30F3\u60C5\u5831\u3092\u8868\u793A\u3057\u307E\u3059\n\ \ \ \ -fullversion : \u30D5\u30EB\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3\u60C5\u5831\u3092\u8868\u793A\u3057\u307E\u3059\n\ \ \ \ -help : \u3053\u306E\u4F7F\u7528\u4F8B\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u8868\u793A\u3057\u307E\u3059 diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_ko.properties --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_ko.properties Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_ko.properties Fri Apr 10 14:54:20 2015 +0300 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2015, 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,8 +27,8 @@ BASEDIR_DOESNT_EXIST = \uC874\uC7AC\uD558\uC9C0 \uC54A\uB294 \uB514\uB809\uD1A0\uB9AC: {0} -VERSION = schemagen 2.2.12-b150126.1924 +VERSION = schemagen 2.2.12-b150331.1824 -FULLVERSION = schemagen \uC815\uC2DD \uBC84\uC804 "2.2.12-b150126.1924" +FULLVERSION = schemagen \uC815\uC2DD \uBC84\uC804 "2.2.12-b150331.1824" USAGE = \uC0AC\uC6A9\uBC95: schemagen [-options ...] \n\uC635\uC158: \n\ \ \ \ -d : \uD504\uB85C\uC138\uC11C \uBC0F javac\uC5D0\uC11C \uC0DD\uC131\uD55C \uD074\uB798\uC2A4 \uD30C\uC77C\uC744 \uBC30\uCE58\uD560 \uC704\uCE58\uB97C \uC9C0\uC815\uD569\uB2C8\uB2E4.\n\ \ \ \ -cp : \uC0AC\uC6A9\uC790\uAC00 \uC9C0\uC815\uD55C \uD30C\uC77C\uC744 \uCC3E\uC744 \uC704\uCE58\uB97C \uC9C0\uC815\uD569\uB2C8\uB2E4.\n\ \ \ \ -classpath : \uC0AC\uC6A9\uC790\uAC00 \uC9C0\uC815\uD55C \uD30C\uC77C\uC744 \uCC3E\uC744 \uC704\uCE58\uB97C \uC9C0\uC815\uD569\uB2C8\uB2E4.\n\ \ \ \ -encoding : \uC8FC\uC11D \uCC98\uB9AC/javac \uD638\uCD9C\uC5D0 \uC0AC\uC6A9\uD560 \uC778\uCF54\uB529\uC744 \uC9C0\uC815\uD569\uB2C8\uB2E4. \n\ \ \ \ -episode : \uBCC4\uB3C4 \uCEF4\uD30C\uC77C\uC744 \uC704\uD574 episode \uD30C\uC77C\uC744 \uC0DD\uC131\uD569\uB2C8\uB2E4.\n\ \ \ \ -version : \uBC84\uC804 \uC815\uBCF4\uB97C \uD45C\uC2DC\uD569\uB2C8\uB2E4.\n\ \ \ \ -fullversion : \uC815\uC2DD \uBC84\uC804 \uC815\uBCF4\uB97C \uD45C\uC2DC\uD569\uB2C8\uB2E4.\n\ \ \ \ -help : \uC774 \uC0AC\uC6A9\uBC95 \uBA54\uC2DC\uC9C0\uB97C \uD45C\uC2DC\uD569\uB2C8\uB2E4. diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_pt_BR.properties --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_pt_BR.properties Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_pt_BR.properties Fri Apr 10 14:54:20 2015 +0300 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2015, 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,8 +27,8 @@ BASEDIR_DOESNT_EXIST = Diret\u00F3rio n\u00E3o existente: {0} -VERSION = gera\u00E7\u00E3o do esquema 2.2.12-b150126.1924 +VERSION = gera\u00E7\u00E3o do esquema 2.2.12-b150331.1824 -FULLVERSION = vers\u00E3o completa da gera\u00E7\u00E3o do esquema "2.2.12-b150126.1924" +FULLVERSION = vers\u00E3o completa da gera\u00E7\u00E3o do esquema "2.2.12-b150331.1824" USAGE = Uso: gera\u00E7\u00E3o do esquema [-options ...] \nOp\u00E7\u00F5es: \n\\ \\ \\ \\ -d : especificar onde colocar o processador e os arquivos da classe gerados por javac\n\\ \\ \\ \\ -cp : especificar onde localizar arquivos especificados pelo usu\u00E1rio\n\\ \\ \\ \\ -classpath : especificar onde localizar os arquivos especificados pelo usu\u00E1rio\n\\ \\ \\ \\ -encoding : especificar codifica\u00E7\u00E3o a ser usada para processamento de anota\u00E7\u00E3o/chamada javac \n\\ \\ \\ \\ -episode : gerar arquivo do epis\u00F3dio para compila\u00E7\u00E3o separada\n\\ \\ \\ \\ -version : exibir informa\u00E7\u00F5es da vers\u00E3o\n\\ \\ \\ \\ -fullversion : exibir informa\u00E7\u00F5es da vers\u00E3o completa\n\\ \\ \\ \\ -help : exibir esta mensagem de uso diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_zh_CN.properties --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_zh_CN.properties Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_zh_CN.properties Fri Apr 10 14:54:20 2015 +0300 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2015, 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,8 +27,8 @@ BASEDIR_DOESNT_EXIST = \u4E0D\u5B58\u5728\u7684\u76EE\u5F55: {0} -VERSION = schemagen 2.2.12-b150126.1924 +VERSION = schemagen 2.2.12-b150331.1824 -FULLVERSION = schemagen \u5B8C\u6574\u7248\u672C "2.2.12-b150126.1924" +FULLVERSION = schemagen \u5B8C\u6574\u7248\u672C "2.2.12-b150331.1824" USAGE = \u7528\u6CD5: schemagen [-options ...] \n\u9009\u9879: \n\ \ \ \ -d : \u6307\u5B9A\u653E\u7F6E\u5904\u7406\u7A0B\u5E8F\u548C javac \u751F\u6210\u7684\u7C7B\u6587\u4EF6\u7684\u4F4D\u7F6E\n\ \ \ \ -cp : \u6307\u5B9A\u67E5\u627E\u7528\u6237\u6307\u5B9A\u6587\u4EF6\u7684\u4F4D\u7F6E\n\ \ \ \ -classpath : \u6307\u5B9A\u67E5\u627E\u7528\u6237\u6307\u5B9A\u6587\u4EF6\u7684\u4F4D\u7F6E\n\ \ \ \ -encoding : \u6307\u5B9A\u7528\u4E8E\u6CE8\u91CA\u5904\u7406/javac \u8C03\u7528\u7684\u7F16\u7801\n\ \ \ \ -episode : \u751F\u6210\u7247\u6BB5\u6587\u4EF6\u4EE5\u4F9B\u5355\u72EC\u7F16\u8BD1\n\ \ \ \ -version : \u663E\u793A\u7248\u672C\u4FE1\u606F\n\ \ \ \ -fullversion : \u663E\u793A\u5B8C\u6574\u7684\u7248\u672C\u4FE1\u606F\n\ \ \ \ -help : \u663E\u793A\u6B64\u7528\u6CD5\u6D88\u606F diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_zh_TW.properties --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_zh_TW.properties Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_zh_TW.properties Fri Apr 10 14:54:20 2015 +0300 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2015, 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,8 +27,8 @@ BASEDIR_DOESNT_EXIST = \u4E0D\u5B58\u5728\u7684\u76EE\u9304: {0} -VERSION = schemagen 2.2.12-b150126.1924 +VERSION = schemagen 2.2.12-b150331.1824 -FULLVERSION = schemagen \u5B8C\u6574\u7248\u672C "2.2.12-b150126.1924" +FULLVERSION = schemagen \u5B8C\u6574\u7248\u672C "2.2.12-b150331.1824" USAGE = \u7528\u6CD5: schemagen [-options ...] \n\u9078\u9805: \n\\ \\ \\ \\ -d : \u6307\u5B9A\u8655\u7406\u5668\u4EE5\u53CA javac \u7522\u751F\u7684\u985E\u5225\u6A94\u6848\u653E\u7F6E\u4F4D\u7F6E\n\\ \\ \\ \\ -cp : \u6307\u5B9A\u8981\u5C0B\u627E\u4F7F\u7528\u8005\u6307\u5B9A\u6A94\u6848\u7684\u4F4D\u7F6E\n\\ \\ \\ \\ -classpath : \u6307\u5B9A\u8981\u5C0B\u627E\u4F7F\u7528\u8005\u6307\u5B9A\u6A94\u6848\u7684\u4F4D\u7F6E\n\\ \\ \\ \\ -encoding : \u6307\u5B9A\u8981\u7528\u65BC\u8A3B\u89E3\u8655\u7406/javac \u547C\u53EB\u7684\u7DE8\u78BC \n\\ \\ \\ \\ -episode : \u7522\u751F\u7368\u7ACB\u7DE8\u8B6F\u7684\u4E8B\u4EF6 (episode) \u6A94\u6848\n\\ \\ \\ \\ -version : \u986F\u793A\u7248\u672C\u8CC7\u8A0A\n\\ \\ \\ \\ -fullversion : \u986F\u793A\u5B8C\u6574\u7248\u672C\u8CC7\u8A0A\n\\ \\ \\ \\ -help : \u986F\u793A\u6B64\u7528\u6CD5\u8A0A\u606F diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/SchemaGenerator.java --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/SchemaGenerator.java Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/SchemaGenerator.java Fri Apr 10 14:54:20 2015 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2015, 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 @@ -158,7 +158,12 @@ while (cl != null) { if (cl instanceof URLClassLoader) { for (URL url : ((URLClassLoader) cl).getURLs()) { - appendPath(cp, url.getPath()); + try { + appendPath(cp,new File(url.toURI()).getPath()); + } catch(URISyntaxException ex) { + /*If the URL is not properly formated - skip it*/ + LOGGER.log(Level.SEVERE, ex.getMessage(), ex); + } } } cl = cl.getParent(); diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/ap/SchemaGenerator.java --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/ap/SchemaGenerator.java Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/ap/SchemaGenerator.java Fri Apr 10 14:54:20 2015 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2015, 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,6 @@ * questions. */ - - package com.sun.tools.internal.jxc.ap; import com.sun.tools.internal.jxc.api.JXC; @@ -89,12 +87,12 @@ public boolean process(Set annotations, RoundEnvironment roundEnv) { final ErrorReceiverImpl errorListener = new ErrorReceiverImpl(processingEnv); - List classes = new ArrayList(); + List classesToBeBound = new ArrayList(); // simply ignore all the interface definitions, // so that users won't have to manually exclude interfaces, which is silly. - filterClass(classes, roundEnv.getRootElements()); + filterClass(classesToBeBound, roundEnv.getRootElements()); - J2SJAXBModel model = JXC.createJavaCompiler().bind(classes, Collections.emptyMap(), null, processingEnv); + J2SJAXBModel model = JXC.createJavaCompiler().bind(classesToBeBound, Collections.emptyMap(), null, processingEnv); if (model == null) return false; // error @@ -133,11 +131,17 @@ return false; } - private void filterClass(List classes, Collection elements) { + /** + * Filter classes (note that enum is kind of class) from elements tree + * @param result list of found classes + * @param elements tree to be filtered + */ + private void filterClass(List result, Collection elements) { for (Element element : elements) { - if (element.getKind().equals(ElementKind.CLASS) || element.getKind().equals(ElementKind.ENUM)) { - classes.add(new Reference((TypeElement) element, processingEnv)); - filterClass(classes, ElementFilter.typesIn(element.getEnclosedElements())); + final ElementKind kind = element.getKind(); + if (ElementKind.CLASS.equals(kind) || ElementKind.ENUM.equals(kind)) { + result.add(new Reference((TypeElement) element, processingEnv)); + filterClass(result, ElementFilter.typesIn(element.getEnclosedElements())); } } } diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/model/nav/ApNavigator.java --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/model/nav/ApNavigator.java Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/model/nav/ApNavigator.java Fri Apr 10 14:54:20 2015 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2015, 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,12 @@ import com.sun.source.util.Trees; import com.sun.xml.internal.bind.v2.model.nav.Navigator; import com.sun.xml.internal.bind.v2.runtime.Location; - +import java.lang.annotation.Annotation; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; import javax.annotation.processing.ProcessingEnvironment; import javax.lang.model.element.AnnotationMirror; import javax.lang.model.element.Element; @@ -52,12 +57,6 @@ import javax.lang.model.util.Elements; import javax.lang.model.util.SimpleTypeVisitor6; import javax.lang.model.util.Types; -import java.lang.annotation.Annotation; -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; /** * {@link Navigator} implementation for annotation processing. @@ -241,7 +240,7 @@ public VariableElement[] getEnumConstants(TypeElement clazz) { List elements = env.getElementUtils().getAllMembers(clazz); - Collection constants = new HashSet(); + Collection constants = new ArrayList(); for (Element element : elements) { if (element.getKind().equals(ElementKind.ENUM_CONSTANT)) { constants.add((VariableElement) element); diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle.properties --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle.properties Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle.properties Fri Apr 10 14:54:20 2015 +0300 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2015, 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 @@ -171,20 +171,20 @@ Driver.FailedToGenerateCode = \ Failed to produce code. -# DO NOT localize the 2.2.12-b150126.1924 string - it is a token for an mvn +# DO NOT localize the 2.2.12-b150331.1824 string - it is a token for an mvn Driver.FilePrologComment = \ - This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.12-b150126.1924 \n\ + This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.12-b150331.1824 \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.12-b150126.1924 + xjc 2.2.12-b150331.1824 Driver.FullVersion = \ - xjc full version "2.2.12-b150126.1924" + xjc full version "2.2.12-b150331.1824" -Driver.BuildID = 2.2.12-b150126.1924 +Driver.BuildID = 2.2.12-b150331.1824 # for JDK integration - include version in source zip jaxb.jdk.version=@@JAXB_JDK_VERSION@@ diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_de.properties --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_de.properties Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_de.properties Fri Apr 10 14:54:20 2015 +0300 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2015, 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 @@ -96,14 +96,14 @@ Driver.FailedToGenerateCode = Code konnte nicht erzeugt werden. -# DO NOT localize the 2.2.12-b150126.1924 string - it is a token for an mvn -Driver.FilePrologComment = Diese Datei wurde mit der JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.12-b150126.1924 generiert \nSiehe http://java.sun.com/xml/jaxb \n\u00c4nderungen an dieser Datei gehen bei einer Neukompilierung des Quellschemas verloren. \nGeneriert: {0} \n +# DO NOT localize the 2.2.12-b150331.1824 string - it is a token for an mvn +Driver.FilePrologComment = Diese Datei wurde mit der JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.12-b150331.1824 generiert \nSiehe http://java.sun.com/xml/jaxb \n\u00c4nderungen an dieser Datei gehen bei einer Neukompilierung des Quellschemas verloren. \nGeneriert: {0} \n -Driver.Version = xjc 2.2.12-b150126.1924 +Driver.Version = xjc 2.2.12-b150331.1824 -Driver.FullVersion = xjc vollst\u00E4ndige Version "2.2.12-b150126.1924" +Driver.FullVersion = xjc vollst\u00E4ndige Version "2.2.12-b150331.1824" -Driver.BuildID = 2.2.12-b150126.1924 +Driver.BuildID = 2.2.12-b150331.1824 # for JDK integration - include version in source zip jaxb.jdk.version=@@JAXB_JDK_VERSION@@ diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_es.properties --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_es.properties Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_es.properties Fri Apr 10 14:54:20 2015 +0300 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2015, 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 @@ -96,14 +96,14 @@ Driver.FailedToGenerateCode = Fallo al producir c\u00f3digo. -# DO NOT localize the 2.2.12-b150126.1924 string - it is a token for an mvn -Driver.FilePrologComment = Este archivo ha sido generado por la arquitectura JavaTM para la implantaci\u00f3n de la referencia de enlace (JAXB) XML v2.2.12-b150126.1924 \nVisite http://java.sun.com/xml/jaxb \nTodas las modificaciones realizadas en este archivo se perder\u00e1n si se vuelve a compilar el esquema de origen. \nGenerado el: {0} \n +# DO NOT localize the 2.2.12-b150331.1824 string - it is a token for an mvn +Driver.FilePrologComment = Este archivo ha sido generado por la arquitectura JavaTM para la implantaci\u00f3n de la referencia de enlace (JAXB) XML v2.2.12-b150331.1824 \nVisite http://java.sun.com/xml/jaxb \nTodas las modificaciones realizadas en este archivo se perder\u00e1n si se vuelve a compilar el esquema de origen. \nGenerado el: {0} \n -Driver.Version = xjc 2.2.12-b150126.1924 +Driver.Version = xjc 2.2.12-b150331.1824 -Driver.FullVersion = versi\u00F3n completa de xjc "2.2.12-b150126.1924" +Driver.FullVersion = versi\u00F3n completa de xjc "2.2.12-b150331.1824" -Driver.BuildID = 2.2.12-b150126.1924 +Driver.BuildID = 2.2.12-b150331.1824 # for JDK integration - include version in source zip jaxb.jdk.version=@@JAXB_JDK_VERSION@@ diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_fr.properties --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_fr.properties Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_fr.properties Fri Apr 10 14:54:20 2015 +0300 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2015, 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 @@ -96,14 +96,14 @@ Driver.FailedToGenerateCode = Echec de la production du code. -# DO NOT localize the 2.2.12-b150126.1924 string - it is a token for an mvn -Driver.FilePrologComment = Ce fichier a \u00e9t\u00e9 g\u00e9n\u00e9r\u00e9 par l''impl\u00e9mentation de r\u00e9f\u00e9rence JavaTM Architecture for XML Binding (JAXB), v2.2.12-b150126.1924 \nVoir http://java.sun.com/xml/jaxb \nToute modification apport\u00e9e \u00e0 ce fichier sera perdue lors de la recompilation du sch\u00e9ma source. \nG\u00e9n\u00e9r\u00e9 le : {0} \n +# DO NOT localize the 2.2.12-b150331.1824 string - it is a token for an mvn +Driver.FilePrologComment = Ce fichier a \u00e9t\u00e9 g\u00e9n\u00e9r\u00e9 par l''impl\u00e9mentation de r\u00e9f\u00e9rence JavaTM Architecture for XML Binding (JAXB), v2.2.12-b150331.1824 \nVoir http://java.sun.com/xml/jaxb \nToute modification apport\u00e9e \u00e0 ce fichier sera perdue lors de la recompilation du sch\u00e9ma source. \nG\u00e9n\u00e9r\u00e9 le : {0} \n -Driver.Version = xjc 2.2.12-b150126.1924 +Driver.Version = xjc 2.2.12-b150331.1824 -Driver.FullVersion = version compl\u00E8te xjc "2.2.12-b150126.1924" +Driver.FullVersion = version compl\u00E8te xjc "2.2.12-b150331.1824" -Driver.BuildID = 2.2.12-b150126.1924 +Driver.BuildID = 2.2.12-b150331.1824 # for JDK integration - include version in source zip jaxb.jdk.version=@@JAXB_JDK_VERSION@@ diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_it.properties --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_it.properties Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_it.properties Fri Apr 10 14:54:20 2015 +0300 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2015, 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 @@ -96,14 +96,14 @@ Driver.FailedToGenerateCode = Produzione del codice non riuscita. -# DO NOT localize the 2.2.12-b150126.1924 string - it is a token for an mvn -Driver.FilePrologComment = Questo file \u00e8 stato generato dall''architettura JavaTM per XML Binding (JAXB) Reference Implementation, v2.2.12-b150126.1924 \nVedere http://java.sun.com/xml/jaxb \nQualsiasi modifica a questo file andr\u00e0 persa durante la ricompilazione dello schema di origine. \nGenerato il: {0} \n +# DO NOT localize the 2.2.12-b150331.1824 string - it is a token for an mvn +Driver.FilePrologComment = Questo file \u00e8 stato generato dall''architettura JavaTM per XML Binding (JAXB) Reference Implementation, v2.2.12-b150331.1824 \nVedere http://java.sun.com/xml/jaxb \nQualsiasi modifica a questo file andr\u00e0 persa durante la ricompilazione dello schema di origine. \nGenerato il: {0} \n -Driver.Version = xjc 2.2.12-b150126.1924 +Driver.Version = xjc 2.2.12-b150331.1824 -Driver.FullVersion = versione completa xjc "2.2.12-b150126.1924" +Driver.FullVersion = versione completa xjc "2.2.12-b150331.1824" -Driver.BuildID = 2.2.12-b150126.1924 +Driver.BuildID = 2.2.12-b150331.1824 # for JDK integration - include version in source zip jaxb.jdk.version=@@JAXB_JDK_VERSION@@ diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_ja.properties --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_ja.properties Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_ja.properties Fri Apr 10 14:54:20 2015 +0300 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2015, 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 @@ -96,14 +96,14 @@ Driver.FailedToGenerateCode = \u30b3\u30fc\u30c9\u306e\u751f\u6210\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002 -# DO NOT localize the 2.2.12-b150126.1924 string - it is a token for an mvn -Driver.FilePrologComment = \u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306f\u3001JavaTM Architecture for XML Binding(JAXB) Reference Implementation\u3001v2.2.12-b150126.1924\u306b\u3088\u3063\u3066\u751f\u6210\u3055\u308c\u307e\u3057\u305f \nhttp://java.sun.com/xml/jaxb\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044 \n\u30bd\u30fc\u30b9\u30fb\u30b9\u30ad\u30fc\u30de\u306e\u518d\u30b3\u30f3\u30d1\u30a4\u30eb\u6642\u306b\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306e\u5909\u66f4\u306f\u5931\u308f\u308c\u307e\u3059\u3002 \n\u751f\u6210\u65e5: {0} \n +# DO NOT localize the 2.2.12-b150331.1824 string - it is a token for an mvn +Driver.FilePrologComment = \u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306f\u3001JavaTM Architecture for XML Binding(JAXB) Reference Implementation\u3001v2.2.12-b150331.1824\u306b\u3088\u3063\u3066\u751f\u6210\u3055\u308c\u307e\u3057\u305f \nhttp://java.sun.com/xml/jaxb\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044 \n\u30bd\u30fc\u30b9\u30fb\u30b9\u30ad\u30fc\u30de\u306e\u518d\u30b3\u30f3\u30d1\u30a4\u30eb\u6642\u306b\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306e\u5909\u66f4\u306f\u5931\u308f\u308c\u307e\u3059\u3002 \n\u751f\u6210\u65e5: {0} \n -Driver.Version = xjc 2.2.12-b150126.1924 +Driver.Version = xjc 2.2.12-b150331.1824 -Driver.FullVersion = xjc\u30D5\u30EB\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3"2.2.12-b150126.1924" +Driver.FullVersion = xjc\u30D5\u30EB\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3"2.2.12-b150331.1824" -Driver.BuildID = 2.2.12-b150126.1924 +Driver.BuildID = 2.2.12-b150331.1824 # for JDK integration - include version in source zip jaxb.jdk.version=@@JAXB_JDK_VERSION@@ diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_ko.properties --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_ko.properties Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_ko.properties Fri Apr 10 14:54:20 2015 +0300 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2015, 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 @@ -96,14 +96,14 @@ Driver.FailedToGenerateCode = \ucf54\ub4dc \uc0dd\uc131\uc744 \uc2e4\ud328\ud588\uc2b5\ub2c8\ub2e4. -# DO NOT localize the 2.2.12-b150126.1924 string - it is a token for an mvn -Driver.FilePrologComment = \uc774 \ud30c\uc77c\uc740 JAXB(JavaTM Architecture for XML Binding) \ucc38\uc870 \uad6c\ud604 2.2.12-b150126.1924 \ubc84\uc804\uc744 \ud1b5\ud574 \uc0dd\uc131\ub418\uc5c8\uc2b5\ub2c8\ub2e4. \nhttp://java.sun.com/xml/jaxb\ub97c \ucc38\uc870\ud558\uc2ed\uc2dc\uc624. \n\uc774 \ud30c\uc77c\uc744 \uc218\uc815\ud558\uba74 \uc18c\uc2a4 \uc2a4\ud0a4\ub9c8\ub97c \uc7ac\ucef4\ud30c\uc77c\ud560 \ub54c \uc218\uc815 \uc0ac\ud56d\uc774 \uc190\uc2e4\ub429\ub2c8\ub2e4. \n\uc0dd\uc131 \ub0a0\uc9dc: {0} \n +# DO NOT localize the 2.2.12-b150331.1824 string - it is a token for an mvn +Driver.FilePrologComment = \uc774 \ud30c\uc77c\uc740 JAXB(JavaTM Architecture for XML Binding) \ucc38\uc870 \uad6c\ud604 2.2.12-b150331.1824 \ubc84\uc804\uc744 \ud1b5\ud574 \uc0dd\uc131\ub418\uc5c8\uc2b5\ub2c8\ub2e4. \nhttp://java.sun.com/xml/jaxb\ub97c \ucc38\uc870\ud558\uc2ed\uc2dc\uc624. \n\uc774 \ud30c\uc77c\uc744 \uc218\uc815\ud558\uba74 \uc18c\uc2a4 \uc2a4\ud0a4\ub9c8\ub97c \uc7ac\ucef4\ud30c\uc77c\ud560 \ub54c \uc218\uc815 \uc0ac\ud56d\uc774 \uc190\uc2e4\ub429\ub2c8\ub2e4. \n\uc0dd\uc131 \ub0a0\uc9dc: {0} \n -Driver.Version = XJC 2.2.12-b150126.1924 +Driver.Version = XJC 2.2.12-b150331.1824 -Driver.FullVersion = XJC \uC815\uC2DD \uBC84\uC804 "2.2.12-b150126.1924" +Driver.FullVersion = XJC \uC815\uC2DD \uBC84\uC804 "2.2.12-b150331.1824" -Driver.BuildID = 2.2.12-b150126.1924 +Driver.BuildID = 2.2.12-b150331.1824 # for JDK integration - include version in source zip jaxb.jdk.version=@@JAXB_JDK_VERSION@@ diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_pt_BR.properties --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_pt_BR.properties Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_pt_BR.properties Fri Apr 10 14:54:20 2015 +0300 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2015, 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 @@ -96,14 +96,14 @@ Driver.FailedToGenerateCode = Falha ao produzir o c\u00f3digo. -# DO NOT localize the 2.2.12-b150126.1924 string - it is a token for an mvn -Driver.FilePrologComment = Este arquivo foi gerado pela Arquitetura JavaTM para Implementa\u00e7\u00e3o de Refer\u00eancia (JAXB) de Bind XML, v2.2.12-b150126.1924 \nConsulte http://java.sun.com/xml/jaxb \nTodas as modifica\u00e7\u00f5es neste arquivo ser\u00e3o perdidas ap\u00f3s a recompila\u00e7\u00e3o do esquema de origem. \nGerado em: {0} \n +# DO NOT localize the 2.2.12-b150331.1824 string - it is a token for an mvn +Driver.FilePrologComment = Este arquivo foi gerado pela Arquitetura JavaTM para Implementa\u00e7\u00e3o de Refer\u00eancia (JAXB) de Bind XML, v2.2.12-b150331.1824 \nConsulte http://java.sun.com/xml/jaxb \nTodas as modifica\u00e7\u00f5es neste arquivo ser\u00e3o perdidas ap\u00f3s a recompila\u00e7\u00e3o do esquema de origem. \nGerado em: {0} \n -Driver.Version = xjc 2.2.12-b150126.1924 +Driver.Version = xjc 2.2.12-b150331.1824 -Driver.FullVersion = vers\u00E3o completa de xjc "2.2.12-b150126.1924" +Driver.FullVersion = vers\u00E3o completa de xjc "2.2.12-b150331.1824" -Driver.BuildID = 2.2.12-b150126.1924 +Driver.BuildID = 2.2.12-b150331.1824 # for JDK integration - include version in source zip jaxb.jdk.version=@@JAXB_JDK_VERSION@@ diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_zh_CN.properties --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_zh_CN.properties Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_zh_CN.properties Fri Apr 10 14:54:20 2015 +0300 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2015, 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 @@ -96,14 +96,14 @@ Driver.FailedToGenerateCode = \u65e0\u6cd5\u751f\u6210\u4ee3\u7801\u3002 -# DO NOT localize the 2.2.12-b150126.1924 string - it is a token for an mvn -Driver.FilePrologComment = \u6b64\u6587\u4ef6\u662f\u7531 JavaTM Architecture for XML Binding (JAXB) \u5f15\u7528\u5b9e\u73b0 v2.2.12-b150126.1924 \u751f\u6210\u7684\n\u8bf7\u8bbf\u95ee http://java.sun.com/xml/jaxb \n\u5728\u91cd\u65b0\u7f16\u8bd1\u6e90\u6a21\u5f0f\u65f6, \u5bf9\u6b64\u6587\u4ef6\u7684\u6240\u6709\u4fee\u6539\u90fd\u5c06\u4e22\u5931\u3002\n\u751f\u6210\u65f6\u95f4: {0} \n +# DO NOT localize the 2.2.12-b150331.1824 string - it is a token for an mvn +Driver.FilePrologComment = \u6b64\u6587\u4ef6\u662f\u7531 JavaTM Architecture for XML Binding (JAXB) \u5f15\u7528\u5b9e\u73b0 v2.2.12-b150331.1824 \u751f\u6210\u7684\n\u8bf7\u8bbf\u95ee http://java.sun.com/xml/jaxb \n\u5728\u91cd\u65b0\u7f16\u8bd1\u6e90\u6a21\u5f0f\u65f6, \u5bf9\u6b64\u6587\u4ef6\u7684\u6240\u6709\u4fee\u6539\u90fd\u5c06\u4e22\u5931\u3002\n\u751f\u6210\u65f6\u95f4: {0} \n -Driver.Version = xjc 2.2.12-b150126.1924 +Driver.Version = xjc 2.2.12-b150331.1824 -Driver.FullVersion = xjc \u5B8C\u6574\u7248\u672C "2.2.12-b150126.1924" +Driver.FullVersion = xjc \u5B8C\u6574\u7248\u672C "2.2.12-b150331.1824" -Driver.BuildID = 2.2.12-b150126.1924 +Driver.BuildID = 2.2.12-b150331.1824 # for JDK integration - include version in source zip jaxb.jdk.version=@@JAXB_JDK_VERSION@@ diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_zh_TW.properties --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_zh_TW.properties Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_zh_TW.properties Fri Apr 10 14:54:20 2015 +0300 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2015, 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 @@ -96,14 +96,14 @@ Driver.FailedToGenerateCode = \u7121\u6cd5\u7522\u751f\u7a0b\u5f0f\u78bc. -# DO NOT localize the 2.2.12-b150126.1924 string - it is a token for an mvn -Driver.FilePrologComment = \u6b64\u6a94\u6848\u662f\u7531 JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.12-b150126.1924 \u6240\u7522\u751f \n\u8acb\u53c3\u95b1 http://java.sun.com/xml/jaxb \n\u4e00\u65e6\u91cd\u65b0\u7de8\u8b6f\u4f86\u6e90\u7db1\u8981, \u5c0d\u6b64\u6a94\u6848\u6240\u505a\u7684\u4efb\u4f55\u4fee\u6539\u90fd\u5c07\u6703\u907a\u5931. \n\u7522\u751f\u6642\u9593: {0} \n +# DO NOT localize the 2.2.12-b150331.1824 string - it is a token for an mvn +Driver.FilePrologComment = \u6b64\u6a94\u6848\u662f\u7531 JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.12-b150331.1824 \u6240\u7522\u751f \n\u8acb\u53c3\u95b1 http://java.sun.com/xml/jaxb \n\u4e00\u65e6\u91cd\u65b0\u7de8\u8b6f\u4f86\u6e90\u7db1\u8981, \u5c0d\u6b64\u6a94\u6848\u6240\u505a\u7684\u4efb\u4f55\u4fee\u6539\u90fd\u5c07\u6703\u907a\u5931. \n\u7522\u751f\u6642\u9593: {0} \n -Driver.Version = xjc 2.2.12-b150126.1924 +Driver.Version = xjc 2.2.12-b150331.1824 -Driver.FullVersion = xjc \u5B8C\u6574\u7248\u672C "2.2.12-b150126.1924" +Driver.FullVersion = xjc \u5B8C\u6574\u7248\u672C "2.2.12-b150331.1824" -Driver.BuildID = 2.2.12-b150126.1924 +Driver.BuildID = 2.2.12-b150331.1824 # for JDK integration - include version in source zip jaxb.jdk.version=@@JAXB_JDK_VERSION@@ diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/addon/code_injector/PluginImpl.java --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/addon/code_injector/PluginImpl.java Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/addon/code_injector/PluginImpl.java Fri Apr 10 14:54:20 2015 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2015, 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,13 +25,15 @@ package com.sun.tools.internal.xjc.addon.code_injector; +import java.util.Collection; import java.util.Collections; import java.util.List; +import com.sun.istack.internal.NotNull; import com.sun.tools.internal.xjc.Options; import com.sun.tools.internal.xjc.Plugin; import com.sun.tools.internal.xjc.model.CPluginCustomization; -import com.sun.tools.internal.xjc.outline.ClassOutline; +import com.sun.tools.internal.xjc.outline.CustomizableOutline; import com.sun.tools.internal.xjc.outline.Outline; import com.sun.tools.internal.xjc.util.DOMUtils; @@ -54,7 +56,7 @@ } public boolean isCustomizationTagName(String nsUri, String localName) { - return nsUri.equals(Const.NS) && localName.equals("code"); + return Const.NS.equals(nsUri) && "code".equals(localName); } public String getUsage() { @@ -62,9 +64,15 @@ } // meat of the processing - public boolean run(Outline model, Options opt, ErrorHandler errorHandler) { - for( ClassOutline co : model.getClasses() ) { - CPluginCustomization c = co.target.getCustomizations().find(Const.NS,"code"); + public boolean run(@NotNull Outline model, Options opt, ErrorHandler errorHandler) { + checkAndInject(model.getClasses()); + checkAndInject(model.getEnums()); + return true; + } + + private static void checkAndInject(Collection outlines) { + for (CustomizableOutline co : outlines) { + CPluginCustomization c = co.getTarget().getCustomizations().find(Const.NS, "code"); if(c==null) continue; // no customization --- nothing to inject here @@ -74,9 +82,7 @@ String codeFragment = DOMUtils.getElementText(c.element); // inject the specified code fragment into the implementation class. - co.implClass.direct(codeFragment); + co.getImplClass().direct(codeFragment); } - - return true; } } diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/outline/ClassOutline.java --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/outline/ClassOutline.java Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/outline/ClassOutline.java Fri Apr 10 14:54:20 2015 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2015, 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 @@ -33,6 +33,7 @@ import com.sun.codemodel.internal.JClass; import com.sun.codemodel.internal.JDefinedClass; import com.sun.tools.internal.xjc.model.CClassInfo; +import com.sun.tools.internal.xjc.model.CCustomizable; import com.sun.tools.internal.xjc.model.CPropertyInfo; import com.sun.istack.internal.NotNull; @@ -44,7 +45,7 @@ * * @author Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com) */ -public abstract class ClassOutline { +public abstract class ClassOutline implements CustomizableOutline { /** * A {@link Outline} that encloses all the class outlines. @@ -122,4 +123,14 @@ if(s==null) return null; return parent().getClazz(s); } + + @Override + public JDefinedClass getImplClass() { + return implClass; + } + + @Override + public CCustomizable getTarget() { + return target; + } } diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/outline/CustomizableOutline.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/outline/CustomizableOutline.java Fri Apr 10 14:54:20 2015 +0300 @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package com.sun.tools.internal.xjc.outline; + +import com.sun.codemodel.internal.JDefinedClass; +import com.sun.istack.internal.NotNull; +import com.sun.tools.internal.xjc.model.CCustomizable; + +/** + * This interface describes that outline class could be customized. + * It provides the bound info from {@link CCustomizable} target. And + * customization output - implementation class. + * + * @author yaroska + * @since 2.2.12 + */ +public interface CustomizableOutline { + + /** + * Provides bound information about customizable target. + * @return customizable target + */ + @NotNull CCustomizable getTarget(); + + /** + * Provides customization output. + * @return Implementation class + */ + @NotNull JDefinedClass getImplClass(); +} diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/outline/ElementOutline.java --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/outline/ElementOutline.java Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/outline/ElementOutline.java Fri Apr 10 14:54:20 2015 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2015, 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,6 +26,7 @@ package com.sun.tools.internal.xjc.outline; import com.sun.codemodel.internal.JDefinedClass; +import com.sun.tools.internal.xjc.model.CCustomizable; import com.sun.tools.internal.xjc.model.CElementInfo; /** @@ -39,7 +40,7 @@ * * @author Kohsuke Kawaguchi */ -public abstract class ElementOutline { +public abstract class ElementOutline implements CustomizableOutline { /** * A {@link Outline} that encloses all the class outlines. @@ -69,4 +70,14 @@ this.target = target; this.implClass = implClass; } + + @Override + public CCustomizable getTarget() { + return target; + } + + @Override + public JDefinedClass getImplClass() { + return implClass; + } } diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/outline/EnumOutline.java --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/outline/EnumOutline.java Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/outline/EnumOutline.java Fri Apr 10 14:54:20 2015 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2015, 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 java.util.List; import com.sun.codemodel.internal.JDefinedClass; +import com.sun.tools.internal.xjc.model.CCustomizable; import com.sun.tools.internal.xjc.model.CEnumLeafInfo; import com.sun.istack.internal.NotNull; @@ -40,7 +41,7 @@ * * @author Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com) */ -public abstract class EnumOutline { +public abstract class EnumOutline implements CustomizableOutline { /** * This {@link EnumOutline} holds information about this {@link CEnumLeafInfo}. @@ -74,4 +75,14 @@ this.target = target; this.clazz = clazz; } + + @Override + public JDefinedClass getImplClass() { + return clazz; + } + + @Override + public CCustomizable getTarget() { + return target; + } } diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/version.properties --- a/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/version.properties Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/version.properties Fri Apr 10 14:54:20 2015 +0300 @@ -1,5 +1,5 @@ # -# Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2012, 2015, 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,7 +23,7 @@ # questions. # -build-id=2.2.11-b150127.1410 -build-version=JAX-WS RI 2.2.11-b150127.1410 +build-id=2.2.11-b150402.1412 +build-version=JAX-WS RI 2.2.11-b150402.1412 major-version=2.2.11 -svn-revision=28121d09ed8ac02b76788709ccb4cdb66e03bbfa +svn-revision=f923291dedcf386c5f408263984a99d7cedf0012 diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPConstants.java --- a/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPConstants.java Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/wsdl/document/soap/SOAPConstants.java Fri Apr 10 14:54:20 2015 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2015, 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,8 @@ package com.sun.tools.internal.ws.wsdl.document.soap; +import com.sun.xml.internal.ws.encoding.soap.streaming.SOAPNamespaceConstants; + import javax.xml.namespace.QName; /** @@ -35,9 +37,7 @@ public interface SOAPConstants { // namespace URIs - public static final String URI_ENVELOPE = - "http://schemas.xmlsoap.org/soap/envelope/"; - + public static final String URI_ENVELOPE = SOAPNamespaceConstants.ENVELOPE; public static final String NS_WSDL_SOAP = "http://schemas.xmlsoap.org/wsdl/soap/"; public static final String NS_SOAP_ENCODING = "http://schemas.xmlsoap.org/soap/encoding/"; diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/wsdl/parser/Internalizer.java --- a/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/wsdl/parser/Internalizer.java Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/wsdl/parser/Internalizer.java Fri Apr 10 14:54:20 2015 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2015, 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 @@ -78,7 +78,7 @@ private static final ContextClassloaderLocal xpf = new ContextClassloaderLocal() { @Override protected XPathFactory initialValue() throws Exception { - return XPathFactory.newInstance(); + return XmlUtil.newXPathFactory(true); } }; /** diff -r fe5fd9871a13 -r 6d5d546e953b jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/wsdl/parser/JAXWSBindingExtensionHandler.java --- a/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/wsdl/parser/JAXWSBindingExtensionHandler.java Thu Apr 09 06:40:17 2015 -0700 +++ b/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/wsdl/parser/JAXWSBindingExtensionHandler.java Fri Apr 10 14:54:20 2015 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2015, 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,10 +25,10 @@ package com.sun.tools.internal.ws.wsdl.parser; +import com.sun.tools.internal.ws.util.xml.XmlUtil; import com.sun.tools.internal.ws.api.wsdl.TWSDLExtensible; import com.sun.tools.internal.ws.api.wsdl.TWSDLExtension; import com.sun.tools.internal.ws.api.wsdl.TWSDLParserContext; -import com.sun.tools.internal.ws.util.xml.XmlUtil; import com.sun.tools.internal.ws.wsdl.document.*; import com.sun.tools.internal.ws.wsdl.document.jaxws.CustomName; import com.sun.tools.internal.ws.wsdl.document.jaxws.JAXWSBinding; @@ -57,7 +57,7 @@ private static final ContextClassloaderLocal xpf = new ContextClassloaderLocal() { @Override protected XPathFactory initialValue() throws Exception { - return XPathFactory.newInstance(); + return XmlUtil.newXPathFactory(false); } };