This commit is contained in:
Lana Steuck 2015-11-05 13:43:17 -08:00
commit 78bc0f069b
249 changed files with 1624 additions and 2908 deletions

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -37,7 +37,7 @@ import java.util.logging.Level;
* The class also makes sure that logger names of each Metro subsystem are consistent * The class also makes sure that logger names of each Metro subsystem are consistent
* with each other. * with each other.
* *
* @author Marek Potociar <marek.potociar at sun.com> * @author Marek Potociar
* @author Fabian Ritzmann * @author Fabian Ritzmann
*/ */
public class Logger { public class Logger {
@ -335,7 +335,7 @@ public class Logger {
/** /**
* Method logs {@code exception}'s message as a {@code SEVERE} logging level * Method logs {@code exception}'s message as a {@code SEVERE} logging level
* message. * message.
* <p/> * <p>
* If {@code cause} parameter is not {@code null}, it is logged as well and * If {@code cause} parameter is not {@code null}, it is logged as well and
* {@code exception} original cause is initialized with instance referenced * {@code exception} original cause is initialized with instance referenced
* by {@code cause} parameter. * by {@code cause} parameter.
@ -363,7 +363,7 @@ public class Logger {
/** /**
* Method logs {@code exception}'s message as a {@code SEVERE} logging level * Method logs {@code exception}'s message as a {@code SEVERE} logging level
* message. * message.
* <p/> * <p>
* If {@code logCause} parameter is {@code true}, {@code exception}'s original * If {@code logCause} parameter is {@code true}, {@code exception}'s original
* cause is logged as well (if exists). This may be used in cases when * cause is logged as well (if exists). This may be used in cases when
* {@code exception}'s class provides constructor to initialize the original * {@code exception}'s class provides constructor to initialize the original
@ -408,7 +408,7 @@ public class Logger {
/** /**
* Method logs {@code exception}'s message at the logging level specified by the * Method logs {@code exception}'s message at the logging level specified by the
* {@code level} argument. * {@code level} argument.
* <p/> * <p>
* If {@code cause} parameter is not {@code null}, it is logged as well and * If {@code cause} parameter is not {@code null}, it is logged as well and
* {@code exception} original cause is initialized with instance referenced * {@code exception} original cause is initialized with instance referenced
* by {@code cause} parameter. * by {@code cause} parameter.
@ -437,7 +437,7 @@ public class Logger {
/** /**
* Method logs {@code exception}'s message at the logging level specified by the * Method logs {@code exception}'s message at the logging level specified by the
* {@code level} argument. * {@code level} argument.
* <p/> * <p>
* If {@code logCause} parameter is {@code true}, {@code exception}'s original * If {@code logCause} parameter is {@code true}, {@code exception}'s original
* cause is logged as well (if exists). This may be used in cases when * cause is logged as well (if exists). This may be used in cases when
* {@code exception}'s class provides constructor to initialize the original * {@code exception}'s class provides constructor to initialize the original

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -48,8 +48,6 @@ public class AccessorFactoryImpl implements InternalAccessorFactory {
* @param field the field within the class to be accessed. * @param field the field within the class to be accessed.
* @param readOnly the isStatic value of the field's modifier. * @param readOnly the isStatic value of the field's modifier.
* @return Accessor the accessor for this field * @return Accessor the accessor for this field
*
* @throws JAXBException reports failures of the method.
*/ */
public Accessor createFieldAccessor(Class bean, Field field, boolean readOnly) { public Accessor createFieldAccessor(Class bean, Field field, boolean readOnly) {
return readOnly return readOnly
@ -65,8 +63,6 @@ public class AccessorFactoryImpl implements InternalAccessorFactory {
* @param readOnly the isStatic value of the field's modifier. * @param readOnly the isStatic value of the field's modifier.
* @param supressWarning supress security warning about accessing fields through reflection * @param supressWarning supress security warning about accessing fields through reflection
* @return Accessor the accessor for this field * @return Accessor the accessor for this field
*
* @throws JAXBException reports failures of the method.
*/ */
public Accessor createFieldAccessor(Class bean, Field field, boolean readOnly, boolean supressWarning) { public Accessor createFieldAccessor(Class bean, Field field, boolean readOnly, boolean supressWarning) {
return readOnly return readOnly
@ -81,8 +77,6 @@ public class AccessorFactoryImpl implements InternalAccessorFactory {
* @param getter the getter method to be accessed. The value can be null. * @param getter the getter method to be accessed. The value can be null.
* @param setter the setter method to be accessed. The value can be null. * @param setter the setter method to be accessed. The value can be null.
* @return Accessor the accessor for these methods * @return Accessor the accessor for these methods
*
* @throws JAXBException reports failures of the method.
*/ */
public Accessor createPropertyAccessor(Class bean, Method getter, Method setter) { public Accessor createPropertyAccessor(Class bean, Method getter, Method setter) {
if (getter == null) { if (getter == null) {

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -81,7 +81,7 @@ public final class DatatypeConverterImpl implements DatatypeConverterInterface {
} }
/** /**
* Faster but less robust String->int conversion. * Faster but less robust {@code String->int} conversion.
* *
* Note that: * Note that:
* <ol> * <ol>
@ -115,7 +115,7 @@ public final class DatatypeConverterImpl implements DatatypeConverterInterface {
} }
public static long _parseLong(CharSequence s) { public static long _parseLong(CharSequence s) {
return Long.valueOf(removeOptionalPlus(WhiteSpaceProcessor.trim(s)).toString()); return Long.parseLong(removeOptionalPlus(WhiteSpaceProcessor.trim(s)).toString());
} }
public static short _parseShort(CharSequence s) { public static short _parseShort(CharSequence s) {

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -270,12 +270,12 @@ public abstract class JAXBRIContext extends JAXBContext {
* add element declarations to the generate schema. * add element declarations to the generate schema.
* For example, if the JAX-RPC passes in the following entry: * For example, if the JAX-RPC passes in the following entry:
* *
* {foo}bar -> DeclaredType for java.lang.String * {@code {foo}bar -> DeclaredType for java.lang.String}
* *
* then JAXB generates the following element declaration (in the schema * then JAXB generates the following element declaration (in the schema
* document for the namespace "foo")" * document for the namespace "foo")"
* *
* &lt;xs:element name="bar" type="xs:string" /> * {@code <xs:element name="bar" type="xs:string" />}
* *
* This can be used for generating schema components necessary for WSDL. * This can be used for generating schema components necessary for WSDL.
* *
@ -436,7 +436,7 @@ public abstract class JAXBRIContext extends JAXBContext {
* to put additional JAXB type references into the {@link JAXBContext}. * to put additional JAXB type references into the {@link JAXBContext}.
* *
* <p> * <p>
* The value of the property is {@link Collection}&lt;{@link TypeReference}>. * The value of the property is {@link Collection}{@code <}{@link TypeReference}{@code >}.
* Those {@link TypeReference}s can then be used to create {@link Bridge}s. * Those {@link TypeReference}s can then be used to create {@link Bridge}s.
* *
* <p> * <p>
@ -453,7 +453,6 @@ public abstract class JAXBRIContext extends JAXBContext {
* to enable the c14n marshalling support in the {@link JAXBContext}. * to enable the c14n marshalling support in the {@link JAXBContext}.
* *
* Boolean * Boolean
* @see C14nSupport_ArchitectureDocument
* @since 2.0 EA2 * @since 2.0 EA2
*/ */
public static final String CANONICALIZATION_SUPPORT = "com.sun.xml.internal.bind.c14n"; public static final String CANONICALIZATION_SUPPORT = "com.sun.xml.internal.bind.c14n";

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -78,15 +78,15 @@ import org.xml.sax.SAXException;
* *
* <p>This code will produce the following document:</p> * <p>This code will produce the following document:</p>
* *
* <pre> * <pre>{@code
* &lt;?xml version="1.0" standalone="yes"?> * <?xml version="1.0" standalone="yes"?>
* *
* &lt;Person> * <Person>
* &lt;name>Jane Smith&lt;/name> * <name>Jane Smith</name>
* &lt;date-of-birth>1965-05-23&lt;/date-of-birth> * <date-of-birth>1965-05-23</date-of-birth>
* &lt;citizenship>US&lt;/citizenship> * <citizenship>US</citizenship>
* &lt;/Person> * </Person>
* </pre> * }</pre>
* *
* <p>This class inherits from {@link XMLWriter}, * <p>This class inherits from {@link XMLWriter},
* and provides all of the same support for Namespaces.</p> * and provides all of the same support for Namespaces.</p>

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -44,7 +44,7 @@ import org.w3c.dom.Node;
// - don't remove any existing method. // - don't remove any existing method.
/** /**
* Implemented by the user application to determine URI -> prefix * Implemented by the user application to determine URI {@code ->} prefix
* mapping. * mapping.
* *
* This is considered as an interface, though it's implemented * This is considered as an interface, though it's implemented

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -91,11 +91,11 @@ import org.xml.sax.helpers.XMLFilterImpl;
* *
* <p>The resulting document will look like this:</p> * <p>The resulting document will look like this:</p>
* *
* <pre> * <pre>{@code
* &lt;?xml version="1.0" standalone="yes"?> * <?xml version="1.0" standalone="yes"?>
* *
* &lt;greeting>Hello, world!&lt;/greeting> * <greeting>Hello, world!</greeting>
* </pre> * }</pre>
* *
* <p>In fact, there is an even simpler convenience method, * <p>In fact, there is an even simpler convenience method,
* <var>dataElement</var>, designed for writing elements that * <var>dataElement</var>, designed for writing elements that
@ -125,9 +125,9 @@ import org.xml.sax.helpers.XMLFilterImpl;
* *
* <p>you will end up with</p> * <p>you will end up with</p>
* *
* <pre> * <pre>{@code
* &lt;item>1&lt;/item>&lt;item>3&lt;/item>&lt;item>3&lt;/item> * <item>1</item><item>3</item><item>3</item>
* </pre> * }</pre>
* *
* <p>You need to invoke one of the <var>characters</var> methods * <p>You need to invoke one of the <var>characters</var> methods
* explicitly to add newlines or indentation. Alternatively, you * explicitly to add newlines or indentation. Alternatively, you
@ -154,11 +154,11 @@ import org.xml.sax.helpers.XMLFilterImpl;
* *
* <p>The resulting document will look like this:</p> * <p>The resulting document will look like this:</p>
* *
* <pre> * <pre>{@code
* &lt;?xml version="1.0" standalone="yes"?> * <?xml version="1.0" standalone="yes"?>
* *
* &lt;_NS1:foo xmlns:_NS1="http://www.foo.com/ns/"/> * <_NS1:foo xmlns:_NS1="http://www.foo.com/ns/"/>
* </pre> * }</pre>
* *
* <p>In many cases, document authors will prefer to choose their * <p>In many cases, document authors will prefer to choose their
* own prefixes rather than using the (ugly) default names. The * own prefixes rather than using the (ugly) default names. The
@ -175,11 +175,11 @@ import org.xml.sax.helpers.XMLFilterImpl;
* *
* <p>The resulting document will look like this:</p> * <p>The resulting document will look like this:</p>
* *
* <pre> * <pre>{@code
* &lt;?xml version="1.0" standalone="yes"?> * <?xml version="1.0" standalone="yes"?>
* *
* &lt;foo:foo xmlns:foo="http://www.foo.com/ns/"/> * <foo:foo xmlns:foo="http://www.foo.com/ns/"/>
* </pre> * }</pre>
* *
* <p>The default Namespace simply uses an empty string as the prefix:</p> * <p>The default Namespace simply uses an empty string as the prefix:</p>
* *
@ -192,28 +192,28 @@ import org.xml.sax.helpers.XMLFilterImpl;
* *
* <p>The resulting document will look like this:</p> * <p>The resulting document will look like this:</p>
* *
* <pre> * <pre>{@code
* &lt;?xml version="1.0" standalone="yes"?> * <?xml version="1.0" standalone="yes"?>
* *
* &lt;foo xmlns="http://www.foo.com/ns/"/> * <foo xmlns="http://www.foo.com/ns/"/>
* </pre> * }</pre>
* *
* <p>By default, the XML writer will not declare a Namespace until * <p>By default, the XML writer will not declare a Namespace until
* it is actually used. Sometimes, this approach will create * it is actually used. Sometimes, this approach will create
* a large number of Namespace declarations, as in the following * a large number of Namespace declarations, as in the following
* example:</p> * example:</p>
* *
* <pre> * <pre>{@code
* &lt;xml version="1.0" standalone="yes"?> * <xml version="1.0" standalone="yes"?>
* *
* &lt;rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> * <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
* &lt;rdf:Description about="http://www.foo.com/ids/books/12345"> * <rdf:Description about="http://www.foo.com/ids/books/12345">
* &lt;dc:title xmlns:dc="http://www.purl.org/dc/">A Dark Night&lt;/dc:title> * <dc:title xmlns:dc="http://www.purl.org/dc/">A Dark Night</dc:title>
* &lt;dc:creator xmlns:dc="http://www.purl.org/dc/">Jane Smith&lt;/dc:title> * <dc:creator xmlns:dc="http://www.purl.org/dc/">Jane Smith</dc:title>
* &lt;dc:date xmlns:dc="http://www.purl.org/dc/">2000-09-09&lt;/dc:title> * <dc:date xmlns:dc="http://www.purl.org/dc/">2000-09-09</dc:title>
* &lt;/rdf:Description> * </rdf:Description>
* &lt;/rdf:RDF> * </rdf:RDF>
* </pre> * }</pre>
* *
* <p>The "rdf" prefix is declared only once, because the RDF Namespace * <p>The "rdf" prefix is declared only once, because the RDF Namespace
* is used by the root element and can be inherited by all of its * is used by the root element and can be inherited by all of its
@ -230,18 +230,18 @@ import org.xml.sax.helpers.XMLFilterImpl;
* though it's not needed there, and can be inherited by its * though it's not needed there, and can be inherited by its
* descendants:</p> * descendants:</p>
* *
* <pre> * <pre>{@code
* &lt;xml version="1.0" standalone="yes"?> * <xml version="1.0" standalone="yes"?>
* *
* &lt;rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" * <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
* xmlns:dc="http://www.purl.org/dc/"> * xmlns:dc="http://www.purl.org/dc/">
* &lt;rdf:Description about="http://www.foo.com/ids/books/12345"> * <rdf:Description about="http://www.foo.com/ids/books/12345">
* &lt;dc:title>A Dark Night&lt;/dc:title> * <dc:title>A Dark Night</dc:title>
* &lt;dc:creator>Jane Smith&lt;/dc:title> * <dc:creator>Jane Smith</dc:title>
* &lt;dc:date>2000-09-09&lt;/dc:title> * <dc:date>2000-09-09</dc:title>
* &lt;/rdf:Description> * </rdf:Description>
* &lt;/rdf:RDF> * </rdf:RDF>
* </pre> * }</pre>
* *
* <p>This approach is also useful for declaring Namespace prefixes * <p>This approach is also useful for declaring Namespace prefixes
* that be used by qualified names appearing in attribute values or * that be used by qualified names appearing in attribute values or
@ -372,7 +372,7 @@ public class XMLWriter extends XMLFilterImpl
/** /**
* Set whether the writer should print out the XML declaration * Set whether the writer should print out the XML declaration
* (&lt;?xml version='1.0' ... ?>). * ({@code <?xml version='1.0' ... ?>}).
* <p> * <p>
* This option is set to true by default. * This option is set to true by default.
*/ */

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -87,25 +87,16 @@ public final class ClassFactory {
if(consRef!=null) if(consRef!=null)
cons = consRef.get(); cons = consRef.get();
if(cons==null) { if(cons==null) {
cons = AccessController.doPrivileged(new PrivilegedAction<Constructor<T>>() { if (System.getSecurityManager() == null) {
@Override cons = tryGetDeclaredConstructor(clazz);
public Constructor<T> run() { } else {
try { cons = AccessController.doPrivileged(new PrivilegedAction<Constructor<T>>() {
return clazz.getDeclaredConstructor(emptyClass); @Override
} catch (NoSuchMethodException e) { public Constructor<T> run() {
logger.log(Level.INFO,"No default constructor found on "+clazz,e); return tryGetDeclaredConstructor(clazz);
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(); int classMod = clazz.getModifiers();
@ -126,6 +117,23 @@ public final class ClassFactory {
return cons.newInstance(emptyObject); return cons.newInstance(emptyObject);
} }
private static <T> Constructor<T> tryGetDeclaredConstructor(Class<T> clazz) {
try {
return clazz.getDeclaredConstructor((Class<T>[])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;
}
}
/** /**
* The same as {@link #create0} but with an error handling to make * The same as {@link #create0} but with an error handling to make
* the instantiation error fatal. * the instantiation error fatal.

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -174,7 +174,7 @@ public class ContextFactory {
* @param retainPropertyInfo * @param retainPropertyInfo
* @return * @return
* @throws JAXBException * @throws JAXBException
* @deprecated use createContext(Class[] classes, Map<String,Object> properties) method instead * @deprecated use {@code createContext(Class[] classes, Map<String,Object> properties)} method instead
*/ */
@Deprecated @Deprecated
public static JAXBRIContext createContext( Class[] classes, public static JAXBRIContext createContext( Class[] classes,
@ -201,7 +201,7 @@ public class ContextFactory {
* @param improvedXsiTypeHandling * @param improvedXsiTypeHandling
* @return * @return
* @throws JAXBException * @throws JAXBException
* @deprecated use createContext( Class[] classes, Map<String,Object> properties) method instead * @deprecated use {@code createContext( Class[] classes, Map<String,Object> properties)} method instead
*/ */
@Deprecated @Deprecated
public static JAXBRIContext createContext( Class[] classes, public static JAXBRIContext createContext( Class[] classes,

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -38,24 +38,18 @@ public abstract class WellKnownNamespace {
/** /**
* @deprecated Use javax.xml.XMLConstants.W3C_XML_SCHEMA_NS_URI instead; * @deprecated Use javax.xml.XMLConstants.W3C_XML_SCHEMA_NS_URI instead;
* @return
* @throws CloneNotSupportedException
*/ */
@Deprecated() @Deprecated()
public static final String XML_SCHEMA = XMLConstants.W3C_XML_SCHEMA_NS_URI; public static final String XML_SCHEMA = XMLConstants.W3C_XML_SCHEMA_NS_URI;
/** /**
* @deprecated Use javax.xml.XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI instead * @deprecated Use javax.xml.XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI instead
* @return
* @throws CloneNotSupportedException
*/ */
@Deprecated() @Deprecated()
public static final String XML_SCHEMA_INSTANCE = XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI; public static final String XML_SCHEMA_INSTANCE = XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI;
/** /**
* @deprecated Use javax.xml.XMLConstants.XML_NS_URI instead; * @deprecated Use javax.xml.XMLConstants.XML_NS_URI instead;
* @return
* @throws CloneNotSupportedException
*/ */
@Deprecated() @Deprecated()
public static final String XML_NAMESPACE_URI = XMLConstants.XML_NS_URI; public static final String XML_NAMESPACE_URI = XMLConstants.XML_NS_URI;

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -72,7 +72,7 @@ public interface ElementInfo<T,C> extends Element<T,C> {
T getContentInMemoryType(); T getContentInMemoryType();
/** /**
* Returns the representation for {@link JAXBElement}&lt;<i>contentInMemoryType</i>&gt;. * Returns the representation for {@link JAXBElement}<i>{@code <contentInMemoryType>}</i>.
* *
* <p> * <p>
* This returns the signature in Java and thus isn't affected by the adapter. * This returns the signature in Java and thus isn't affected by the adapter.
@ -80,7 +80,7 @@ public interface ElementInfo<T,C> extends Element<T,C> {
T getType(); T getType();
/** /**
* @inheritDoc * {@inheritDoc}
* *
* {@link ElementInfo} can only substitute {@link ElementInfo}. * {@link ElementInfo} can only substitute {@link ElementInfo}.
*/ */

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -51,14 +51,14 @@ public interface ElementPropertyInfo<T,C> extends PropertyInfo<T,C> {
* However, in a general case an element property can be heterogeneous, * However, in a general case an element property can be heterogeneous,
* meaning you can put different types in it, each with a different tag name * meaning you can put different types in it, each with a different tag name
* (and a few other settings.) * (and a few other settings.)
* <pre> * <pre><code>
* // list can contain String or Integer. * // list can contain String or Integer.
* &#64;XmlElements({ * {@literal @}XmlElements({
* &#64;XmlElement(name="a",type=String.class), * {@literal @}XmlElement(name="a",type=String.class),
* &#64;XmlElement(name="b",type=Integer.class), * {@literal @}XmlElement(name="b",type=Integer.class),
* }) {@code * })
* List<Object> abc; * {@literal List<Object>} abc;
* }</pre> * </code></pre>
* <p> * <p>
* In this case this method returns a list of two {@link TypeRef}s. * In this case this method returns a list of two {@link TypeRef}s.
* *

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -33,7 +33,8 @@ import javax.xml.bind.annotation.XmlRegistry;
* Represents the information in a class with {@link XmlRegistry} annotaion. * Represents the information in a class with {@link XmlRegistry} annotaion.
* *
* <p> * <p>
* This interface is only meant to be used as a return type from {@link com.sun.xml.internal.bind.v2.model.impl.ModelBuilder}. * This interface is only meant to be used as a return type from
* {@link com.sun.xml.internal.bind.v2.model.impl.ModelBuilder}.
* *
* @author Kohsuke Kawaguchi * @author Kohsuke Kawaguchi
*/ */

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -36,25 +36,25 @@
* The meaning of parameterizations are as follows: * The meaning of parameterizations are as follows:
* *
* <dl> * <dl>
* <dt><b>T</b> * <dt><b>T</b></dt>
* <dd>Represents an use of type, such as {@code int}, {@code Foo[]}, or {@code List<Foo>}. * <dd>Represents an use of type, such as {@code int}, {@code Foo[]}, or {@code List<Foo>}.
* Corresponds to {@link Type}. * Corresponds to {@link java.lang.reflect.Type}.</dd>
* *
* <dt><b>C</b> * <dt><b>C</b></dt>
* <dd>Represents a declaration of a type (that is, class, interface, enum, or annotation.) * <dd>Represents a declaration of a type (that is, class, interface, enum, or annotation.)
* This doesn't include {@code int}, {@code Foo[]}, or {@code List<Foo>}, because * This doesn't include {@code int}, {@code Foo[]}, or {@code List<Foo>}, because
* they don't have corresponding declarations. * they don't have corresponding declarations.
* Corresponds to {@link Class} (roughly). * Corresponds to {@link java.lang.Class} (roughly).</dd>
* *
* <dt><b>F</b> * <dt><b>F</b></dt>
* <dd>Represents a field. * <dd>Represents a field.
* Corresponds to {@link Field}. * Corresponds to {@link java.lang.reflect.Field}.</dd>
* *
* <dt><b>M</b> * <dt><b>M</b></dt>
* <dd>Represents a method. * <dd>Represents a method.
* Corresponds to {@link Method}. * Corresponds to {@link java.lang.reflect.Method}.</dd>
* *
* <dt> * </dl>
*/ */
@XmlSchema(namespace="http://jaxb.dev.java.net/xjc/model",elementFormDefault=QUALIFIED) @XmlSchema(namespace="http://jaxb.dev.java.net/xjc/model",elementFormDefault=QUALIFIED)
package com.sun.xml.internal.bind.v2.model.core; package com.sun.xml.internal.bind.v2.model.core;

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -419,7 +419,7 @@ public class ClassInfoImpl<T,C,F,M> extends TypeInfoImpl<T,C,F,M>
} }
/** /**
* This hook is used by {@link RuntimeClassInfoImpl} to look for {@link XmlLocation}. * This hook is used by {@link RuntimeClassInfoImpl} to look for {@link com.sun.xml.internal.bind.annotation.XmlLocation}.
*/ */
protected void checkFieldXmlLocation(F f) { protected void checkFieldXmlLocation(F f) {
} }
@ -1245,7 +1245,7 @@ public class ClassInfoImpl<T,C,F,M> extends TypeInfoImpl<T,C,F,M>
} }
/** /**
* Called after all the {@link TypeInfo}s are collected into the {@link #owner}. * Called after all the {@link com.sun.xml.internal.bind.v2.model.core.TypeInfo}s are collected into the {@link #owner}.
*/ */
@Override @Override
/*package*/ void link() { /*package*/ void link() {

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -25,6 +25,8 @@
package com.sun.xml.internal.bind.v2.model.impl; package com.sun.xml.internal.bind.v2.model.impl;
import com.sun.xml.internal.bind.v2.model.core.PropertyInfo;
/** /**
* {@link PropertyInfo} that allows to add additional elements to the collection. * {@link PropertyInfo} that allows to add additional elements to the collection.
* *

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -33,6 +33,7 @@ import java.util.Map;
import javax.xml.namespace.QName; import javax.xml.namespace.QName;
import com.sun.xml.internal.bind.v2.model.core.ClassInfo; import com.sun.xml.internal.bind.v2.model.core.ClassInfo;
import com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl;
import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor; import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor;
import com.sun.xml.internal.bind.annotation.XmlLocation; import com.sun.xml.internal.bind.annotation.XmlLocation;
@ -58,7 +59,7 @@ public interface RuntimeClassInfo extends ClassInfo<Type,Class>, RuntimeNonEleme
* unoptimized accessor. * unoptimized accessor.
* non-null iff {@link #hasAttributeWildcard()}==true. * non-null iff {@link #hasAttributeWildcard()}==true.
* *
* @see Accessor#optimize() * @see Accessor#optimize(JAXBContextImpl)
*/ */
<BeanT> Accessor<BeanT,Map<QName,String>> getAttributeWildcard(); <BeanT> Accessor<BeanT,Map<QName,String>> getAttributeWildcard();

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -29,6 +29,7 @@ import java.lang.reflect.Type;
import java.util.Collection; import java.util.Collection;
import com.sun.xml.internal.bind.v2.model.core.PropertyInfo; import com.sun.xml.internal.bind.v2.model.core.PropertyInfo;
import com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl;
import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor; import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor;
/** /**
@ -58,7 +59,7 @@ public interface RuntimePropertyInfo extends PropertyInfo<Type,Class> {
* @return * @return
* never null. * never null.
* *
* @see Accessor#optimize() * @see Accessor#optimize(JAXBContextImpl)
*/ */
Accessor getAccessor(); Accessor getAccessor();

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -28,7 +28,7 @@
* *
* <h1>Overview</h1> * <h1>Overview</h1>
* <p> * <p>
* This module provides code that implements {@link JAXBContext}. * This module provides code that implements {@link javax.xml.bind.JAXBContext}.
* Roughly speaking the runtime works like this: * Roughly speaking the runtime works like this:
* *
* <ol> * <ol>
@ -37,7 +37,7 @@
* <li>There's a set of classes that constitute the unmarshaller and marshaller. * <li>There's a set of classes that constitute the unmarshaller and marshaller.
* Each class represents a small portion, and they are composed to perform * Each class represents a small portion, and they are composed to perform
* the operations. * the operations.
* <li>{@link JAXBContextImpl} builds itself by reading the model and * <li>{@link com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl} builds itself by reading the model and
* composing unmarshallers and marshallers. * composing unmarshallers and marshallers.
* </ol> * </ol>
* *
@ -68,7 +68,7 @@
* packages of the binding model. * packages of the binding model.
* *
* <div> * <div>
* <img src="doc-files/packages.png"/> * <img src="doc-files/packages.png" alt="">
* </div> * </div>
* *
* <p> * <p>
@ -109,13 +109,13 @@
* For more details, see the javadoc of each component. * For more details, see the javadoc of each component.
* *
* <div> * <div>
* <img src="doc-files/j2s_architecture.gif"/> * <img src="doc-files/j2s_architecture.gif" alt="">
* </div> * </div>
* *
* <b><i>TODO: link to classes from above pictures</i></b> * <b><i>TODO: link to classes from above pictures</i></b>
* *
* *
* <h3>Evolution Rules</h3> * <h2>Evolution Rules</h2>
* None of the class in this package or below should be directly * None of the class in this package or below should be directly
* referenced by the generated code. Hence they can be changed freely * referenced by the generated code. Hence they can be changed freely
* from versions to versions. * from versions to versions.
@ -125,7 +125,7 @@
* *
* <h1>Performance Characteristics</h1> * <h1>Performance Characteristics</h1>
* <p> * <p>
* Model construction happens inside {@link JAXBContext#newInstance(Class[])}. * Model construction happens inside {@link javax.xml.bind.JAXBContext#newInstance(Class[])}.
* It's desirable for this step to be fast and consume less memory, * It's desirable for this step to be fast and consume less memory,
* but it's not too performance sensitive. * but it's not too performance sensitive.
* *
@ -139,44 +139,8 @@
* *
* <h1>Bootstrap Sequence</h1> * <h1>Bootstrap Sequence</h1>
* <p> * <p>
* The following picture illustrates how the {@link JAXBContext#newInstance(Class[])} method * The following picture illustrates how the {@link javax.xml.bind.JAXBContext#newInstance(Class[])} method
* triggers activities. * triggers activities.
* *
* {@SequenceDiagram
boxwid=1.2;
pobject(U,"user");
object(A,"JAXB API");
object(CF,"ContextFactory");
pobject(JC);
step();
message(U,A,"JAXBContext.newInstance()");
active(A);
message(A,A,"locate JAXB RI 2.0");
active(A);
step();
inactive(A);
message(A,CF,"createContext");
active(CF);
create_message(CF,JC,"c:JAXBContextImpl");
active(JC);
message(JC,JC,"build runtime model");
message(JC,JC,"build JaxBeanInfos");
inactive(JC);
rmessage(A,U,"return c");
inactive(CF);
inactive(A);
complete(JC);
complete(CF);
complete(A);
* }
*
* @ArchitectureDocument
*/ */
package com.sun.xml.internal.bind.v2; package com.sun.xml.internal.bind.v2;

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -66,7 +66,7 @@ public final class AssociationMap<XmlNode> {
private final Map<Object,Entry<XmlNode>> byPeer = new IdentityHashMap<Object,Entry<XmlNode>>(); private final Map<Object,Entry<XmlNode>> byPeer = new IdentityHashMap<Object,Entry<XmlNode>>();
private final Set<XmlNode> usedNodes = new HashSet<XmlNode>(); private final Set<XmlNode> usedNodes = new HashSet<XmlNode>();
/** Records the new element&lt;->inner peer association. */ /** Records the new {@code element <->inner} peer association. */
public void addInner( XmlNode element, Object inner ) { public void addInner( XmlNode element, Object inner ) {
Entry<XmlNode> e = byElement.get(element); Entry<XmlNode> e = byElement.get(element);
if(e!=null) { if(e!=null) {
@ -90,7 +90,7 @@ public final class AssociationMap<XmlNode> {
} }
} }
/** Records the new element&lt;->outer peer association. */ /** Records the new {@code element <-> outer} peer association. */
public void addOuter( XmlNode element, Object outer ) { public void addOuter( XmlNode element, Object outer ) {
Entry<XmlNode> e = byElement.get(element); Entry<XmlNode> e = byElement.get(element);
if(e!=null) { if(e!=null) {

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -78,6 +78,9 @@ import com.sun.xml.internal.bind.v2.runtime.output.XmlOutput;
import com.sun.xml.internal.bind.v2.util.FatalAdapter; import com.sun.xml.internal.bind.v2.util.FatalAdapter;
import java.net.URISyntaxException; import java.net.URISyntaxException;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.w3c.dom.Document; import org.w3c.dom.Document;
import org.w3c.dom.Node; import org.w3c.dom.Node;
import org.xml.sax.SAXException; import org.xml.sax.SAXException;
@ -95,6 +98,8 @@ import org.xml.sax.helpers.XMLFilterImpl;
*/ */
public /*to make unit tests happy*/ final class MarshallerImpl extends AbstractMarshallerImpl implements ValidationEventHandler public /*to make unit tests happy*/ final class MarshallerImpl extends AbstractMarshallerImpl implements ValidationEventHandler
{ {
private static final Logger LOGGER = Logger.getLogger(MarshallerImpl.class.getName());
/** Indentation string. Default is four whitespaces. */ /** Indentation string. Default is four whitespaces. */
private String indent = " "; private String indent = " ";
@ -327,12 +332,14 @@ public /*to make unit tests happy*/ final class MarshallerImpl extends AbstractM
toBeFlushed.flush(); toBeFlushed.flush();
} catch (IOException e) { } catch (IOException e) {
// ignore // ignore
LOGGER.log(Level.SEVERE, e.getMessage(), e);
} }
if(toBeClosed!=null) if(toBeClosed!=null)
try { try {
toBeClosed.close(); toBeClosed.close();
} catch (IOException e) { } catch (IOException e) {
// ignore // ignore
LOGGER.log(Level.SEVERE, e.getMessage(), e);
} }
toBeFlushed = null; toBeFlushed = null;
toBeClosed = null; toBeClosed = null;

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -30,7 +30,7 @@ import javax.xml.namespace.NamespaceContext;
import com.sun.istack.internal.NotNull; import com.sun.istack.internal.NotNull;
/** /**
* Maintains namespace&lt;->prefix bindings. * Maintains {@code namespace <-> prefix} bindings.
* *
* <p> * <p>
* This interface extends {@link NamespaceContext} and provides * This interface extends {@link NamespaceContext} and provides

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -53,7 +53,7 @@ public class RuntimeUtil {
* Map from {@link Class} objects representing primitive types * Map from {@link Class} objects representing primitive types
* to {@link Class} objects representing their boxed types. * to {@link Class} objects representing their boxed types.
* <p> * <p>
* e.g., int -> Integer. * e.g., {@code int -> Integer}.
*/ */
public static final Map<Class,Class> boxToPrimitive; public static final Map<Class,Class> boxToPrimitive;

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -38,7 +38,6 @@ import com.sun.xml.internal.bind.marshaller.CharacterEscapeHandler;
/** /**
* {@link XmlOutput} that generates canonical XML. * {@link XmlOutput} that generates canonical XML.
* *
* @see com.sun.xml.internal.bind.api.C14nSupport_ArchitectureDocument
* @author Kohsuke Kawaguchi * @author Kohsuke Kawaguchi
*/ */
public class C14nXmlOutput extends UTF8XmlOutput { public class C14nXmlOutput extends UTF8XmlOutput {
@ -68,7 +67,6 @@ public class C14nXmlOutput extends UTF8XmlOutput {
* (AKA attribute wildcard.) * (AKA attribute wildcard.)
* *
* As long as this map is empty, there's no need for sorting. * As long as this map is empty, there's no need for sorting.
* see {@link com.sun.xml.internal.bind.api.C14nSupport_ArchitectureDocument} for more details.
*/ */
private final FinalArrayList<DynamicAttribute> otherAttributes = new FinalArrayList<DynamicAttribute>(); private final FinalArrayList<DynamicAttribute> otherAttributes = new FinalArrayList<DynamicAttribute>();

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -42,7 +42,7 @@ import com.sun.xml.internal.org.jvnet.fastinfoset.VocabularyApplicationData;
import org.xml.sax.SAXException; import org.xml.sax.SAXException;
/** /**
* {@link XmlOutput} for {@link LowLevelStAXDocumentSerializer}. * {@link XmlOutput} for {@link StAXDocumentSerializer}.
* <p> * <p>
* This class is responsible for managing the indexing of elements, attributes * This class is responsible for managing the indexing of elements, attributes
* and local names that are known to JAXB by way of the JAXBContext (generated * and local names that are known to JAXB by way of the JAXBContext (generated
@ -99,7 +99,7 @@ public final class FastInfosetStreamWriterOutput extends XMLStreamWriterOutput {
/** /**
* Create a new set of tables for a JAXB context. * Create a new set of tables for a JAXB context.
* <p> * <p>
* @param content the JAXB context. * @param context the JAXB context.
* @param initialIndexOffset the initial index offset to calculate * @param initialIndexOffset the initial index offset to calculate
* the maximum possible index * the maximum possible index
* *
@ -124,7 +124,7 @@ public final class FastInfosetStreamWriterOutput extends XMLStreamWriterOutput {
/** /**
* Clear or reset the tables. * Clear or reset the tables.
* <p> * <p>
* @param initialIndexOffset the initial index offset to calculate * @param intialIndexOffset the initial index offset to calculate
* the maximum possible index * the maximum possible index
*/ */
public void clearOrResetTables(int intialIndexOffset) { public void clearOrResetTables(int intialIndexOffset) {
@ -202,7 +202,7 @@ public final class FastInfosetStreamWriterOutput extends XMLStreamWriterOutput {
* Holder of JAXB contexts -> tables. * Holder of JAXB contexts -> tables.
* <p> * <p>
* An instance will be registered with the * An instance will be registered with the
* {@link LowLevelStAXDocumentSerializer}. * {@link StAXDocumentSerializer}.
*/ */
final static class AppData implements VocabularyApplicationData { final static class AppData implements VocabularyApplicationData {
final Map<JAXBContext, TablesPerJAXBContext> contexts = final Map<JAXBContext, TablesPerJAXBContext> contexts =

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -366,8 +366,8 @@ public final class NamespaceContextImpl implements NamespaceContext2 {
* This model of namespace declarations maintain the following invariants. * This model of namespace declarations maintain the following invariants.
* *
* <ul> * <ul>
* <li>If a non-empty prefix is declared, it will never be reassigned to different namespace URIs. * <li>If a non-empty prefix is declared, it will never be reassigned to different namespace URIs.</li>
* <li> * </ul>
*/ */
public final class Element { public final class Element {

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -78,9 +78,9 @@ public class UTF8XmlOutput extends XmlOutputAbstractImpl {
protected int octetBufferIndex; protected int octetBufferIndex;
/** /**
* Set to true to indicate that we need to write '>' * Set to true to indicate that we need to write {@code '>'}
* to close a start tag. Deferring the write of this char * to close a start tag. Deferring the write of this char
* allows us to write "/>" for empty elements. * allows us to write {@code "/>"} for empty elements.
*/ */
protected boolean closeStartTagPending = false; protected boolean closeStartTagPending = false;
@ -129,7 +129,7 @@ public class UTF8XmlOutput extends XmlOutputAbstractImpl {
} }
/** /**
* Writes '>' to close the start tag, if necessary. * Writes {@code '>'} to close the start tag, if necessary.
*/ */
protected final void closeStartTag() throws IOException { protected final void closeStartTag() throws IOException {
if(closeStartTagPending) { if(closeStartTagPending) {

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -158,7 +158,7 @@ public interface XmlOutput {
* *
* @param value * @param value
* this string can contain characters that might need escaping * this string can contain characters that might need escaping
* (such as '&amp;' or '>') * (such as {@code '&' or '>'})
* @param needsSeparatingWhitespace * @param needsSeparatingWhitespace
*/ */
public void text( String value, boolean needsSeparatingWhitespace ) throws IOException, SAXException, XMLStreamException; public void text( String value, boolean needsSeparatingWhitespace ) throws IOException, SAXException, XMLStreamException;
@ -168,7 +168,7 @@ public interface XmlOutput {
* *
* @param value * @param value
* this string can contain characters that might need escaping * this string can contain characters that might need escaping
* (such as '&amp;' or '>') * (such as {@code '&' or '>'})
* @param needsSeparatingWhitespace * @param needsSeparatingWhitespace
*/ */
public void text( Pcdata value, boolean needsSeparatingWhitespace ) throws IOException, SAXException, XMLStreamException; public void text( Pcdata value, boolean needsSeparatingWhitespace ) throws IOException, SAXException, XMLStreamException;

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -56,13 +56,13 @@ import org.xml.sax.SAXException;
/** /**
* Accesses a particular property of a bean. * Accesses a particular property of a bean.
* <p/> * <p>
* <p/> * <p>
* This interface encapsulates the access to the actual data store. * This interface encapsulates the access to the actual data store.
* The intention is to generate implementations for a particular bean * The intention is to generate implementations for a particular bean
* and a property to improve the performance. * and a property to improve the performance.
* <p/> * <p>
* <p/> * <p>
* Accessor can be used as a receiver. Upon receiving an object * Accessor can be used as a receiver. Upon receiving an object
* it sets that to the field. * it sets that to the field.
* *
@ -119,7 +119,7 @@ public abstract class Accessor<BeanT, ValueT> implements Receiver {
/** /**
* Sets the value without adapting the value. * Sets the value without adapting the value.
* <p/> * <p>
* This ugly entry point is only used by JAX-WS. * This ugly entry point is only used by JAX-WS.
* See {@link JAXBRIContext#getElementPropertyAccessor} * See {@link JAXBRIContext#getElementPropertyAccessor}
*/ */
@ -129,7 +129,7 @@ public abstract class Accessor<BeanT, ValueT> implements Receiver {
/** /**
* Returns true if this accessor wraps an adapter. * Returns true if this accessor wraps an adapter.
* <p/> * <p>
* This method needs to be used with care, but it helps some optimization. * This method needs to be used with care, but it helps some optimization.
*/ */
public boolean isAdapted() { public boolean isAdapted() {
@ -138,7 +138,7 @@ public abstract class Accessor<BeanT, ValueT> implements Receiver {
/** /**
* Sets the value without adapting the value. * Sets the value without adapting the value.
* <p/> * <p>
* This ugly entry point is only used by JAX-WS. * This ugly entry point is only used by JAX-WS.
* See {@link JAXBRIContext#getElementPropertyAccessor} * See {@link JAXBRIContext#getElementPropertyAccessor}
*/ */
@ -394,8 +394,8 @@ public abstract class Accessor<BeanT, ValueT> implements Receiver {
/** /**
* A version of {@link GetterSetterReflection} that doesn't have any setter. * A version of {@link GetterSetterReflection} that doesn't have any setter.
* <p/> * <p>
* <p/> * <p>
* This provides a user-friendly error message. * This provides a user-friendly error message.
*/ */
public static class GetterOnlyReflection<BeanT, ValueT> extends GetterSetterReflection<BeanT, ValueT> { public static class GetterOnlyReflection<BeanT, ValueT> extends GetterSetterReflection<BeanT, ValueT> {
@ -411,8 +411,8 @@ public abstract class Accessor<BeanT, ValueT> implements Receiver {
/** /**
* A version of {@link GetterSetterReflection} thaat doesn't have any getter. * A version of {@link GetterSetterReflection} thaat doesn't have any getter.
* <p/> * <p>
* <p/> * <p>
* This provides a user-friendly error message. * This provides a user-friendly error message.
*/ */
public static class SetterOnlyReflection<BeanT, ValueT> extends GetterSetterReflection<BeanT, ValueT> { public static class SetterOnlyReflection<BeanT, ValueT> extends GetterSetterReflection<BeanT, ValueT> {

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -33,7 +33,8 @@ import org.xml.sax.Locator;
import org.w3c.dom.Node; import org.w3c.dom.Node;
/** /**
* Object that returns the current location that the {@link XmlVisitor} is parsing. * Object that returns the current location that the {@link com.sun.xml.internal.bind.v2.runtime.unmarshaller.XmlVisitor}
* is parsing.
* *
* @author Kohsuke Kawaguchi * @author Kohsuke Kawaguchi
*/ */

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -66,6 +66,7 @@ import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
import org.xml.sax.ErrorHandler; import org.xml.sax.ErrorHandler;
import org.xml.sax.Locator;
import org.xml.sax.SAXException; import org.xml.sax.SAXException;
import org.xml.sax.helpers.LocatorImpl; import org.xml.sax.helpers.LocatorImpl;

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -145,7 +145,7 @@ public interface XmlVisitor {
* <p> * <p>
* If this method returns true, all the whitespaces are considered significant * If this method returns true, all the whitespaces are considered significant
* and thus need to be reported as a {@link XmlVisitor#text} event. Furthermore, * and thus need to be reported as a {@link XmlVisitor#text} event. Furthermore,
* if the element has no children (like &lt;foo/>), then it has to be reported * if the element has no children (like {@code <foo/>}), then it has to be reported
* an empty {@link XmlVisitor#text} event. * an empty {@link XmlVisitor#text} event.
*/ */
boolean expectText(); boolean expectText();

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -75,12 +75,13 @@ public final class Util {
/** /**
* Calculate the normalized form of the given uriPath. * Calculate the normalized form of the given uriPath.
* * <p>
* For example: * For example: <pre>{@code
* /a/b/c/ -> /a/b/c/ * /a/b/c/ -> /a/b/c/
* /a/b/c -> /a/b/ * /a/b/c -> /a/b/
* /a/ -> /a/ * /a/ -> /a/
* /a -> / * /a -> /
* }</pre>
* *
* @param uriPath path of a URI (as returned by java.net.URI#getPath() * @param uriPath path of a URI (as returned by java.net.URI#getPath()
* @return the normalized uri path * @return the normalized uri path

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -37,6 +37,8 @@ public abstract class CleanUpExecutorFactory {
public static CleanUpExecutorFactory newInstance() { public static CleanUpExecutorFactory newInstance() {
try { try {
return (CleanUpExecutorFactory) FactoryFinder.find(DEFAULT_PROPERTY_NAME); return (CleanUpExecutorFactory) FactoryFinder.find(DEFAULT_PROPERTY_NAME);
} catch (RuntimeException e) {
return null;
} catch (Exception e) { } catch (Exception e) {
return null; return null;
} }

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -39,9 +39,12 @@ import java.io.IOException;
public final class DecodingException extends IOException { public final class DecodingException extends IOException {
/** /**
* Constructor * Constructs a {@code DecodingException} with the specified detail message.
*
* @param message
* The detail message
*/ */
public DecodingException(String s) { public DecodingException(String message) {
super(s); super(message);
} }
} }

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -29,6 +29,7 @@ import java.io.BufferedReader;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
@ -70,11 +71,7 @@ class FactoryFinder {
String factoryClassName; String factoryClassName;
BufferedReader rd = null; BufferedReader rd = null;
try { try {
try { rd = new BufferedReader(new InputStreamReader(is, StandardCharsets.UTF_8));
rd = new BufferedReader(new InputStreamReader(is, "UTF-8"));
} catch (java.io.UnsupportedEncodingException e) {
rd = new BufferedReader(new InputStreamReader(is));
}
try { try {
factoryClassName = rd.readLine(); factoryClassName = rd.readLine();
} catch (IOException x) { } catch (IOException x) {

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -37,6 +37,9 @@ import java.util.Collection;
* @author Kohsuke Kawaguchi * @author Kohsuke Kawaguchi
*/ */
final class FinalArrayList<T> extends ArrayList<T> { final class FinalArrayList<T> extends ArrayList<T> {
private static final long serialVersionUID = 7996571518730043311L;
public FinalArrayList(int initialCapacity) { public FinalArrayList(int initialCapacity) {
super(initialCapacity); super(initialCapacity);
} }

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -119,11 +119,12 @@ public class MIMEConfig {
} }
/** /**
* @param dir * @param directory
* temp directory
*/ */
public final void setDir(String dir) { public final void setDir(String directory) {
if (tempDir == null && dir != null && !dir.equals("")) { if (tempDir == null && directory != null && !directory.equals("")) {
tempDir = new File(dir); tempDir = new File(directory);
} }
} }
@ -143,7 +144,9 @@ public class MIMEConfig {
LOGGER.log(Level.INFO, "File {0} was not deleted", tempFile.getAbsolutePath()); LOGGER.log(Level.INFO, "File {0} was not deleted", tempFile.getAbsolutePath());
} }
} }
} catch(Exception ioe) { } catch(RuntimeException e) {
memoryThreshold = -1L; // whole attachment will be in-memory
} catch(Exception e) {
memoryThreshold = -1L; // whole attachment will be in-memory memoryThreshold = -1L; // whole attachment will be in-memory
} }
} }

View File

@ -62,7 +62,10 @@ public class MIMEMessage implements Closeable {
private final Map<String, MIMEPart> partsMap = new HashMap<String, MIMEPart>(); private final Map<String, MIMEPart> partsMap = new HashMap<String, MIMEPart>();
/** /**
* @see MIMEMessage(InputStream, String, MIMEConfig) * @see #MIMEMessage(InputStream, String, MIMEConfig)
*
* @param in MIME message stream
* @param boundary the separator for parts(pass it without --)
*/ */
public MIMEMessage(InputStream in, String boundary) { public MIMEMessage(InputStream in, String boundary) {
this(in, boundary, new MIMEConfig()); this(in, boundary, new MIMEConfig());
@ -131,7 +134,7 @@ public class MIMEMessage implements Closeable {
* do the validation, the message needs to be parsed. The parsing of the * do the validation, the message needs to be parsed. The parsing of the
* message is done lazily and is done while reading the bytes of the part. * message is done lazily and is done while reading the bytes of the part.
* *
* @param contentId Content-ID of the part, expects Content-ID without <, > * @param contentId Content-ID of the part, expects Content-ID without {@code <, >}
* @return attachemnt part * @return attachemnt part
*/ */
public MIMEPart getPart(String contentId) { public MIMEPart getPart(String contentId) {
@ -177,8 +180,8 @@ public class MIMEMessage implements Closeable {
/** /**
* Closes all parsed {@link com.sun.xml.internal.org.jvnet.mimepull.MIMEPart parts}. * 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. * This method is safe to call even if parsing of message failed.
* <p/> *
* Does not throw {@link com.sun.xml.internal.org.jvnet.mimepull.MIMEParsingException} if an * <p> 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 * error occurred during closing a MIME part. The exception (if any) is
* still logged. * still logged.
*/ */

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -123,6 +123,11 @@ class MIMEParser implements Iterable<MIMEEvent> {
@Override @Override
public MIMEEvent next() { public MIMEEvent next() {
if (parsed) {
throw new NoSuchElementException();
}
switch(state) { switch(state) {
case START_MESSAGE : case START_MESSAGE :
if (LOGGER.isLoggable(Level.FINER)) {LOGGER.log(Level.FINER, "MIMEParser state={0}", STATE.START_MESSAGE);} if (LOGGER.isLoggable(Level.FINER)) {LOGGER.log(Level.FINER, "MIMEParser state={0}", STATE.START_MESSAGE);}

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -25,6 +25,9 @@
package com.sun.xml.internal.org.jvnet.mimepull; package com.sun.xml.internal.org.jvnet.mimepull;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardCopyOption;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import java.io.File; import java.io.File;
@ -133,10 +136,12 @@ final class WeakDataFile extends WeakReference<DataFile> {
refList.remove(this); refList.remove(this);
try { try {
raf.close(); raf.close();
boolean renamed = file.renameTo(f); Path target = Files.move(file.toPath(), f.toPath(), StandardCopyOption.REPLACE_EXISTING);
boolean renamed = f.toPath().equals(target);
if (!renamed) { if (!renamed) {
if (LOGGER.isLoggable(Level.INFO)) { if (LOGGER.isLoggable(Level.INFO)) {
LOGGER.log(Level.INFO, "File {0} was not moved to {1}", new Object[] {file.getAbsolutePath(), f.getAbsolutePath()}); throw new MIMEParsingException("File " + file.getAbsolutePath() +
" was not moved to " + f.getAbsolutePath());
} }
} }
} catch(IOException ioe) { } catch(IOException ioe) {

View File

@ -210,7 +210,7 @@ public class XMLStreamReaderToXMLStreamWriter {
int nsCount = in.getNamespaceCount(); int nsCount = in.getNamespaceCount();
for (int i = 0; i < nsCount; i++) { for (int i = 0; i < nsCount; i++) {
out.writeNamespace( out.writeNamespace(
in.getNamespacePrefix(i), fixNull(in.getNamespacePrefix(i)), //StAX reader will return null for default NS
fixNull(in.getNamespaceURI(i))); // zephyr doesn't like null, I don't know what is correct, so just fix null to "" for now fixNull(in.getNamespaceURI(i))); // zephyr doesn't like null, I don't know what is correct, so just fix null to "" for now
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -91,7 +91,7 @@ public final class Document {
} }
/** /**
* Defines additional user object -> string conversion logic. * Defines additional user object {@code ->} string conversion logic.
* *
* <p> * <p>
* Applications can add their own {@link DatatypeWriter} so that * Applications can add their own {@link DatatypeWriter} so that

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -43,7 +43,7 @@ public abstract class ResultFactory {
private ResultFactory() {} private ResultFactory() {}
/** /**
* Factory method for producing {@link XmlSerializer) from {@link javax.xml.transform.Result}. * Factory method for producing {@link XmlSerializer} from {@link javax.xml.transform.Result}.
* *
* This method supports {@link javax.xml.transform.sax.SAXResult}, * This method supports {@link javax.xml.transform.sax.SAXResult},
* {@link javax.xml.transform.stream.StreamResult}, and {@link javax.xml.transform.dom.DOMResult}. * {@link javax.xml.transform.stream.StreamResult}, and {@link javax.xml.transform.dom.DOMResult}.

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -94,7 +94,7 @@ import java.util.Map;
* <p>The resulting document will look like this:</p> * <p>The resulting document will look like this:</p>
* *
* <pre>{@code * <pre>{@code
* <?xml version="1.0" standalone="yes"?> * <?xml version="1.0" standalone="yes"?>
* *
* <greeting>Hello, world!</greeting> * <greeting>Hello, world!</greeting>
* }</pre> * }</pre>
@ -168,7 +168,7 @@ import java.util.Map;
* *
* <ol> * <ol>
* <li>the qualified name</li> * <li>the qualified name</li>
* <li>the {@link #setPrefix setPrefix} method.</li> * <li>the {@link #startPrefixMapping(String, String)} method.</li>
* </ol> * </ol>
* *
* <p>Whenever the XML writer finds a new Namespace URI, it checks * <p>Whenever the XML writer finds a new Namespace URI, it checks

View File

@ -372,8 +372,8 @@ public interface Marshaller {
* @throws MarshalException * @throws MarshalException
* If the {@link ValidationEventHandler ValidationEventHandler} * If the {@link ValidationEventHandler ValidationEventHandler}
* returns false from its {@code handleEvent} method or the * returns false from its {@code handleEvent} method or the
* {@code Marshaller} is unable to marshal {@code obj} (or any * {@code Marshaller} is unable to marshal {@code jaxbElement} (or any
* object reachable from {@code obj}). See <a href="#elementMarshalling"> * object reachable from {@code jaxbElement}). See <a href="#elementMarshalling">
* Marshalling a JAXB element</a>. * Marshalling a JAXB element</a>.
* @throws IllegalArgumentException * @throws IllegalArgumentException
* If any of the method parameters are null * If any of the method parameters are null
@ -394,8 +394,8 @@ public interface Marshaller {
* @throws MarshalException * @throws MarshalException
* If the {@link ValidationEventHandler ValidationEventHandler} * If the {@link ValidationEventHandler ValidationEventHandler}
* returns false from its {@code handleEvent} method or the * returns false from its {@code handleEvent} method or the
* {@code Marshaller} is unable to marshal {@code obj} (or any * {@code Marshaller} is unable to marshal {@code jaxbElement} (or any
* object reachable from {@code obj}). See <a href="#elementMarshalling"> * object reachable from {@code jaxbElement}). See <a href="#elementMarshalling">
* Marshalling a JAXB element</a>. * Marshalling a JAXB element</a>.
* @throws IllegalArgumentException * @throws IllegalArgumentException
* If any of the method parameters are null * If any of the method parameters are null
@ -416,8 +416,8 @@ public interface Marshaller {
* @throws MarshalException * @throws MarshalException
* If the {@link ValidationEventHandler ValidationEventHandler} * If the {@link ValidationEventHandler ValidationEventHandler}
* returns false from its {@code handleEvent} method or the * returns false from its {@code handleEvent} method or the
* {@code Marshaller} is unable to marshal {@code obj} (or any * {@code Marshaller} is unable to marshal {@code jaxbElement} (or any
* object reachable from {@code obj}). See <a href="#elementMarshalling"> * object reachable from {@code jaxbElement}). See <a href="#elementMarshalling">
* Marshalling a JAXB element</a>. * Marshalling a JAXB element</a>.
* @throws IllegalArgumentException * @throws IllegalArgumentException
* If any of the method parameters are null * If any of the method parameters are null
@ -439,8 +439,8 @@ public interface Marshaller {
* @throws MarshalException * @throws MarshalException
* If the {@link ValidationEventHandler ValidationEventHandler} * If the {@link ValidationEventHandler ValidationEventHandler}
* returns false from its {@code handleEvent} method or the * returns false from its {@code handleEvent} method or the
* {@code Marshaller} is unable to marshal {@code obj} (or any * {@code Marshaller} is unable to marshal {@code jaxbElement} (or any
* object reachable from {@code obj}). See <a href="#elementMarshalling"> * object reachable from {@code jaxbElement}). See <a href="#elementMarshalling">
* Marshalling a JAXB element</a>. * Marshalling a JAXB element</a>.
* @throws IllegalArgumentException * @throws IllegalArgumentException
* If any of the method parameters are null * If any of the method parameters are null
@ -461,8 +461,8 @@ public interface Marshaller {
* @throws MarshalException * @throws MarshalException
* If the {@link ValidationEventHandler ValidationEventHandler} * If the {@link ValidationEventHandler ValidationEventHandler}
* returns false from its {@code handleEvent} method or the * returns false from its {@code handleEvent} method or the
* {@code Marshaller} is unable to marshal {@code obj} (or any * {@code Marshaller} is unable to marshal {@code jaxbElement} (or any
* object reachable from {@code obj}). See <a href="#elementMarshalling"> * object reachable from {@code jaxbElement}). See <a href="#elementMarshalling">
* Marshalling a JAXB element</a>. * Marshalling a JAXB element</a>.
* @throws IllegalArgumentException * @throws IllegalArgumentException
* If any of the method parameters are null * If any of the method parameters are null
@ -510,8 +510,8 @@ public interface Marshaller {
* @throws MarshalException * @throws MarshalException
* If the {@link ValidationEventHandler ValidationEventHandler} * If the {@link ValidationEventHandler ValidationEventHandler}
* returns false from its {@code handleEvent} method or the * returns false from its {@code handleEvent} method or the
* {@code Marshaller} is unable to marshal {@code obj} (or any * {@code Marshaller} is unable to marshal {@code jaxbElement} (or any
* object reachable from {@code obj}). See <a href="#elementMarshalling"> * object reachable from {@code jaxbElement}). See <a href="#elementMarshalling">
* Marshalling a JAXB element</a>. * Marshalling a JAXB element</a>.
* @throws IllegalArgumentException * @throws IllegalArgumentException
* If any of the method parameters are null * If any of the method parameters are null
@ -534,8 +534,8 @@ public interface Marshaller {
* @throws MarshalException * @throws MarshalException
* If the {@link ValidationEventHandler ValidationEventHandler} * If the {@link ValidationEventHandler ValidationEventHandler}
* returns false from its {@code handleEvent} method or the * returns false from its {@code handleEvent} method or the
* {@code Marshaller} is unable to marshal {@code obj} (or any * {@code Marshaller} is unable to marshal {@code jaxbElement} (or any
* object reachable from {@code obj}). See <a href="#elementMarshalling"> * object reachable from {@code jaxbElement}). See <a href="#elementMarshalling">
* Marshalling a JAXB element</a>. * Marshalling a JAXB element</a>.
* @throws IllegalArgumentException * @throws IllegalArgumentException
* If any of the method parameters are null * If any of the method parameters are null

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -41,6 +41,8 @@ public abstract class MessageContextFactory
{ {
private static final MessageContextFactory DEFAULT = new com.sun.xml.internal.ws.api.message.MessageContextFactory(new WebServiceFeature[0]); private static final MessageContextFactory DEFAULT = new com.sun.xml.internal.ws.api.message.MessageContextFactory(new WebServiceFeature[0]);
protected com.sun.xml.internal.ws.api.message.saaj.SAAJFactory saajFactory = null;
protected abstract MessageContextFactory newFactory(WebServiceFeature ... f); protected abstract MessageContextFactory newFactory(WebServiceFeature ... f);
public abstract MessageContext createContext(); public abstract MessageContext createContext();
@ -127,4 +129,8 @@ public abstract class MessageContextFactory
private static interface Creator { private static interface Creator {
public MessageContext create(MessageContextFactory f); public MessageContext create(MessageContextFactory f);
} }
public void setSAAJFactory(com.sun.xml.internal.ws.api.message.saaj.SAAJFactory saajFactory) {
this.saajFactory = saajFactory;
}
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -50,9 +50,7 @@ import com.sun.xml.internal.messaging.saaj.util.*;
class HttpSOAPConnection extends SOAPConnection { class HttpSOAPConnection extends SOAPConnection {
public static final String vmVendor = SAAJUtil.getSystemProperty("java.vendor.url"); public static final String vmVendor = SAAJUtil.getSystemProperty("java.vendor.url");
private static final String sunVmVendor = "http://java.sun.com/";
private static final String ibmVmVendor = "http://www.ibm.com/"; private static final String ibmVmVendor = "http://www.ibm.com/";
private static final boolean isSunVM = sunVmVendor.equals(vmVendor) ? true: false;
private static final boolean isIBMVM = ibmVmVendor.equals(vmVendor) ? true : false; private static final boolean isIBMVM = ibmVmVendor.equals(vmVendor) ? true : false;
private static final String JAXM_URLENDPOINT="javax.xml.messaging.URLEndpoint"; private static final String JAXM_URLENDPOINT="javax.xml.messaging.URLEndpoint";
@ -95,7 +93,7 @@ class HttpSOAPConnection extends SOAPConnection {
throw new SOAPExceptionImpl("Connection is closed"); throw new SOAPExceptionImpl("Connection is closed");
} }
Class urlEndpointClass = null; Class<?> urlEndpointClass = null;
ClassLoader loader = Thread.currentThread().getContextClassLoader(); ClassLoader loader = Thread.currentThread().getContextClassLoader();
try { try {
if (loader != null) { if (loader != null) {
@ -198,7 +196,7 @@ class HttpSOAPConnection extends SOAPConnection {
MimeHeaders headers = message.getMimeHeaders(); MimeHeaders headers = message.getMimeHeaders();
Iterator it = headers.getAllHeaders(); Iterator<?> it = headers.getAllHeaders();
boolean hasAuth = false; // true if we find explicit Auth header boolean hasAuth = false; // true if we find explicit Auth header
while (it.hasNext()) { while (it.hasNext()) {
MimeHeader header = (MimeHeader) it.next(); MimeHeader header = (MimeHeader) it.next();
@ -209,7 +207,7 @@ class HttpSOAPConnection extends SOAPConnection {
header.getName(), header.getName(),
header.getValue()); header.getValue());
else { else {
StringBuffer concat = new StringBuffer(); StringBuilder concat = new StringBuilder();
int i = 0; int i = 0;
while (i < values.length) { while (i < values.length) {
if (i != 0) if (i != 0)
@ -355,7 +353,7 @@ class HttpSOAPConnection extends SOAPConnection {
log.severe("SAAJ0011.p2p.get.already.closed.conn"); log.severe("SAAJ0011.p2p.get.already.closed.conn");
throw new SOAPExceptionImpl("Connection is closed"); throw new SOAPExceptionImpl("Connection is closed");
} }
Class urlEndpointClass = null; Class<?> urlEndpointClass = null;
try { try {
urlEndpointClass = Class.forName("javax.xml.messaging.URLEndpoint"); urlEndpointClass = Class.forName("javax.xml.messaging.URLEndpoint");
@ -441,7 +439,7 @@ class HttpSOAPConnection extends SOAPConnection {
httpConnection.setDoOutput(true); httpConnection.setDoOutput(true);
httpConnection.setDoInput(true); httpConnection.setDoInput(true);
httpConnection.setUseCaches(false); httpConnection.setUseCaches(false);
httpConnection.setFollowRedirects(true); httpConnection.setInstanceFollowRedirects(true);
httpConnection.connect(); httpConnection.connect();
@ -591,7 +589,7 @@ class HttpSOAPConnection extends SOAPConnection {
log.log(Level.FINE, "SAAJ0054.p2p.set.providers", log.log(Level.FINE, "SAAJ0054.p2p.set.providers",
new String[] { pkgs }); new String[] { pkgs });
try { try {
Class c = Class.forName(SSL_PROVIDER); Class<?> c = Class.forName(SSL_PROVIDER);
Provider p = (Provider) c.newInstance(); Provider p = (Provider) c.newInstance();
Security.addProvider(p); Security.addProvider(p);
if (log.isLoggable(Level.FINE)) if (log.isLoggable(Level.FINE))

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -121,7 +121,7 @@ public class MessagingException extends Exception {
return super.getMessage(); return super.getMessage();
Exception n = next; Exception n = next;
String s = super.getMessage(); String s = super.getMessage();
StringBuffer sb = new StringBuffer(s == null ? "" : s); StringBuilder sb = new StringBuilder(s == null ? "" : s);
while (n != null) { while (n != null) {
sb.append(";\n nested exception is:\n\t"); sb.append(";\n nested exception is:\n\t");
if (n instanceof MessagingException) { if (n instanceof MessagingException) {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -705,7 +705,7 @@ public class BMMimeMultipart extends MimeMultipart {
String bnd = "--" + contentType.getParameter("boundary"); String bnd = "--" + contentType.getParameter("boundary");
for (int i = 0; i < parts.size(); i++) { for (int i = 0; i < parts.size(); i++) {
OutputUtil.writeln(bnd, os); // put out boundary OutputUtil.writeln(bnd, os); // put out boundary
((MimeBodyPart)parts.get(i)).writeTo(os); parts.get(i).writeTo(os);
OutputUtil.writeln(os); // put out empty line OutputUtil.writeln(os); // put out empty line
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -169,7 +169,7 @@ public class ContentDisposition {
if (list == null) if (list == null)
return disposition; return disposition;
StringBuffer sb = new StringBuffer(disposition); StringBuilder sb = new StringBuilder(disposition);
// append the parameter list // append the parameter list
// use the length of the string buffer + the length of // use the length of the string buffer + the length of

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -204,7 +204,7 @@ public final class ContentType {
if (primaryType == null || subType == null) // need both if (primaryType == null || subType == null) // need both
return null; return null;
StringBuffer sb = new StringBuffer(); StringBuilder sb = new StringBuilder();
sb.append(primaryType).append('/').append(subType); sb.append(primaryType).append('/').append(subType);
if (list != null) if (list != null)
// Http Binding section of the "SOAP with attachments" specification says, // Http Binding section of the "SOAP with attachments" specification says,

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -346,7 +346,7 @@ public class HeaderTokenizer {
* quoted string. * quoted string.
*/ */
private static String filterToken(String s, int start, int end) { private static String filterToken(String s, int start, int end) {
StringBuffer sb = new StringBuffer(); StringBuilder sb = new StringBuilder();
char c; char c;
boolean gotEscape = false; boolean gotEscape = false;
boolean gotCR = false; boolean gotCR = false;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -73,12 +73,12 @@ import java.util.NoSuchElementException;
*/ */
public final class InternetHeaders { public final class InternetHeaders {
private final FinalArrayList headers = new FinalArrayList(); private final FinalArrayList<hdr> headers = new FinalArrayList<hdr>();
/** /**
* Lazily cerated view of header lines (Strings). * Lazily cerated view of header lines (Strings).
*/ */
private List headerValueView; private List<String> headerValueView;
/** /**
* Create an empty InternetHeaders object. * Create an empty InternetHeaders object.
@ -119,7 +119,7 @@ public final class InternetHeaders {
LineInputStream lis = new LineInputStream(is); LineInputStream lis = new LineInputStream(is);
String prevline = null; // the previous header line, as a string String prevline = null; // the previous header line, as a string
// a buffer to accumulate the header in, when we know it's needed // a buffer to accumulate the header in, when we know it's needed
StringBuffer lineBuffer = new StringBuffer(); StringBuilder lineBuffer = new StringBuilder();
try { try {
//while ((line = lis.readLine()) != null) { //while ((line = lis.readLine()) != null) {
@ -161,11 +161,11 @@ public final class InternetHeaders {
*/ */
public String[] getHeader(String name) { public String[] getHeader(String name) {
// XXX - should we just step through in index order? // XXX - should we just step through in index order?
FinalArrayList v = new FinalArrayList(); // accumulate return values FinalArrayList<String> v = new FinalArrayList<String>(); // accumulate return values
int len = headers.size(); int len = headers.size();
for( int i=0; i<len; i++ ) { for( int i=0; i<len; i++ ) {
hdr h = (hdr) headers.get(i); hdr h = headers.get(i);
if (name.equalsIgnoreCase(h.name)) { if (name.equalsIgnoreCase(h.name)) {
v.add(h.getValue()); v.add(h.getValue());
} }
@ -173,7 +173,7 @@ public final class InternetHeaders {
if (v.size() == 0) if (v.size() == 0)
return (null); return (null);
// convert Vector to an array for return // convert Vector to an array for return
return (String[]) v.toArray(new String[v.size()]); return v.toArray(new String[v.size()]);
} }
/** /**
@ -197,7 +197,7 @@ public final class InternetHeaders {
if ((s.length == 1) || delimiter == null) if ((s.length == 1) || delimiter == null)
return s[0]; return s[0];
StringBuffer r = new StringBuffer(s[0]); StringBuilder r = new StringBuilder(s[0]);
for (int i = 1; i < s.length; i++) { for (int i = 1; i < s.length; i++) {
r.append(delimiter); r.append(delimiter);
r.append(s[i]); r.append(s[i]);
@ -219,7 +219,7 @@ public final class InternetHeaders {
boolean found = false; boolean found = false;
for (int i = 0; i < headers.size(); i++) { for (int i = 0; i < headers.size(); i++) {
hdr h = (hdr) headers.get(i); hdr h = headers.get(i);
if (name.equalsIgnoreCase(h.name)) { if (name.equalsIgnoreCase(h.name)) {
if (!found) { if (!found) {
int j; int j;
@ -252,7 +252,7 @@ public final class InternetHeaders {
public void addHeader(String name, String value) { public void addHeader(String name, String value) {
int pos = headers.size(); int pos = headers.size();
for (int i = headers.size() - 1; i >= 0; i--) { for (int i = headers.size() - 1; i >= 0; i--) {
hdr h = (hdr) headers.get(i); hdr h = headers.get(i);
if (name.equalsIgnoreCase(h.name)) { if (name.equalsIgnoreCase(h.name)) {
headers.add(i + 1, new hdr(name, value)); headers.add(i + 1, new hdr(name, value));
return; return;
@ -271,7 +271,7 @@ public final class InternetHeaders {
*/ */
public void removeHeader(String name) { public void removeHeader(String name) {
for (int i = 0; i < headers.size(); i++) { for (int i = 0; i < headers.size(); i++) {
hdr h = (hdr) headers.get(i); hdr h = headers.get(i);
if (name.equalsIgnoreCase(h.name)) { if (name.equalsIgnoreCase(h.name)) {
headers.remove(i); headers.remove(i);
i--; // have to look at i again i--; // have to look at i again
@ -285,7 +285,7 @@ public final class InternetHeaders {
* *
* @return Header objects * @return Header objects
*/ */
public FinalArrayList getAllHeaders() { public FinalArrayList<hdr> getAllHeaders() {
return headers; // conceptually it should be read-only, but for performance reason I'm not wrapping it here return headers; // conceptually it should be read-only, but for performance reason I'm not wrapping it here
} }
@ -302,7 +302,7 @@ public final class InternetHeaders {
try { try {
char c = line.charAt(0); char c = line.charAt(0);
if (c == ' ' || c == '\t') { if (c == ' ' || c == '\t') {
hdr h = (hdr) headers.get(headers.size() - 1); hdr h = headers.get(headers.size() - 1);
h.line += "\r\n" + line; h.line += "\r\n" + line;
} else } else
headers.add(new hdr(line)); headers.add(new hdr(line));
@ -317,11 +317,11 @@ public final class InternetHeaders {
/** /**
* Return all the header lines as a collection * Return all the header lines as a collection
*/ */
public List getAllHeaderLines() { public List<String> getAllHeaderLines() {
if(headerValueView==null) if(headerValueView==null)
headerValueView = new AbstractList() { headerValueView = new AbstractList<String>() {
public Object get(int index) { public String get(int index) {
return ((hdr)headers.get(index)).line; return headers.get(index).line;
} }
public int size() { public int size() {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -37,8 +37,6 @@ import com.sun.xml.internal.messaging.saaj.packaging.mime.util.OutputUtil;
import com.sun.xml.internal.messaging.saaj.util.ByteOutputStream; import com.sun.xml.internal.messaging.saaj.util.ByteOutputStream;
import com.sun.xml.internal.messaging.saaj.util.FinalArrayList; import com.sun.xml.internal.messaging.saaj.util.FinalArrayList;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.activation.DataHandler; import javax.activation.DataHandler;
import java.io.BufferedInputStream; import java.io.BufferedInputStream;
import java.io.ByteArrayInputStream; import java.io.ByteArrayInputStream;
@ -526,7 +524,7 @@ public final class MimeBodyPart {
// Tokenize the header to obtain the Language-tags (skip comments) // Tokenize the header to obtain the Language-tags (skip comments)
HeaderTokenizer h = new HeaderTokenizer(s, HeaderTokenizer.MIME); HeaderTokenizer h = new HeaderTokenizer(s, HeaderTokenizer.MIME);
FinalArrayList v = new FinalArrayList(); FinalArrayList<String> v = new FinalArrayList<String>();
HeaderTokenizer.Token tk; HeaderTokenizer.Token tk;
int tkType; int tkType;
@ -544,7 +542,7 @@ public final class MimeBodyPart {
if (v.size() == 0) if (v.size() == 0)
return null; return null;
return (String[])v.toArray(new String[v.size()]); return v.toArray(new String[v.size()]);
} }
/** /**
@ -554,7 +552,7 @@ public final class MimeBodyPart {
* @param languages array of language tags * @param languages array of language tags
*/ */
public void setContentLanguage(String[] languages) { public void setContentLanguage(String[] languages) {
StringBuffer sb = new StringBuffer(languages[0]); StringBuilder sb = new StringBuilder(languages[0]);
for (int i = 1; i < languages.length; i++) for (int i = 1; i < languages.length; i++)
sb.append(',').append(languages[i]); sb.append(',').append(languages[i]);
setHeader("Content-Language", sb.toString()); setHeader("Content-Language", sb.toString());
@ -943,10 +941,10 @@ public final class MimeBodyPart {
throws IOException, MessagingException { throws IOException, MessagingException {
// First, write out the header // First, write out the header
List hdrLines = headers.getAllHeaderLines(); List<String> hdrLines = headers.getAllHeaderLines();
int sz = hdrLines.size(); int sz = hdrLines.size();
for( int i=0; i<sz; i++ ) for( int i=0; i<sz; i++ )
OutputUtil.writeln((String)hdrLines.get(i),os); OutputUtil.writeln(hdrLines.get(i),os);
// The CRLF separator between header and content // The CRLF separator between header and content
OutputUtil.writeln(os); OutputUtil.writeln(os);
@ -1043,7 +1041,7 @@ public final class MimeBodyPart {
* Return all the headers from this Message as an Enumeration of * Return all the headers from this Message as an Enumeration of
* Header objects. * Header objects.
*/ */
public FinalArrayList getAllHeaders() { public FinalArrayList<hdr> getAllHeaders() {
return headers.getAllHeaders(); return headers.getAllHeaders();
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -93,7 +93,7 @@ public class MimeMultipart {
/** /**
* Vector of MimeBodyPart objects. * Vector of MimeBodyPart objects.
*/ */
protected FinalArrayList parts = new FinalArrayList(); // Holds BodyParts protected FinalArrayList<MimeBodyPart> parts = new FinalArrayList<MimeBodyPart>(); // Holds BodyParts
/** /**
* This field specifies the content-type of this multipart * This field specifies the content-type of this multipart
@ -212,7 +212,7 @@ public class MimeMultipart {
if (parts == null) if (parts == null)
throw new IndexOutOfBoundsException("No such BodyPart"); throw new IndexOutOfBoundsException("No such BodyPart");
return (MimeBodyPart)parts.get(index); return parts.get(index);
} }
/** /**
@ -259,7 +259,7 @@ public class MimeMultipart {
*/ */
protected void updateHeaders() throws MessagingException { protected void updateHeaders() throws MessagingException {
for (int i = 0; i < parts.size(); i++) for (int i = 0; i < parts.size(); i++)
((MimeBodyPart)parts.get(i)).updateHeaders(); parts.get(i).updateHeaders();
} }
/** /**
@ -596,7 +596,7 @@ public class MimeMultipart {
if (parts == null) if (parts == null)
throw new IndexOutOfBoundsException("No such BodyPart"); throw new IndexOutOfBoundsException("No such BodyPart");
MimeBodyPart part = (MimeBodyPart)parts.get(index); MimeBodyPart part = parts.get(index);
parts.remove(index); parts.remove(index);
part.setParent(null); part.setParent(null);
} }
@ -609,7 +609,7 @@ public class MimeMultipart {
*/ */
public synchronized void addBodyPart(MimeBodyPart part) { public synchronized void addBodyPart(MimeBodyPart part) {
if (parts == null) if (parts == null)
parts = new FinalArrayList(); parts = new FinalArrayList<MimeBodyPart>();
parts.add(part); parts.add(part);
part.setParent(this); part.setParent(this);
@ -627,7 +627,7 @@ public class MimeMultipart {
*/ */
public synchronized void addBodyPart(MimeBodyPart part, int index) { public synchronized void addBodyPart(MimeBodyPart part, int index) {
if (parts == null) if (parts == null)
parts = new FinalArrayList(); parts = new FinalArrayList<MimeBodyPart>();
parts.add(index,part); parts.add(index,part);
part.setParent(this); part.setParent(this);

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -31,7 +31,6 @@ import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.util.List; import java.util.List;
import javax.activation.DataSource; import javax.activation.DataSource;
import javax.xml.soap.AttachmentPart;
import com.sun.xml.internal.org.jvnet.mimepull.MIMEConfig; import com.sun.xml.internal.org.jvnet.mimepull.MIMEConfig;
import com.sun.xml.internal.org.jvnet.mimepull.MIMEMessage; import com.sun.xml.internal.org.jvnet.mimepull.MIMEMessage;
import com.sun.xml.internal.org.jvnet.mimepull.MIMEPart; import com.sun.xml.internal.org.jvnet.mimepull.MIMEPart;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -510,8 +510,8 @@ public class MimeUtility {
// Encoded words found. Start decoding ... // Encoded words found. Start decoding ...
st = new StringTokenizer(etext, lwsp, true); st = new StringTokenizer(etext, lwsp, true);
StringBuffer sb = new StringBuffer(); // decode buffer StringBuilder sb = new StringBuilder(); // decode buffer
StringBuffer wsb = new StringBuffer(); // white space buffer StringBuilder wsb = new StringBuilder(); // white space buffer
boolean prevWasEncoded = false; boolean prevWasEncoded = false;
while (st.hasMoreTokens()) { while (st.hasMoreTokens()) {
@ -648,7 +648,7 @@ public class MimeUtility {
throw new UnsupportedEncodingException( throw new UnsupportedEncodingException(
"Unknown transfer encoding: " + encoding); "Unknown transfer encoding: " + encoding);
StringBuffer outb = new StringBuffer(); // the output buffer StringBuilder outb = new StringBuilder(); // the output buffer
doEncode(string, b64, jcharset, doEncode(string, b64, jcharset,
// As per RFC 2047, size of an encoded string should not // As per RFC 2047, size of an encoded string should not
// exceed 75 bytes. // exceed 75 bytes.
@ -662,7 +662,7 @@ public class MimeUtility {
private static void doEncode(String string, boolean b64, private static void doEncode(String string, boolean b64,
String jcharset, int avail, String prefix, String jcharset, int avail, String prefix,
boolean first, boolean encodingWord, StringBuffer buf) boolean first, boolean encodingWord, StringBuilder buf)
throws UnsupportedEncodingException { throws UnsupportedEncodingException {
// First find out what the length of the encoded version of // First find out what the length of the encoded version of
@ -812,7 +812,7 @@ public class MimeUtility {
private static String decodeInnerWords(String word) private static String decodeInnerWords(String word)
throws UnsupportedEncodingException { throws UnsupportedEncodingException {
int start = 0, i; int start = 0, i;
StringBuffer buf = new StringBuffer(); StringBuilder buf = new StringBuilder();
while ((i = word.indexOf("=?", start)) >= 0) { while ((i = word.indexOf("=?", start)) >= 0) {
buf.append(word.substring(start, i)); buf.append(word.substring(start, i));
int end = word.indexOf("?=", i); int end = word.indexOf("?=", i);
@ -862,7 +862,7 @@ public class MimeUtility {
char c = word.charAt(i); char c = word.charAt(i);
if (c == '"' || c == '\\' || c == '\r' || c == '\n') { if (c == '"' || c == '\\' || c == '\r' || c == '\n') {
// need to escape them and then quote the whole string // need to escape them and then quote the whole string
StringBuffer sb = new StringBuffer(len + 3); StringBuilder sb = new StringBuilder(len + 3);
sb.append('"'); sb.append('"');
sb.append(word.substring(0, i)); sb.append(word.substring(0, i));
int lastc = 0; int lastc = 0;
@ -885,7 +885,7 @@ public class MimeUtility {
} }
if (needQuoting) { if (needQuoting) {
StringBuffer sb = new StringBuffer(len + 2); StringBuilder sb = new StringBuilder(len + 2);
sb.append('"').append(word).append('"'); sb.append('"').append(word).append('"');
return sb.toString(); return sb.toString();
} else } else
@ -927,7 +927,7 @@ public class MimeUtility {
return s; return s;
// have to actually fold the string // have to actually fold the string
StringBuffer sb = new StringBuffer(s.length() + 4); StringBuilder sb = new StringBuilder(s.length() + 4);
char lastc = 0; char lastc = 0;
while (used + s.length() > 76) { while (used + s.length() > 76) {
int lastspace = -1; int lastspace = -1;
@ -969,7 +969,7 @@ public class MimeUtility {
if (!foldText) if (!foldText)
return s; return s;
StringBuffer sb = null; StringBuilder sb = null;
int i; int i;
while ((i = indexOfAny(s, "\r\n")) >= 0) { while ((i = indexOfAny(s, "\r\n")) >= 0) {
int start = i; int start = i;
@ -986,7 +986,7 @@ public class MimeUtility {
while (i < l && ((c = s.charAt(i)) == ' ' || c == '\t')) while (i < l && ((c = s.charAt(i)) == ' ' || c == '\t'))
i++; i++;
if (sb == null) if (sb == null)
sb = new StringBuffer(s.length()); sb = new StringBuilder(s.length());
if (start != 0) { if (start != 0) {
sb.append(s.substring(0, start)); sb.append(s.substring(0, start));
sb.append(' '); sb.append(' ');
@ -996,14 +996,14 @@ public class MimeUtility {
} }
// it's not a continuation line, just leave it in // it's not a continuation line, just leave it in
if (sb == null) if (sb == null)
sb = new StringBuffer(s.length()); sb = new StringBuilder(s.length());
sb.append(s.substring(0, i)); sb.append(s.substring(0, i));
s = s.substring(i); s = s.substring(i);
} else { } else {
// there's a backslash at "start - 1" // there's a backslash at "start - 1"
// strip it out, but leave in the line break // strip it out, but leave in the line break
if (sb == null) if (sb == null)
sb = new StringBuffer(s.length()); sb = new StringBuilder(s.length());
sb.append(s.substring(0, start - 1)); sb.append(s.substring(0, start - 1));
sb.append(s.substring(start, i)); sb.append(s.substring(start, i));
s = s.substring(i); s = s.substring(i);
@ -1051,7 +1051,7 @@ public class MimeUtility {
// no mapping table, or charset parameter is null // no mapping table, or charset parameter is null
return charset; return charset;
String alias = (String)mime2java.get(charset.toLowerCase()); String alias = mime2java.get(charset.toLowerCase());
return alias == null ? charset : alias; return alias == null ? charset : alias;
} }
@ -1073,7 +1073,7 @@ public class MimeUtility {
// no mapping table or charset param is null // no mapping table or charset param is null
return charset; return charset;
String alias = (String)java2mime.get(charset.toLowerCase()); String alias = java2mime.get(charset.toLowerCase());
return alias == null ? charset : alias; return alias == null ? charset : alias;
} }
@ -1140,12 +1140,12 @@ public class MimeUtility {
// Tables to map MIME charset names to Java names and vice versa. // Tables to map MIME charset names to Java names and vice versa.
// XXX - Should eventually use J2SE 1.4 java.nio.charset.Charset // XXX - Should eventually use J2SE 1.4 java.nio.charset.Charset
private static Hashtable mime2java; private static Hashtable<String, String> mime2java;
private static Hashtable java2mime; private static Hashtable<String, String> java2mime;
static { static {
java2mime = new Hashtable(40); java2mime = new Hashtable<String, String>(40);
mime2java = new Hashtable(10); mime2java = new Hashtable<String, String>(10);
try { try {
// Use this class's classloader to load the mapping file // Use this class's classloader to load the mapping file
@ -1229,7 +1229,7 @@ public class MimeUtility {
} }
} }
private static void loadMappings(LineInputStream is, Hashtable table) { private static void loadMappings(LineInputStream is, Hashtable<String, String> table) {
String currLine; String currLine;
while (true) { while (true) {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -44,16 +44,16 @@ import java.util.Map;
public final class ParameterList { public final class ParameterList {
private final HashMap list; private final HashMap<String, String> list;
/** /**
* No-arg Constructor. * No-arg Constructor.
*/ */
public ParameterList() { public ParameterList() {
this.list = new HashMap(); this.list = new HashMap<String, String>();
} }
private ParameterList(HashMap m) { private ParameterList(HashMap<String, String> m) {
this.list = m; this.list = m;
} }
@ -73,7 +73,7 @@ public final class ParameterList {
int type; int type;
String name; String name;
list = new HashMap(); list = new HashMap<String, String>();
while (true) { while (true) {
tk = h.next(); tk = h.next();
type = tk.getType(); type = tk.getType();
@ -130,7 +130,7 @@ public final class ParameterList {
* present. * present.
*/ */
public String get(String name) { public String get(String name) {
return (String)list.get(name.trim().toLowerCase()); return list.get(name.trim().toLowerCase());
} }
/** /**
@ -160,7 +160,7 @@ public final class ParameterList {
* *
* @return Enumeration of all parameter names in this list. * @return Enumeration of all parameter names in this list.
*/ */
public Iterator getNames() { public Iterator<String> getNames() {
return list.keySet().iterator(); return list.keySet().iterator();
} }
@ -190,13 +190,13 @@ public final class ParameterList {
* @return String * @return String
*/ */
public String toString(int used) { public String toString(int used) {
StringBuffer sb = new StringBuffer(); StringBuilder sb = new StringBuilder();
Iterator itr = list.entrySet().iterator(); Iterator<Map.Entry<String, String>> itr = list.entrySet().iterator();
while (itr.hasNext()) { while (itr.hasNext()) {
Map.Entry e = (Map.Entry)itr.next(); Map.Entry<String, String> e = itr.next();
String name = (String)e.getKey(); String name = e.getKey();
String value = quote((String)e.getValue()); String value = quote(e.getValue());
sb.append("; "); sb.append("; ");
used += 2; used += 2;
int len = name.length() + value.length() + 1; int len = name.length() + value.length() + 1;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -60,7 +60,7 @@ class UniqueValue {
* and the current time (in milliseconds). * and the current time (in milliseconds).
*/ */
public static String getUniqueBoundaryValue() { public static String getUniqueBoundaryValue() {
StringBuffer s = new StringBuffer(); StringBuilder s = new StringBuilder();
// Unique string is ----=_Part_<part>_<hashcode>.<currentTime> // Unique string is ----=_Part_<part>_<hashcode>.<currentTime>
s.append("----=_Part_").append(part++).append("_"). s.append("----=_Part_").append(part++).append("_").

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -31,8 +31,6 @@
package com.sun.xml.internal.messaging.saaj.packaging.mime.util; package com.sun.xml.internal.messaging.saaj.packaging.mime.util;
import com.sun.xml.internal.messaging.saaj.util.ByteOutputStream;
import java.io.OutputStream; import java.io.OutputStream;
import java.io.IOException; import java.io.IOException;

View File

@ -70,9 +70,8 @@ abstract class ContextClassloaderLocal<V> {
} }
private static ClassLoader getContextClassLoader() { private static ClassLoader getContextClassLoader() {
return (ClassLoader) return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
AccessController.doPrivileged(new PrivilegedAction() { public ClassLoader run() {
public Object run() {
ClassLoader cl = null; ClassLoader cl = null;
try { try {
cl = Thread.currentThread().getContextClassLoader(); cl = Thread.currentThread().getContextClassLoader();

View File

@ -32,6 +32,7 @@ import com.sun.xml.internal.messaging.saaj.util.LogDomainConstants;
import com.sun.xml.internal.messaging.saaj.util.ParserPool; import com.sun.xml.internal.messaging.saaj.util.ParserPool;
import com.sun.xml.internal.messaging.saaj.util.RejectDoctypeSaxFilter; import com.sun.xml.internal.messaging.saaj.util.RejectDoctypeSaxFilter;
import com.sun.xml.internal.messaging.saaj.util.transform.EfficientStreamingTransformer; import com.sun.xml.internal.messaging.saaj.util.transform.EfficientStreamingTransformer;
import org.xml.sax.InputSource; import org.xml.sax.InputSource;
import org.xml.sax.XMLReader; import org.xml.sax.XMLReader;
@ -46,6 +47,9 @@ import javax.xml.transform.dom.DOMResult;
import javax.xml.transform.sax.SAXSource; import javax.xml.transform.sax.SAXSource;
import javax.xml.transform.stax.StAXSource; import javax.xml.transform.stax.StAXSource;
import javax.xml.transform.stream.StreamSource; import javax.xml.transform.stream.StreamSource;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.logging.Logger; import java.util.logging.Logger;
/** /**
@ -53,6 +57,8 @@ import java.util.logging.Logger;
* underlying implementations. * underlying implementations.
*/ */
public class EnvelopeFactory { public class EnvelopeFactory {
private static final String SAX_PARSER_POOL_SIZE_PROP_NAME = "com.sun.xml.internal.messaging.saaj.soap.saxParserPoolSize";
private static final int DEFAULT_SAX_PARSER_POOL_SIZE = 5;
protected static final Logger protected static final Logger
log = Logger.getLogger(LogDomainConstants.SOAP_DOMAIN, log = Logger.getLogger(LogDomainConstants.SOAP_DOMAIN,
@ -62,9 +68,22 @@ public class EnvelopeFactory {
new ContextClassloaderLocal<ParserPool>() { new ContextClassloaderLocal<ParserPool>() {
@Override @Override
protected ParserPool initialValue() throws Exception { protected ParserPool initialValue() throws Exception {
return new ParserPool(5); Integer poolSize = AccessController.doPrivileged(
new PrivilegedAction<Integer>() {
@Override
public Integer run() {
try {
return Integer.getInteger(
SAX_PARSER_POOL_SIZE_PROP_NAME,
DEFAULT_SAX_PARSER_POOL_SIZE);
} catch (SecurityException se) {
return DEFAULT_SAX_PARSER_POOL_SIZE;
}
}
});
return new ParserPool(poolSize);
} }
}; };
public static Envelope createEnvelope(Source src, SOAPPartImpl soapPart) public static Envelope createEnvelope(Source src, SOAPPartImpl soapPart)
throws SOAPException throws SOAPException
@ -132,51 +151,55 @@ public class EnvelopeFactory {
} }
private static Envelope parseEnvelopeSax(Source src, SOAPPartImpl soapPart) private static Envelope parseEnvelopeSax(Source src, SOAPPartImpl soapPart)
throws SOAPException { throws SOAPException {
// Insert SAX filter to disallow Document Type Declarations since
// they are not legal in SOAP
SAXParser saxParser = null; SAXParser saxParser = null;
if (src instanceof StreamSource) {
try {
saxParser = parserPool.get().get();
} catch (Exception e) {
log.severe("SAAJ0601.util.newSAXParser.exception");
throw new SOAPExceptionImpl(
"Couldn't get a SAX parser while constructing a envelope",
e);
}
InputSource is = SAXSource.sourceToInputSource(src);
if (is.getEncoding()== null && soapPart.getSourceCharsetEncoding() != null) {
is.setEncoding(soapPart.getSourceCharsetEncoding());
}
XMLReader rejectFilter;
try {
rejectFilter = new RejectDoctypeSaxFilter(saxParser);
} catch (Exception ex) {
log.severe("SAAJ0510.soap.cannot.create.envelope");
throw new SOAPExceptionImpl(
"Unable to create envelope from given source: ",
ex);
}
src = new SAXSource(rejectFilter, is);
}
try { try {
Transformer transformer = // Insert SAX filter to disallow Document Type Declarations since
EfficientStreamingTransformer.newTransformer(); // they are not legal in SOAP
DOMResult result = new DOMResult(soapPart);
transformer.transform(src, result);
Envelope env = (Envelope) soapPart.getEnvelope(); if (src instanceof StreamSource) {
return env; try {
} catch (Exception ex) { saxParser = parserPool.get().get();
if (ex instanceof SOAPVersionMismatchException) { } catch (Exception e) {
throw (SOAPVersionMismatchException) ex; log.severe("SAAJ0601.util.newSAXParser.exception");
} throw new SOAPExceptionImpl(
log.severe("SAAJ0511.soap.cannot.create.envelope"); "Couldn't get a SAX parser while constructing a envelope",
throw new SOAPExceptionImpl( e);
"Unable to create envelope from given source: ", }
ex); InputSource is = SAXSource.sourceToInputSource(src);
if (is.getEncoding()== null && soapPart.getSourceCharsetEncoding() != null) {
is.setEncoding(soapPart.getSourceCharsetEncoding());
}
XMLReader rejectFilter;
try {
rejectFilter = new RejectDoctypeSaxFilter(saxParser);
} catch (Exception ex) {
log.severe("SAAJ0510.soap.cannot.create.envelope");
throw new SOAPExceptionImpl(
"Unable to create envelope from given source: ",
ex);
}
src = new SAXSource(rejectFilter, is);
}
try {
Transformer transformer =
EfficientStreamingTransformer.newTransformer();
DOMResult result = new DOMResult(soapPart);
transformer.transform(src, result);
Envelope env = (Envelope) soapPart.getEnvelope();
return env;
} catch (Exception ex) {
if (ex instanceof SOAPVersionMismatchException) {
throw (SOAPVersionMismatchException) ex;
}
log.severe("SAAJ0511.soap.cannot.create.envelope");
throw new SOAPExceptionImpl(
"Unable to create envelope from given source: ",
ex);
}
} finally { } finally {
//no matter what condition occurs, always return the parser to the pool
if (saxParser != null) { if (saxParser != null) {
parserPool.get().returnParser(saxParser); parserPool.get().returnParser(saxParser);
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -131,9 +131,9 @@ public class ImageDataContentHandler extends Component
+ obj.getClass().toString()); + obj.getClass().toString());
} }
ImageWriter writer = null; ImageWriter writer = null;
Iterator i = ImageIO.getImageWritersByMIMEType(type); Iterator<ImageWriter> i = ImageIO.getImageWritersByMIMEType(type);
if (i.hasNext()) { if (i.hasNext()) {
writer = (ImageWriter)i.next(); writer = i.next();
} }
if (writer != null) { if (writer != null) {
ImageOutputStream stream = null; ImageOutputStream stream = null;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -83,7 +83,7 @@ public abstract class MessageImpl
protected MimeHeaders headers; protected MimeHeaders headers;
protected ContentType contentType; protected ContentType contentType;
protected SOAPPartImpl soapPartImpl; protected SOAPPartImpl soapPartImpl;
protected FinalArrayList attachments; protected FinalArrayList<AttachmentPart> attachments;
protected boolean saved = false; protected boolean saved = false;
protected byte[] messageBytes; protected byte[] messageBytes;
protected int messageByteCount; protected int messageByteCount;
@ -855,7 +855,7 @@ public abstract class MessageImpl
throw new RuntimeException(e); throw new RuntimeException(e);
} }
if (attachments == null) if (attachments == null)
attachments = new FinalArrayList(); attachments = new FinalArrayList<AttachmentPart>();
attachments.add(attachment); attachments.add(attachment);
@ -887,15 +887,15 @@ public abstract class MessageImpl
headers.setHeader("Content-Type", ct.toString()); headers.setHeader("Content-Type", ct.toString());
} }
private class MimeMatchingIterator implements Iterator { private class MimeMatchingIterator implements Iterator<AttachmentPart> {
public MimeMatchingIterator(MimeHeaders headers) { public MimeMatchingIterator(MimeHeaders headers) {
this.headers = headers; this.headers = headers;
this.iter = attachments.iterator(); this.iter = attachments.iterator();
} }
private Iterator iter; private Iterator<AttachmentPart> iter;
private MimeHeaders headers; private MimeHeaders headers;
private Object nextAttachment; private AttachmentPart nextAttachment;
public boolean hasNext() { public boolean hasNext() {
if (nextAttachment == null) if (nextAttachment == null)
@ -903,9 +903,9 @@ public abstract class MessageImpl
return nextAttachment != null; return nextAttachment != null;
} }
public Object next() { public AttachmentPart next() {
if (nextAttachment != null) { if (nextAttachment != null) {
Object ret = nextAttachment; AttachmentPart ret = nextAttachment;
nextAttachment = null; nextAttachment = null;
return ret; return ret;
} }
@ -916,7 +916,7 @@ public abstract class MessageImpl
return null; return null;
} }
Object nextMatch() { AttachmentPart nextMatch() {
while (iter.hasNext()) { while (iter.hasNext()) {
AttachmentPartImpl ap = (AttachmentPartImpl) iter.next(); AttachmentPartImpl ap = (AttachmentPartImpl) iter.next();
if (ap.hasAllHeaders(headers)) if (ap.hasAllHeaders(headers))
@ -951,12 +951,12 @@ public abstract class MessageImpl
if (attachments == null) if (attachments == null)
return ; return ;
Iterator it = new MimeMatchingIterator(headers); Iterator<AttachmentPart> it = new MimeMatchingIterator(headers);
while (it.hasNext()) { while (it.hasNext()) {
int index = attachments.indexOf(it.next()); int index = attachments.indexOf(it.next());
attachments.set(index, null); attachments.set(index, null);
} }
FinalArrayList f = new FinalArrayList(); FinalArrayList<AttachmentPart> f = new FinalArrayList<AttachmentPart>();
for (int i = 0; i < attachments.size(); i++) { for (int i = 0; i < attachments.size(); i++) {
if (attachments.get(i) != null) { if (attachments.get(i) != null) {
f.add(attachments.get(i)); f.add(attachments.get(i));
@ -1066,7 +1066,7 @@ public abstract class MessageImpl
} }
private String convertToSingleLine(String contentType) { private String convertToSingleLine(String contentType) {
StringBuffer buffer = new StringBuffer(); StringBuilder buffer = new StringBuilder();
for (int i = 0; i < contentType.length(); i ++) { for (int i = 0; i < contentType.length(); i ++) {
char c = contentType.charAt(i); char c = contentType.charAt(i);
if (c != '\r' && c != '\n' && c != '\t') if (c != '\r' && c != '\n' && c != '\t')
@ -1098,7 +1098,7 @@ public abstract class MessageImpl
headerAndBody = new BMMimeMultipart(); headerAndBody = new BMMimeMultipart();
headerAndBody.addBodyPart(mimeSoapPart); headerAndBody.addBodyPart(mimeSoapPart);
if (attachments != null) { if (attachments != null) {
for (Iterator eachAttachment = attachments.iterator(); for (Iterator<AttachmentPart> eachAttachment = attachments.iterator();
eachAttachment.hasNext();) { eachAttachment.hasNext();) {
headerAndBody.addBodyPart( headerAndBody.addBodyPart(
((AttachmentPartImpl) eachAttachment.next()) ((AttachmentPartImpl) eachAttachment.next())
@ -1424,7 +1424,7 @@ public abstract class MessageImpl
} }
if (attachments == null) if (attachments == null)
attachments = new FinalArrayList(); attachments = new FinalArrayList<AttachmentPart>();
int count = multiPart.getCount(); int count = multiPart.getCount();
for (int i=0; i < count; i++ ) { for (int i=0; i < count; i++ ) {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -32,7 +32,6 @@ import javax.xml.namespace.QName;
import javax.xml.soap.*; import javax.xml.soap.*;
import com.sun.xml.internal.messaging.saaj.soap.impl.ElementFactory; import com.sun.xml.internal.messaging.saaj.soap.impl.ElementFactory;
import com.sun.xml.internal.messaging.saaj.soap.impl.ElementImpl;
import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl; import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl;
import com.sun.xml.internal.messaging.saaj.util.*; import com.sun.xml.internal.messaging.saaj.util.*;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -27,6 +27,7 @@ package com.sun.xml.internal.messaging.saaj.soap;
import javax.xml.namespace.QName; import javax.xml.namespace.QName;
import javax.xml.soap.SOAPException; import javax.xml.soap.SOAPException;
import javax.xml.stream.XMLStreamConstants;
import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader; import javax.xml.stream.XMLStreamReader;
import javax.xml.stream.XMLStreamWriter; import javax.xml.stream.XMLStreamWriter;
@ -76,7 +77,7 @@ public class StaxLazySourceBridge extends StaxBridge {
public String getPayloadAttributeValue(String attName) { public String getPayloadAttributeValue(String attName) {
if (lazySource.isPayloadStreamReader()) { if (lazySource.isPayloadStreamReader()) {
XMLStreamReader reader = lazySource.readPayload(); XMLStreamReader reader = lazySource.readPayload();
if (reader.getEventType() == reader.START_ELEMENT) { if (reader.getEventType() == XMLStreamConstants.START_ELEMENT) {
return reader.getAttributeValue(null, attName); return reader.getAttributeValue(null, attName);
} }
} }
@ -87,7 +88,7 @@ public class StaxLazySourceBridge extends StaxBridge {
public String getPayloadAttributeValue(QName attName) { public String getPayloadAttributeValue(QName attName) {
if (lazySource.isPayloadStreamReader()) { if (lazySource.isPayloadStreamReader()) {
XMLStreamReader reader = lazySource.readPayload(); XMLStreamReader reader = lazySource.readPayload();
if (reader.getEventType() == reader.START_ELEMENT) { if (reader.getEventType() == XMLStreamConstants.START_ELEMENT) {
return reader.getAttributeValue(attName.getNamespaceURI(), attName.getLocalPart()); return reader.getAttributeValue(attName.getNamespaceURI(), attName.getLocalPart());
} }
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -27,6 +27,7 @@ package com.sun.xml.internal.messaging.saaj.soap;
import javax.xml.namespace.QName; import javax.xml.namespace.QName;
import javax.xml.soap.SOAPException; import javax.xml.soap.SOAPException;
import javax.xml.stream.XMLStreamConstants;
import javax.xml.stream.XMLStreamReader; import javax.xml.stream.XMLStreamReader;
import com.sun.xml.internal.org.jvnet.staxex.util.XMLStreamReaderToXMLStreamWriter; import com.sun.xml.internal.org.jvnet.staxex.util.XMLStreamReaderToXMLStreamWriter;
@ -65,14 +66,14 @@ public class StaxReaderBridge extends StaxBridge {
} }
public QName getPayloadQName() { public QName getPayloadQName() {
return (in.getEventType() == in.START_ELEMENT) ? in.getName() : null; return (in.getEventType() == XMLStreamConstants.START_ELEMENT) ? in.getName() : null;
} }
public String getPayloadAttributeValue(String attName) { public String getPayloadAttributeValue(String attName) {
return (in.getEventType() == in.START_ELEMENT) ? in.getAttributeValue(null, attName) : null; return (in.getEventType() == XMLStreamConstants.START_ELEMENT) ? in.getAttributeValue(null, attName) : null;
} }
public String getPayloadAttributeValue(QName attName) { public String getPayloadAttributeValue(QName attName) {
return (in.getEventType() == in.START_ELEMENT) ? in.getAttributeValue(attName.getNamespaceURI(), attName.getLocalPart()) : null; return (in.getEventType() == XMLStreamConstants.START_ELEMENT) ? in.getAttributeValue(attName.getNamespaceURI(), attName.getLocalPart()) : null;
} }
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -30,7 +30,6 @@ import java.io.*;
import javax.activation.*; import javax.activation.*;
import com.sun.xml.internal.messaging.saaj.packaging.mime.internet.MimeUtility; import com.sun.xml.internal.messaging.saaj.packaging.mime.internet.MimeUtility;
import com.sun.xml.internal.messaging.saaj.packaging.mime.util.ASCIIUtility;
import com.sun.xml.internal.messaging.saaj.packaging.mime.internet.ContentType; import com.sun.xml.internal.messaging.saaj.packaging.mime.internet.ContentType;
/** /**

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -44,7 +44,7 @@ import com.sun.xml.internal.messaging.saaj.util.transform.EfficientStreamingTran
*/ */
public class XmlDataContentHandler implements DataContentHandler { public class XmlDataContentHandler implements DataContentHandler {
public static final String STR_SRC = "javax.xml.transform.stream.StreamSource"; public static final String STR_SRC = "javax.xml.transform.stream.StreamSource";
private static Class streamSourceClass = null; private static Class<?> streamSourceClass = null;
public XmlDataContentHandler() throws ClassNotFoundException { public XmlDataContentHandler() throws ClassNotFoundException {
if (streamSourceClass == null) { if (streamSourceClass == null) {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -29,12 +29,9 @@
*/ */
package com.sun.xml.internal.messaging.saaj.soap.dynamic; package com.sun.xml.internal.messaging.saaj.soap.dynamic;
import java.io.IOException;
import java.io.InputStream;
import javax.xml.soap.*; import javax.xml.soap.*;
import com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl;
import com.sun.xml.internal.messaging.saaj.soap.MessageFactoryImpl; import com.sun.xml.internal.messaging.saaj.soap.MessageFactoryImpl;
public class SOAPMessageFactoryDynamicImpl extends MessageFactoryImpl { public class SOAPMessageFactoryDynamicImpl extends MessageFactoryImpl {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -131,7 +131,7 @@ public abstract class BodyImpl extends ElementImpl implements SOAPBody {
} }
protected SOAPElement findFault() { protected SOAPElement findFault() {
Iterator eachChild = getChildElementNodes(); Iterator<Node> eachChild = getChildElementNodes();
while (eachChild.hasNext()) { while (eachChild.hasNext()) {
SOAPElement child = (SOAPElement) eachChild.next(); SOAPElement child = (SOAPElement) eachChild.next();
if (isFault(child)) { if (isFault(child)) {
@ -247,7 +247,7 @@ public abstract class BodyImpl extends ElementImpl implements SOAPBody {
org.w3c.dom.Node replacingNode = ownerDoc.importNode(docFrag, true); org.w3c.dom.Node replacingNode = ownerDoc.importNode(docFrag, true);
// Adding replacingNode at the last of the children list of body // Adding replacingNode at the last of the children list of body
addNode(replacingNode); addNode(replacingNode);
Iterator i = Iterator<Node> i =
getChildElements(NameImpl.copyElementName(rootElement)); getChildElements(NameImpl.copyElementName(rootElement));
// Return the child element with the required name which is at the // Return the child element with the required name which is at the
// end of the list // end of the list
@ -284,7 +284,7 @@ public abstract class BodyImpl extends ElementImpl implements SOAPBody {
public Document extractContentAsDocument() throws SOAPException { public Document extractContentAsDocument() throws SOAPException {
Iterator eachChild = getChildElements(); Iterator<Node> eachChild = getChildElements();
javax.xml.soap.Node firstBodyElement = null; javax.xml.soap.Node firstBodyElement = null;
while (eachChild.hasNext() && while (eachChild.hasNext() &&
@ -314,8 +314,7 @@ public abstract class BodyImpl extends ElementImpl implements SOAPBody {
Document document = null; Document document = null;
try { try {
DocumentBuilderFactory factory = DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
new com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl();
factory.setNamespaceAware(true); factory.setNamespaceAware(true);
DocumentBuilder builder = factory.newDocumentBuilder(); DocumentBuilder builder = factory.newDocumentBuilder();
document = builder.newDocument(); document = builder.newDocument();

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -77,8 +77,8 @@ public abstract class DetailImpl extends FaultElementImpl implements Detail {
} }
public Iterator getDetailEntries() { public Iterator getDetailEntries() {
return new Iterator() { return new Iterator<SOAPElement>() {
Iterator eachNode = getChildElementNodes(); Iterator<org.w3c.dom.Node> eachNode = getChildElementNodes();
SOAPElement next = null; SOAPElement next = null;
SOAPElement last = null; SOAPElement last = null;
@ -95,7 +95,7 @@ public abstract class DetailImpl extends FaultElementImpl implements Detail {
return next != null; return next != null;
} }
public Object next() { public SOAPElement next() {
if (!hasNext()) { if (!hasNext()) {
throw new NoSuchElementException(); throw new NoSuchElementException();
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -162,8 +162,8 @@ public class ElementImpl
!(currentAncestor instanceof Document)) { !(currentAncestor instanceof Document)) {
if (currentAncestor instanceof ElementImpl) { if (currentAncestor instanceof ElementImpl) {
QName name = ((ElementImpl) currentAncestor).getElementQName();
/* /*
QName name = ((ElementImpl) currentAncestor).getElementQName();
if (prefix.equals(name.getPrefix())) { if (prefix.equals(name.getPrefix())) {
String uri = name.getNamespaceURI(); String uri = name.getNamespaceURI();
if ("".equals(uri)) { if ("".equals(uri)) {
@ -339,7 +339,7 @@ public class ElementImpl
log.severe("SAAJ0158.impl.version.mismatch.fault"); log.severe("SAAJ0158.impl.version.mismatch.fault");
throw new SOAPExceptionImpl("SOAP Version mismatch encountered when trying to add SOAPFault to SOAPBody"); throw new SOAPExceptionImpl("SOAP Version mismatch encountered when trying to add SOAPFault to SOAPBody");
} }
Iterator it = this.getChildElements(); Iterator<Node> it = this.getChildElements();
if (it.hasNext()) { if (it.hasNext()) {
log.severe("SAAJ0156.impl.adding.fault.error"); log.severe("SAAJ0156.impl.adding.fault.error");
throw new SOAPExceptionImpl("Cannot add SOAPFault as a child of a non-Empty SOAPBody"); throw new SOAPExceptionImpl("Cannot add SOAPFault as a child of a non-Empty SOAPBody");
@ -450,7 +450,7 @@ public class ElementImpl
} }
protected SOAPElement findAndConvertChildElement(NameImpl name) { protected SOAPElement findAndConvertChildElement(NameImpl name) {
Iterator eachChild = getChildElementNodes(); Iterator<Node> eachChild = getChildElementNodes();
while (eachChild.hasNext()) { while (eachChild.hasNext()) {
SOAPElement child = (SOAPElement) eachChild.next(); SOAPElement child = (SOAPElement) eachChild.next();
if (child.getElementName().equals(name)) { if (child.getElementName().equals(name)) {
@ -560,10 +560,10 @@ public class ElementImpl
} }
public Iterator getAllAttributes() { public Iterator getAllAttributes() {
Iterator i = getAllAttributesFrom(this); Iterator<Name> i = getAllAttributesFrom(this);
ArrayList list = new ArrayList(); ArrayList<Name> list = new ArrayList<Name>();
while (i.hasNext()) { while (i.hasNext()) {
Name name = (Name) i.next(); Name name = i.next();
if (!"xmlns".equalsIgnoreCase(name.getPrefix())) if (!"xmlns".equalsIgnoreCase(name.getPrefix()))
list.add(name); list.add(name);
} }
@ -571,10 +571,10 @@ public class ElementImpl
} }
public Iterator getAllAttributesAsQNames() { public Iterator getAllAttributesAsQNames() {
Iterator i = getAllAttributesFrom(this); Iterator<Name> i = getAllAttributesFrom(this);
ArrayList list = new ArrayList(); ArrayList<QName> list = new ArrayList<QName>();
while (i.hasNext()) { while (i.hasNext()) {
Name name = (Name) i.next(); Name name = i.next();
if (!"xmlns".equalsIgnoreCase(name.getPrefix())) { if (!"xmlns".equalsIgnoreCase(name.getPrefix())) {
list.add(NameImpl.convertToQName(name)); list.add(NameImpl.convertToQName(name));
} }
@ -591,8 +591,8 @@ public class ElementImpl
return doGetNamespacePrefixes(true); return doGetNamespacePrefixes(true);
} }
protected Iterator doGetNamespacePrefixes(final boolean deep) { protected Iterator<String> doGetNamespacePrefixes(final boolean deep) {
return new Iterator() { return new Iterator<String>() {
String next = null; String next = null;
String last = null; String last = null;
NamespaceContextIterator eachNamespace = NamespaceContextIterator eachNamespace =
@ -613,7 +613,7 @@ public class ElementImpl
return next != null; return next != null;
} }
public Object next() { public String next() {
findNext(); findNext();
if (next == null) { if (next == null) {
throw new NoSuchElementException(); throw new NoSuchElementException();
@ -676,7 +676,7 @@ public class ElementImpl
return true; return true;
} }
public Iterator getChildElements() { public Iterator<Node> getChildElements() {
return getChildElementsFrom(this); return getChildElementsFrom(this);
} }
@ -694,15 +694,15 @@ public class ElementImpl
Element element, Element element,
ElementImpl copy) { ElementImpl copy) {
Iterator eachAttribute = getAllAttributesFrom(element); Iterator<Name> eachAttribute = getAllAttributesFrom(element);
while (eachAttribute.hasNext()) { while (eachAttribute.hasNext()) {
Name name = (Name) eachAttribute.next(); Name name = eachAttribute.next();
copy.addAttributeBare(name, getAttributeValueFrom(element, name)); copy.addAttributeBare(name, getAttributeValueFrom(element, name));
} }
Iterator eachChild = getChildElementsFrom(element); Iterator<Node> eachChild = getChildElementsFrom(element);
while (eachChild.hasNext()) { while (eachChild.hasNext()) {
Node nextChild = (Node) eachChild.next(); Node nextChild = eachChild.next();
copy.insertBefore(nextChild, null); copy.insertBefore(nextChild, null);
} }
@ -714,16 +714,16 @@ public class ElementImpl
return copy; return copy;
} }
protected Iterator getChildElementNodes() { protected Iterator<Node> getChildElementNodes() {
return new Iterator() { return new Iterator<Node>() {
Iterator eachNode = getChildElements(); Iterator<Node> eachNode = getChildElements();
Node next = null; Node next = null;
Node last = null; Node last = null;
public boolean hasNext() { public boolean hasNext() {
if (next == null) { if (next == null) {
while (eachNode.hasNext()) { while (eachNode.hasNext()) {
Node node = (Node) eachNode.next(); Node node = eachNode.next();
if (node instanceof SOAPElement) { if (node instanceof SOAPElement) {
next = node; next = node;
break; break;
@ -733,7 +733,7 @@ public class ElementImpl
return next != null; return next != null;
} }
public Object next() { public Node next() {
if (hasNext()) { if (hasNext()) {
last = next; last = next;
next = null; next = null;
@ -761,16 +761,16 @@ public class ElementImpl
return getChildElements(qname.getNamespaceURI(), qname.getLocalPart()); return getChildElements(qname.getNamespaceURI(), qname.getLocalPart());
} }
private Iterator getChildElements(final String nameUri, final String nameLocal) { private Iterator<Node> getChildElements(final String nameUri, final String nameLocal) {
return new Iterator() { return new Iterator<Node>() {
Iterator eachElement = getChildElementNodes(); Iterator<Node> eachElement = getChildElementNodes();
Node next = null; Node next = null;
Node last = null; Node last = null;
public boolean hasNext() { public boolean hasNext() {
if (next == null) { if (next == null) {
while (eachElement.hasNext()) { while (eachElement.hasNext()) {
Node element = (Node) eachElement.next(); Node element = eachElement.next();
String elementUri = element.getNamespaceURI(); String elementUri = element.getNamespaceURI();
elementUri = elementUri == null ? "" : elementUri; elementUri = elementUri == null ? "" : elementUri;
String elementName = element.getLocalName(); String elementName = element.getLocalName();
@ -784,7 +784,7 @@ public class ElementImpl
return next != null; return next != null;
} }
public Object next() { public Node next() {
if (!hasNext()) { if (!hasNext()) {
throw new NoSuchElementException(); throw new NoSuchElementException();
} }
@ -894,7 +894,7 @@ public class ElementImpl
} }
protected javax.xml.soap.Node getValueNode() { protected javax.xml.soap.Node getValueNode() {
Iterator i = getChildElements(); Iterator<Node> i = getChildElements();
while (i.hasNext()) { while (i.hasNext()) {
javax.xml.soap.Node n = (javax.xml.soap.Node) i.next(); javax.xml.soap.Node n = (javax.xml.soap.Node) i.next();
if (n.getNodeType() == org.w3c.dom.Node.TEXT_NODE || if (n.getNodeType() == org.w3c.dom.Node.TEXT_NODE ||
@ -1054,10 +1054,10 @@ public class ElementImpl
return null; return null;
} }
protected static Iterator getAllAttributesFrom(final Element element) { protected static Iterator<Name> getAllAttributesFrom(final Element element) {
final NamedNodeMap attributes = element.getAttributes(); final NamedNodeMap attributes = element.getAttributes();
return new Iterator() { return new Iterator<Name>() {
int attributesLength = attributes.getLength(); int attributesLength = attributes.getLength();
int attributeIndex = 0; int attributeIndex = 0;
String currentName; String currentName;
@ -1066,7 +1066,7 @@ public class ElementImpl
return attributeIndex < attributesLength; return attributeIndex < attributesLength;
} }
public Object next() { public Name next() {
if (!hasNext()) { if (!hasNext()) {
throw new NoSuchElementException(); throw new NoSuchElementException();
} }
@ -1133,8 +1133,8 @@ public class ElementImpl
return attribute == null ? null : attribute.getValue(); return attribute == null ? null : attribute.getValue();
} }
protected static Iterator getChildElementsFrom(final Element element) { protected static Iterator<Node> getChildElementsFrom(final Element element) {
return new Iterator() { return new Iterator<Node>() {
Node next = element.getFirstChild(); Node next = element.getFirstChild();
Node nextNext = null; Node nextNext = null;
Node last = null; Node last = null;
@ -1150,7 +1150,7 @@ public class ElementImpl
return next != null; return next != null;
} }
public Object next() { public Node next() {
if (hasNext()) { if (hasNext()) {
last = next; last = next;
next = null; next = null;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -248,10 +248,6 @@ public abstract class EnvelopeImpl extends ElementImpl implements LazyEnvelope {
this.xmlDecl = value; this.xmlDecl = value;
} }
private String getOmitXmlDecl() {
return this.omitXmlDecl;
}
public void setCharsetEncoding(String value) { public void setCharsetEncoding(String value) {
charset = value; charset = value;
} }
@ -309,7 +305,6 @@ public abstract class EnvelopeImpl extends ElementImpl implements LazyEnvelope {
else { else {
try { try {
// Run transform and generate FI output from content // Run transform and generate FI output from content
Source source = getContent();
Transformer transformer = EfficientStreamingTransformer.newTransformer(); Transformer transformer = EfficientStreamingTransformer.newTransformer();
transformer.transform(getContent(), transformer.transform(getContent(),
FastInfosetReflection.FastInfosetResult_new(out)); FastInfosetReflection.FastInfosetResult_new(out));

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -32,7 +32,6 @@ import javax.xml.namespace.QName;
import javax.xml.soap.*; import javax.xml.soap.*;
import org.w3c.dom.Element; import org.w3c.dom.Element;
import org.w3c.dom.Node;
import com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl; import com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl;
import com.sun.xml.internal.messaging.saaj.soap.SOAPDocument; import com.sun.xml.internal.messaging.saaj.soap.SOAPDocument;
@ -116,7 +115,7 @@ public abstract class HeaderImpl extends ElementImpl implements SOAPHeader {
return getHeaderElementsForActor(actor, true, false); return getHeaderElementsForActor(actor, true, false);
} }
protected Iterator getHeaderElementsForActor( protected Iterator<SOAPHeaderElement> getHeaderElementsForActor(
String actor, String actor,
boolean detach, boolean detach,
boolean mustUnderstand) { boolean mustUnderstand) {
@ -127,15 +126,15 @@ public abstract class HeaderImpl extends ElementImpl implements SOAPHeader {
return getHeaderElements(actor, detach, mustUnderstand); return getHeaderElements(actor, detach, mustUnderstand);
} }
protected Iterator getHeaderElements( protected Iterator<SOAPHeaderElement> getHeaderElements(
String actor, String actor,
boolean detach, boolean detach,
boolean mustUnderstand) { boolean mustUnderstand) {
List elementList = new ArrayList(); List<SOAPHeaderElement> elementList = new ArrayList<SOAPHeaderElement>();
Iterator eachChild = getChildElements(); Iterator<org.w3c.dom.Node> eachChild = getChildElements();
Object currentChild = iterate(eachChild); org.w3c.dom.Node currentChild = iterate(eachChild);
while (currentChild != null) { while (currentChild != null) {
if (!(currentChild instanceof SOAPHeaderElement)) { if (!(currentChild instanceof SOAPHeaderElement)) {
currentChild = iterate(eachChild); currentChild = iterate(eachChild);
@ -173,7 +172,7 @@ public abstract class HeaderImpl extends ElementImpl implements SOAPHeader {
return elementList.listIterator(); return elementList.listIterator();
} }
private Object iterate(Iterator each) { private <T> T iterate(Iterator<T> each) {
return each.hasNext() ? each.next() : null; return each.hasNext() ? each.next() : null;
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -36,11 +36,9 @@ import java.util.logging.Level;
import javax.xml.namespace.QName; import javax.xml.namespace.QName;
import javax.xml.soap.SOAPElement; import javax.xml.soap.SOAPElement;
import javax.xml.soap.SOAPFaultElement;
import javax.xml.soap.SOAPException; import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPConstants; import javax.xml.soap.SOAPConstants;
import javax.xml.soap.Name; import javax.xml.soap.Name;
import javax.xml.soap.Name;
import com.sun.xml.internal.messaging.saaj.soap.SOAPDocument; import com.sun.xml.internal.messaging.saaj.soap.SOAPDocument;
import com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl; import com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -29,8 +29,6 @@
*/ */
package com.sun.xml.internal.messaging.saaj.soap.ver1_1; package com.sun.xml.internal.messaging.saaj.soap.ver1_1;
import java.util.List;
import java.util.Iterator;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -29,7 +29,6 @@
*/ */
package com.sun.xml.internal.messaging.saaj.soap.ver1_1; package com.sun.xml.internal.messaging.saaj.soap.ver1_1;
import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
import javax.xml.soap.SOAPConstants; import javax.xml.soap.SOAPConstants;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -30,7 +30,6 @@
package com.sun.xml.internal.messaging.saaj.soap.ver1_2; package com.sun.xml.internal.messaging.saaj.soap.ver1_2;
import java.util.logging.Logger; import java.util.logging.Logger;
import java.util.Locale;
import javax.xml.namespace.QName; import javax.xml.namespace.QName;
import javax.xml.soap.*; import javax.xml.soap.*;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -146,7 +146,7 @@ public class Fault1_2Impl extends FaultImpl {
findReasonElement(); findReasonElement();
Iterator eachTextElement = Iterator eachTextElement =
this.faultStringElement.getChildElements(textName); this.faultStringElement.getChildElements(textName);
List texts = new ArrayList(); List<String> texts = new ArrayList<String>();
while (eachTextElement.hasNext()) { while (eachTextElement.hasNext()) {
SOAPElement textElement = (SOAPElement) eachTextElement.next(); SOAPElement textElement = (SOAPElement) eachTextElement.next();
Locale thisLocale = getLocale(textElement); Locale thisLocale = getLocale(textElement);
@ -235,7 +235,7 @@ public class Fault1_2Impl extends FaultImpl {
findReasonElement(); findReasonElement();
Iterator eachTextElement = Iterator eachTextElement =
this.faultStringElement.getChildElements(textName); this.faultStringElement.getChildElements(textName);
List localeSet = new ArrayList(); List<Locale> localeSet = new ArrayList<Locale>();
while (eachTextElement.hasNext()) { while (eachTextElement.hasNext()) {
SOAPElement textElement = (SOAPElement) eachTextElement.next(); SOAPElement textElement = (SOAPElement) eachTextElement.next();
Locale thisLocale = getLocale(textElement); Locale thisLocale = getLocale(textElement);
@ -435,7 +435,7 @@ public class Fault1_2Impl extends FaultImpl {
public Iterator getFaultSubcodes() { public Iterator getFaultSubcodes() {
if (this.faultCodeElement == null) if (this.faultCodeElement == null)
findFaultCodeElement(); findFaultCodeElement();
final List subcodeList = new ArrayList(); final List<QName> subcodeList = new ArrayList<QName>();
SOAPElement currentCodeElement = this.faultCodeElement; SOAPElement currentCodeElement = this.faultCodeElement;
Iterator subcodeElements = Iterator subcodeElements =
currentCodeElement.getChildElements(subcodeName); currentCodeElement.getChildElements(subcodeName);
@ -449,14 +449,14 @@ public class Fault1_2Impl extends FaultImpl {
subcodeElements = currentCodeElement.getChildElements(subcodeName); subcodeElements = currentCodeElement.getChildElements(subcodeName);
} }
//return subcodeList.iterator(); //return subcodeList.iterator();
return new Iterator() { return new Iterator<QName>() {
Iterator subCodeIter = subcodeList.iterator(); Iterator<QName> subCodeIter = subcodeList.iterator();
public boolean hasNext() { public boolean hasNext() {
return subCodeIter.hasNext(); return subCodeIter.hasNext();
} }
public Object next() { public QName next() {
return subCodeIter.next(); return subCodeIter.next();
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -29,8 +29,6 @@
*/ */
package com.sun.xml.internal.messaging.saaj.soap.ver1_2; package com.sun.xml.internal.messaging.saaj.soap.ver1_2;
import java.util.List;
import java.util.Iterator;
import java.util.logging.Logger; import java.util.logging.Logger;
import java.util.logging.Level; import java.util.logging.Level;
@ -40,7 +38,6 @@ import javax.xml.soap.*;
import com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl; import com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl;
import com.sun.xml.internal.messaging.saaj.soap.SOAPDocument; import com.sun.xml.internal.messaging.saaj.soap.SOAPDocument;
import com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl; import com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl;
import com.sun.xml.internal.messaging.saaj.soap.impl.HeaderElementImpl;
import com.sun.xml.internal.messaging.saaj.soap.impl.HeaderImpl; import com.sun.xml.internal.messaging.saaj.soap.impl.HeaderImpl;
import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl; import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl;
import com.sun.xml.internal.messaging.saaj.util.LogDomainConstants; import com.sun.xml.internal.messaging.saaj.util.LogDomainConstants;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -29,8 +29,6 @@
*/ */
package com.sun.xml.internal.messaging.saaj.soap.ver1_2; package com.sun.xml.internal.messaging.saaj.soap.ver1_2;
import java.util.logging.Logger;
import javax.xml.namespace.QName; import javax.xml.namespace.QName;
import javax.xml.soap.Name; import javax.xml.soap.Name;
import javax.xml.soap.SOAPElement; import javax.xml.soap.SOAPElement;
@ -42,10 +40,6 @@ import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl;
public class HeaderElement1_2Impl extends HeaderElementImpl { public class HeaderElement1_2Impl extends HeaderElementImpl {
private static final Logger log =
Logger.getLogger(HeaderElement1_2Impl.class.getName(),
"com.sun.xml.internal.messaging.saaj.soap.ver1_2.LocalStrings");
public HeaderElement1_2Impl(SOAPDocumentImpl ownerDoc, Name qname) { public HeaderElement1_2Impl(SOAPDocumentImpl ownerDoc, Name qname) {
super(ownerDoc, qname); super(ownerDoc, qname);
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -29,7 +29,6 @@
*/ */
package com.sun.xml.internal.messaging.saaj.soap.ver1_2; package com.sun.xml.internal.messaging.saaj.soap.ver1_2;
import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
import javax.xml.soap.SOAPConstants; import javax.xml.soap.SOAPConstants;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -47,7 +47,6 @@ public final class Base64 {
static private final int TWENTYFOURBITGROUP = 24; static private final int TWENTYFOURBITGROUP = 24;
static private final int EIGHTBIT = 8; static private final int EIGHTBIT = 8;
static private final int SIXTEENBIT = 16; static private final int SIXTEENBIT = 16;
static private final int SIXBIT = 6;
static private final int FOURBYTE = 4; static private final int FOURBYTE = 4;
@ -244,7 +243,7 @@ public final class Base64 {
public static String base64Decode( String orig ) { public static String base64Decode( String orig ) {
char chars[]=orig.toCharArray(); char chars[]=orig.toCharArray();
StringBuffer sb=new StringBuffer(); StringBuilder sb=new StringBuilder();
int i=0; int i=0;
int shift = 0; // # of excess bits stored in accum int shift = 0; // # of excess bits stored in accum

View File

@ -1,48 +0,0 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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.xml.internal.messaging.saaj.util;
import java.io.CharArrayReader;
// This class just gives access to the underlying buffer without copying.
public class CharReader extends CharArrayReader {
public CharReader(char buf[], int length) {
super(buf, 0, length);
}
public CharReader(char buf[], int offset, int length) {
super(buf, offset, length);
}
public char[] getChars() {
return buf;
}
public int getCount() {
return count;
}
}

View File

@ -1,48 +0,0 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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.xml.internal.messaging.saaj.util;
import java.io.CharArrayWriter;
// This class just gives access to the underlying buffer without copying.
public class CharWriter extends CharArrayWriter {
public CharWriter () {
super();
}
public CharWriter(int size) {
super(size);
}
public char[] getChars() {
return buf;
}
public int getCount() {
return count;
}
}

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -44,7 +44,7 @@ public class FastInfosetReflection {
/** /**
* FI DOMDocumentParser constructor using reflection. * FI DOMDocumentParser constructor using reflection.
*/ */
static Constructor fiDOMDocumentParser_new; static Constructor<?> fiDOMDocumentParser_new;
/** /**
* FI <code>DOMDocumentParser.parse()</code> method via reflection. * FI <code>DOMDocumentParser.parse()</code> method via reflection.
@ -54,7 +54,7 @@ public class FastInfosetReflection {
/** /**
* FI DOMDocumentSerializer constructor using reflection. * FI DOMDocumentSerializer constructor using reflection.
*/ */
static Constructor fiDOMDocumentSerializer_new; static Constructor<?> fiDOMDocumentSerializer_new;
/** /**
* FI <code>FastInfosetSource.serialize(Document)</code> method via reflection. * FI <code>FastInfosetSource.serialize(Document)</code> method via reflection.
@ -69,12 +69,12 @@ public class FastInfosetReflection {
/** /**
* FI FastInfosetSource constructor using reflection. * FI FastInfosetSource constructor using reflection.
*/ */
static Class fiFastInfosetSource_class; static Class<?> fiFastInfosetSource_class;
/** /**
* FI FastInfosetSource constructor using reflection. * FI FastInfosetSource constructor using reflection.
*/ */
static Constructor fiFastInfosetSource_new; static Constructor<?> fiFastInfosetSource_new;
/** /**
* FI <code>FastInfosetSource.getInputStream()</code> method via reflection. * FI <code>FastInfosetSource.getInputStream()</code> method via reflection.
@ -89,7 +89,7 @@ public class FastInfosetReflection {
/** /**
* FI FastInfosetResult constructor using reflection. * FI FastInfosetResult constructor using reflection.
*/ */
static Constructor fiFastInfosetResult_new; static Constructor<?> fiFastInfosetResult_new;
/** /**
* FI <code>FastInfosetResult.getOutputSTream()</code> method via reflection. * FI <code>FastInfosetResult.getOutputSTream()</code> method via reflection.
@ -98,7 +98,7 @@ public class FastInfosetReflection {
static { static {
try { try {
Class clazz = Class.forName("com.sun.xml.internal.fastinfoset.dom.DOMDocumentParser"); Class<?> clazz = Class.forName("com.sun.xml.internal.fastinfoset.dom.DOMDocumentParser");
fiDOMDocumentParser_new = clazz.getConstructor((Class[]) null); fiDOMDocumentParser_new = clazz.getConstructor((Class[]) null);
fiDOMDocumentParser_parse = clazz.getMethod("parse", fiDOMDocumentParser_parse = clazz.getMethod("parse",
new Class[] { org.w3c.dom.Document.class, java.io.InputStream.class }); new Class[] { org.w3c.dom.Document.class, java.io.InputStream.class });
@ -179,7 +179,7 @@ public class FastInfosetReflection {
"com.sun.xml.internal.org.jvnet.fastinfoset.FastInfosetSource"); "com.sun.xml.internal.org.jvnet.fastinfoset.FastInfosetSource");
} }
public static Class getFastInfosetSource_class() { public static Class<?> getFastInfosetSource_class() {
if (fiFastInfosetSource_class == null) { if (fiFastInfosetSource_class == null) {
throw new RuntimeException("Unable to locate Fast Infoset implementation"); throw new RuntimeException("Unable to locate Fast Infoset implementation");
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -32,7 +32,7 @@ import java.util.Collection;
* {@link ArrayList} with a final marker to help JIT. * {@link ArrayList} with a final marker to help JIT.
* @author Kohsuke Kawaguchi * @author Kohsuke Kawaguchi
*/ */
public final class FinalArrayList extends ArrayList { public final class FinalArrayList<E> extends ArrayList<E> {
public FinalArrayList(int initialCapacity) { public FinalArrayList(int initialCapacity) {
super(initialCapacity); super(initialCapacity);
} }
@ -40,7 +40,7 @@ public final class FinalArrayList extends ArrayList {
public FinalArrayList() { public FinalArrayList() {
} }
public FinalArrayList(Collection collection) { public FinalArrayList(Collection<? extends E> collection) {
super(collection); super(collection);
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -65,14 +65,14 @@ public class JAXMStreamSource extends StreamSource {
this.reader = rdr; this.reader = rdr;
return; return;
} }
CharWriter cout = new CharWriter(); CharArrayWriter cout = new CharArrayWriter();
char[] temp = new char[1024]; char[] temp = new char[1024];
int len; int len;
while (-1 != (len = rdr.read(temp))) while (-1 != (len = rdr.read(temp)))
cout.write(temp, 0, len); cout.write(temp, 0, len);
this.reader = new CharReader(cout.getChars(), cout.getCount()); this.reader = new CharArrayReader(cout.toCharArray(), 0, cout.size());
} }
public InputStream getInputStream() { public InputStream getInputStream() {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -39,9 +39,8 @@ import java.io.Serializable;
* string and fragment) that may constitute a URI. * string and fragment) that may constitute a URI.
* <p> * <p>
* Parsing of a URI specification is done according to the URI * Parsing of a URI specification is done according to the URI
* syntax described in RFC 2396 * syntax described in <a href="http://www.ietf.org/rfc/rfc2396.txt?number=2396">RFC 2396</a>.
* <http://www.ietf.org/rfc/rfc2396.txt?number=2396>. Every URI consists * Every URI consists of a scheme, followed by a colon (':'), followed by a scheme-specific
* of a scheme, followed by a colon (':'), followed by a scheme-specific
* part. For URIs that follow the "generic URI" syntax, the scheme- * part. For URIs that follow the "generic URI" syntax, the scheme-
* specific part begins with two slashes ("//") and may be followed * specific part begins with two slashes ("//") and may be followed
* by an authority segment (comprised of user information, host, and * by an authority segment (comprised of user information, host, and
@ -129,8 +128,6 @@ import java.io.Serializable;
/** If specified, stores the fragment for this URI; otherwise null */ /** If specified, stores the fragment for this URI; otherwise null */
private String m_fragment = null; private String m_fragment = null;
private static boolean DEBUG = false;
/** /**
* Construct a new and uninitialized URI. * Construct a new and uninitialized URI.
*/ */
@ -725,7 +722,7 @@ import java.io.Serializable;
* @return the scheme-specific part for this URI * @return the scheme-specific part for this URI
*/ */
public String getSchemeSpecificPart() { public String getSchemeSpecificPart() {
StringBuffer schemespec = new StringBuffer(); StringBuilder schemespec = new StringBuilder();
if (m_userinfo != null || m_host != null || m_port != -1) { if (m_userinfo != null || m_host != null || m_port != -1) {
schemespec.append("//"); schemespec.append("//");
@ -805,7 +802,7 @@ import java.io.Serializable;
*/ */
public String getPath(boolean p_includeQueryString, public String getPath(boolean p_includeQueryString,
boolean p_includeFragment) { boolean p_includeFragment) {
StringBuffer pathString = new StringBuffer(m_path); StringBuilder pathString = new StringBuilder(m_path);
if (p_includeQueryString && m_queryString != null) { if (p_includeQueryString && m_queryString != null) {
pathString.append('?'); pathString.append('?');
@ -1148,7 +1145,7 @@ import java.io.Serializable;
* @return the URI string specification * @return the URI string specification
*/ */
public String toString() { public String toString() {
StringBuffer uriSpecString = new StringBuffer(); StringBuilder uriSpecString = new StringBuilder();
if (m_scheme != null) { if (m_scheme != null) {
uriSpecString.append(m_scheme); uriSpecString.append(m_scheme);

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -42,7 +42,7 @@ public class ParseUtil {
* represent. * represent.
*/ */
public static String decode(String s) { public static String decode(String s) {
StringBuffer sb = new StringBuffer(); StringBuilder sb = new StringBuilder();
int i=0; int i=0;
while (i<s.length()) { while (i<s.length()) {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -76,10 +76,8 @@ public class XMLDeclarationParser {
{ {
int c = 0; int c = 0;
int index = 0; int index = 0;
char[] aChar = new char[65535]; StringBuilder xmlDeclStr = new StringBuilder();
StringBuffer xmlDeclStr = new StringBuffer();
while ((c = m_pushbackReader.read()) != -1) { while ((c = m_pushbackReader.read()) != -1) {
aChar[index] = (char)c;
xmlDeclStr.append((char)c); xmlDeclStr.append((char)c);
index++; index++;
if (c == '>') { if (c == '>') {
@ -104,7 +102,7 @@ public class XMLDeclarationParser {
// no XML decl // no XML decl
if (!utf16 && !utf8) { if (!utf16 && !utf8) {
m_pushbackReader.unread(aChar, 0, len); m_pushbackReader.unread(decl.toCharArray(), 0, len);
return; return;
} }
m_hasHeader = true; m_hasHeader = true;

View File

@ -315,12 +315,12 @@ public class SaajStaxWriter implements XMLStreamWriter {
return currentElement.lookupPrefix(namespaceURI); return currentElement.lookupPrefix(namespaceURI);
} }
public Iterator getPrefixes(final String namespaceURI) { public Iterator getPrefixes(final String namespaceURI) {
return new Iterator() { return new Iterator<String>() {
String prefix = getPrefix(namespaceURI); String prefix = getPrefix(namespaceURI);
public boolean hasNext() { public boolean hasNext() {
return (prefix != null); return (prefix != null);
} }
public Object next() { public String next() {
if (!hasNext()) throw new java.util.NoSuchElementException(); if (!hasNext()) throw new java.util.NoSuchElementException();
String next = prefix; String next = prefix;
prefix = null; prefix = null;

View File

@ -115,12 +115,12 @@ public class SaajStaxWriterEx extends SaajStaxWriter implements XMLStreamWriterE
return currentElement.lookupPrefix(namespaceURI); return currentElement.lookupPrefix(namespaceURI);
} }
public Iterator getPrefixes(final String namespaceURI) { public Iterator getPrefixes(final String namespaceURI) {
return new Iterator() { return new Iterator<String>() {
String prefix = getPrefix(namespaceURI); String prefix = getPrefix(namespaceURI);
public boolean hasNext() { public boolean hasNext() {
return (prefix != null); return (prefix != null);
} }
public Object next() { public String next() {
if (prefix == null) throw new java.util.NoSuchElementException(); if (prefix == null) throw new java.util.NoSuchElementException();
String next = prefix; String next = prefix;
prefix = null; prefix = null;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -81,7 +81,7 @@ public abstract class BindingIDFactory {
* if the implementation understood the transport but it is not correct, * if the implementation understood the transport but it is not correct,
* this exception can be thrown to abort the creation with error. * this exception can be thrown to abort the creation with error.
* No further {@link BindingIDFactory} will be consulted, and * No further {@link BindingIDFactory} will be consulted, and
* {@link BindingID#create(String, SOAPVersion)} will throw the exception. * {@link #create(String, SOAPVersion)} will throw the exception.
*/ */
public @Nullable BindingID create(@NotNull String transport, @NotNull SOAPVersion soapVersion) throws WebServiceException { public @Nullable BindingID create(@NotNull String transport, @NotNull SOAPVersion soapVersion) throws WebServiceException {
return null; return null;

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -95,6 +95,7 @@ public class MessageContextFactory extends com.oracle.webservices.internal.api.m
public com.oracle.webservices.internal.api.message.MessageContext createContext(SOAPMessage soap) { public com.oracle.webservices.internal.api.message.MessageContext createContext(SOAPMessage soap) {
throwIfIllegalMessageArgument(soap); throwIfIllegalMessageArgument(soap);
if (saajFactory!= null) return packet(saajFactory.createMessage(soap));
return packet(Messages.create(soap)); return packet(Messages.create(soap));
} }
@ -162,6 +163,7 @@ public class MessageContextFactory extends com.oracle.webservices.internal.api.m
if (mf != null) { if (mf != null) {
p.setMtomFeature(mf); p.setMtomFeature(mf);
} }
p.setSAAJFactory(saajFactory);
return p; return p;
} }

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -1514,4 +1514,12 @@ public final class Packet
public void setFastInfosetDisabled(boolean b) { public void setFastInfosetDisabled(boolean b) {
isFastInfosetDisabled = b; isFastInfosetDisabled = b;
} }
private com.sun.xml.internal.ws.api.message.saaj.SAAJFactory saajFactory;
public com.sun.xml.internal.ws.api.message.saaj.SAAJFactory getSAAJFactory() {
return saajFactory;
}
public void setSAAJFactory(com.sun.xml.internal.ws.api.message.saaj.SAAJFactory saajFactory) {
this.saajFactory = saajFactory;
}
} }

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -157,6 +157,11 @@ public class SAAJFactory {
* @throws SOAPException if SAAJ processing fails * @throws SOAPException if SAAJ processing fails
*/ */
public static SOAPMessage read(SOAPVersion soapVersion, Message message, Packet packet) throws SOAPException { public static SOAPMessage read(SOAPVersion soapVersion, Message message, Packet packet) throws SOAPException {
SAAJFactory saajfac = packet.getSAAJFactory();
if (saajfac != null) {
SOAPMessage msg = saajfac.readAsSOAPMessage(soapVersion, message, packet);
if (msg != null) return msg;
}
for (SAAJFactory s : ServiceFinder.find(SAAJFactory.class)) { for (SAAJFactory s : ServiceFinder.find(SAAJFactory.class)) {
SOAPMessage msg = s.readAsSOAPMessage(soapVersion, message, packet); SOAPMessage msg = s.readAsSOAPMessage(soapVersion, message, packet);
if (msg != null) if (msg != null)
@ -173,6 +178,11 @@ public class SAAJFactory {
* @throws SOAPException if SAAJ processing fails * @throws SOAPException if SAAJ processing fails
*/ */
public static SAAJMessage read(Packet packet) throws SOAPException { public static SAAJMessage read(Packet packet) throws SOAPException {
SAAJFactory saajfac = packet.getSAAJFactory();
if (saajfac != null) {
SAAJMessage msg = saajfac.readAsSAAJ(packet);
if (msg != null) return msg;
}
// Use the Component from the Packet if it exists. Note the logic // Use the Component from the Packet if it exists. Note the logic
// in the ServiceFinder is such that find(Class) is not equivalent // in the ServiceFinder is such that find(Class) is not equivalent
// to find (Class, null), so the ternary operator is needed. // to find (Class, null), so the ternary operator is needed.

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -46,7 +46,6 @@ import java.security.PrivilegedAction;
* opaque method invocation {@link Work#execute}, allowing the use of * opaque method invocation {@link Work#execute}, allowing the use of
* {@code finally} block. * {@code finally} block.
* *
*
* @author Kohsuke Kawaguchi * @author Kohsuke Kawaguchi
*/ */
public interface FiberContextSwitchInterceptor { public interface FiberContextSwitchInterceptor {

Some files were not shown because too many files have changed in this diff Show More