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.
*
* 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
* with each other.
*
* @author Marek Potociar <marek.potociar at sun.com>
* @author Marek Potociar
* @author Fabian Ritzmann
*/
public class Logger {
@ -335,7 +335,7 @@ public class Logger {
/**
* Method logs {@code exception}'s message as a {@code SEVERE} logging level
* message.
* <p/>
* <p>
* If {@code cause} parameter is not {@code null}, it is logged as well and
* {@code exception} original cause is initialized with instance referenced
* by {@code cause} parameter.
@ -363,7 +363,7 @@ public class Logger {
/**
* Method logs {@code exception}'s message as a {@code SEVERE} logging level
* message.
* <p/>
* <p>
* 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
* {@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
* {@code level} argument.
* <p/>
* <p>
* If {@code cause} parameter is not {@code null}, it is logged as well and
* {@code exception} original cause is initialized with instance referenced
* by {@code cause} parameter.
@ -437,7 +437,7 @@ public class Logger {
/**
* Method logs {@code exception}'s message at the logging level specified by the
* {@code level} argument.
* <p/>
* <p>
* 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
* {@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.
*
* 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 readOnly the isStatic value of the field's modifier.
* @return Accessor the accessor for this field
*
* @throws JAXBException reports failures of the method.
*/
public Accessor createFieldAccessor(Class bean, Field field, boolean readOnly) {
return readOnly
@ -65,8 +63,6 @@ public class AccessorFactoryImpl implements InternalAccessorFactory {
* @param readOnly the isStatic value of the field's modifier.
* @param supressWarning supress security warning about accessing fields through reflection
* @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) {
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 setter the setter method to be accessed. The value can be null.
* @return Accessor the accessor for these methods
*
* @throws JAXBException reports failures of the method.
*/
public Accessor createPropertyAccessor(Class bean, Method getter, Method setter) {
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.
*
* 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:
* <ol>
@ -115,7 +115,7 @@ public final class DatatypeConverterImpl implements DatatypeConverterInterface {
}
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) {

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.
*
* 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.
* 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
* 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.
*
@ -436,7 +436,7 @@ public abstract class JAXBRIContext extends JAXBContext {
* to put additional JAXB type references into the {@link JAXBContext}.
*
* <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.
*
* <p>
@ -453,7 +453,6 @@ public abstract class JAXBRIContext extends JAXBContext {
* to enable the c14n marshalling support in the {@link JAXBContext}.
*
* Boolean
* @see C14nSupport_ArchitectureDocument
* @since 2.0 EA2
*/
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.
*
* 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>
*
* <pre>
* &lt;?xml version="1.0" standalone="yes"?>
* <pre>{@code
* <?xml version="1.0" standalone="yes"?>
*
* &lt;Person>
* &lt;name>Jane Smith&lt;/name>
* &lt;date-of-birth>1965-05-23&lt;/date-of-birth>
* &lt;citizenship>US&lt;/citizenship>
* &lt;/Person>
* </pre>
* <Person>
* <name>Jane Smith</name>
* <date-of-birth>1965-05-23</date-of-birth>
* <citizenship>US</citizenship>
* </Person>
* }</pre>
*
* <p>This class inherits from {@link XMLWriter},
* 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.
*
* 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.
/**
* Implemented by the user application to determine URI -> prefix
* Implemented by the user application to determine URI {@code ->} prefix
* mapping.
*
* 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.
*
* 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>
*
* <pre>
* &lt;?xml version="1.0" standalone="yes"?>
* <pre>{@code
* <?xml version="1.0" standalone="yes"?>
*
* &lt;greeting>Hello, world!&lt;/greeting>
* </pre>
* <greeting>Hello, world!</greeting>
* }</pre>
*
* <p>In fact, there is an even simpler convenience method,
* <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>
*
* <pre>
* &lt;item>1&lt;/item>&lt;item>3&lt;/item>&lt;item>3&lt;/item>
* </pre>
* <pre>{@code
* <item>1</item><item>3</item><item>3</item>
* }</pre>
*
* <p>You need to invoke one of the <var>characters</var> methods
* 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>
*
* <pre>
* &lt;?xml version="1.0" standalone="yes"?>
* <pre>{@code
* <?xml version="1.0" standalone="yes"?>
*
* &lt;_NS1:foo xmlns:_NS1="http://www.foo.com/ns/"/>
* </pre>
* <_NS1:foo xmlns:_NS1="http://www.foo.com/ns/"/>
* }</pre>
*
* <p>In many cases, document authors will prefer to choose their
* 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>
*
* <pre>
* &lt;?xml version="1.0" standalone="yes"?>
* <pre>{@code
* <?xml version="1.0" standalone="yes"?>
*
* &lt;foo:foo xmlns:foo="http://www.foo.com/ns/"/>
* </pre>
* <foo:foo xmlns:foo="http://www.foo.com/ns/"/>
* }</pre>
*
* <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>
*
* <pre>
* &lt;?xml version="1.0" standalone="yes"?>
* <pre>{@code
* <?xml version="1.0" standalone="yes"?>
*
* &lt;foo xmlns="http://www.foo.com/ns/"/>
* </pre>
* <foo xmlns="http://www.foo.com/ns/"/>
* }</pre>
*
* <p>By default, the XML writer will not declare a Namespace until
* it is actually used. Sometimes, this approach will create
* a large number of Namespace declarations, as in the following
* example:</p>
*
* <pre>
* &lt;xml version="1.0" standalone="yes"?>
* <pre>{@code
* <xml version="1.0" standalone="yes"?>
*
* &lt;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">
* &lt;dc:title xmlns:dc="http://www.purl.org/dc/">A Dark Night&lt;/dc:title>
* &lt;dc:creator xmlns:dc="http://www.purl.org/dc/">Jane Smith&lt;/dc:title>
* &lt;dc:date xmlns:dc="http://www.purl.org/dc/">2000-09-09&lt;/dc:title>
* &lt;/rdf:Description>
* &lt;/rdf:RDF>
* </pre>
* <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
* <rdf:Description about="http://www.foo.com/ids/books/12345">
* <dc:title xmlns:dc="http://www.purl.org/dc/">A Dark Night</dc:title>
* <dc:creator xmlns:dc="http://www.purl.org/dc/">Jane Smith</dc:title>
* <dc:date xmlns:dc="http://www.purl.org/dc/">2000-09-09</dc:title>
* </rdf:Description>
* </rdf:RDF>
* }</pre>
*
* <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
@ -230,18 +230,18 @@ import org.xml.sax.helpers.XMLFilterImpl;
* though it's not needed there, and can be inherited by its
* descendants:</p>
*
* <pre>
* &lt;xml version="1.0" standalone="yes"?>
* <pre>{@code
* <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/">
* &lt;rdf:Description about="http://www.foo.com/ids/books/12345">
* &lt;dc:title>A Dark Night&lt;/dc:title>
* &lt;dc:creator>Jane Smith&lt;/dc:title>
* &lt;dc:date>2000-09-09&lt;/dc:title>
* &lt;/rdf:Description>
* &lt;/rdf:RDF>
* </pre>
* <rdf:Description about="http://www.foo.com/ids/books/12345">
* <dc:title>A Dark Night</dc:title>
* <dc:creator>Jane Smith</dc:title>
* <dc:date>2000-09-09</dc:title>
* </rdf:Description>
* </rdf:RDF>
* }</pre>
*
* <p>This approach is also useful for declaring Namespace prefixes
* 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
* (&lt;?xml version='1.0' ... ?>).
* ({@code <?xml version='1.0' ... ?>}).
* <p>
* 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.
*
* This code is free software; you can redistribute it and/or modify it
@ -87,25 +87,16 @@ public final class ClassFactory {
if(consRef!=null)
cons = consRef.get();
if(cons==null) {
cons = AccessController.doPrivileged(new PrivilegedAction<Constructor<T>>() {
@Override
public Constructor<T> run() {
try {
return clazz.getDeclaredConstructor(emptyClass);
} catch (NoSuchMethodException e) {
logger.log(Level.INFO,"No default constructor found on "+clazz,e);
NoSuchMethodError exp;
if(clazz.getDeclaringClass()!=null && !Modifier.isStatic(clazz.getModifiers())) {
exp = new NoSuchMethodError(Messages.NO_DEFAULT_CONSTRUCTOR_IN_INNER_CLASS
.format(clazz.getName()));
} else {
exp = new NoSuchMethodError(e.getMessage());
}
exp.initCause(e);
throw exp;
if (System.getSecurityManager() == null) {
cons = tryGetDeclaredConstructor(clazz);
} else {
cons = AccessController.doPrivileged(new PrivilegedAction<Constructor<T>>() {
@Override
public Constructor<T> run() {
return tryGetDeclaredConstructor(clazz);
}
}
});
});
}
int classMod = clazz.getModifiers();
@ -126,6 +117,23 @@ public final class ClassFactory {
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 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.
*
* This code is free software; you can redistribute it and/or modify it
@ -174,7 +174,7 @@ public class ContextFactory {
* @param retainPropertyInfo
* @return
* @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
public static JAXBRIContext createContext( Class[] classes,
@ -201,7 +201,7 @@ public class ContextFactory {
* @param improvedXsiTypeHandling
* @return
* @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
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.
*
* 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;
* @return
* @throws CloneNotSupportedException
*/
@Deprecated()
public static final String XML_SCHEMA = XMLConstants.W3C_XML_SCHEMA_NS_URI;
/**
* @deprecated Use javax.xml.XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI instead
* @return
* @throws CloneNotSupportedException
*/
@Deprecated()
public static final String XML_SCHEMA_INSTANCE = XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI;
/**
* @deprecated Use javax.xml.XMLConstants.XML_NS_URI instead;
* @return
* @throws CloneNotSupportedException
*/
@Deprecated()
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.
*
* 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();
/**
* Returns the representation for {@link JAXBElement}&lt;<i>contentInMemoryType</i>&gt;.
* Returns the representation for {@link JAXBElement}<i>{@code <contentInMemoryType>}</i>.
*
* <p>
* 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();
/**
* @inheritDoc
* {@inheritDoc}
*
* {@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.
*
* 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,
* meaning you can put different types in it, each with a different tag name
* (and a few other settings.)
* <pre>
* <pre><code>
* // list can contain String or Integer.
* &#64;XmlElements({
* &#64;XmlElement(name="a",type=String.class),
* &#64;XmlElement(name="b",type=Integer.class),
* }) {@code
* List<Object> abc;
* }</pre>
* {@literal @}XmlElements({
* {@literal @}XmlElement(name="a",type=String.class),
* {@literal @}XmlElement(name="b",type=Integer.class),
* })
* {@literal List<Object>} abc;
* </code></pre>
* <p>
* 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.
*
* 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.
*
* <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
*/

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.
*
* This code is free software; you can redistribute it and/or modify it
@ -36,25 +36,25 @@
* The meaning of parameterizations are as follows:
*
* <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>}.
* Corresponds to {@link Type}.
*
* <dt><b>C</b>
* Corresponds to {@link java.lang.reflect.Type}.</dd>
*
* <dt><b>C</b></dt>
* <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
* 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.
* 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.
* 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)
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.
*
* 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) {
}
@ -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
/*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.
*
* 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;
import com.sun.xml.internal.bind.v2.model.core.PropertyInfo;
/**
* {@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.
*
* 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 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.annotation.XmlLocation;
@ -58,7 +59,7 @@ public interface RuntimeClassInfo extends ClassInfo<Type,Class>, RuntimeNonEleme
* unoptimized accessor.
* non-null iff {@link #hasAttributeWildcard()}==true.
*
* @see Accessor#optimize()
* @see Accessor#optimize(JAXBContextImpl)
*/
<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.
*
* 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 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;
/**
@ -58,7 +59,7 @@ public interface RuntimePropertyInfo extends PropertyInfo<Type,Class> {
* @return
* never null.
*
* @see Accessor#optimize()
* @see Accessor#optimize(JAXBContextImpl)
*/
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.
*
* This code is free software; you can redistribute it and/or modify it
@ -28,7 +28,7 @@
*
* <h1>Overview</h1>
* <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:
*
* <ol>
@ -37,7 +37,7 @@
* <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
* 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.
* </ol>
*
@ -68,7 +68,7 @@
* packages of the binding model.
*
* <div>
* <img src="doc-files/packages.png"/>
* <img src="doc-files/packages.png" alt="">
* </div>
*
* <p>
@ -109,13 +109,13 @@
* For more details, see the javadoc of each component.
*
* <div>
* <img src="doc-files/j2s_architecture.gif"/>
* <img src="doc-files/j2s_architecture.gif" alt="">
* </div>
*
* <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
* referenced by the generated code. Hence they can be changed freely
* from versions to versions.
@ -125,7 +125,7 @@
*
* <h1>Performance Characteristics</h1>
* <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,
* but it's not too performance sensitive.
*
@ -139,44 +139,8 @@
*
* <h1>Bootstrap Sequence</h1>
* <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.
*
* {@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;

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.
*
* 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 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 ) {
Entry<XmlNode> e = byElement.get(element);
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 ) {
Entry<XmlNode> e = byElement.get(element);
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.
*
* 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 java.net.URISyntaxException;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
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
{
private static final Logger LOGGER = Logger.getLogger(MarshallerImpl.class.getName());
/** Indentation string. Default is four whitespaces. */
private String indent = " ";
@ -327,12 +332,14 @@ public /*to make unit tests happy*/ final class MarshallerImpl extends AbstractM
toBeFlushed.flush();
} catch (IOException e) {
// ignore
LOGGER.log(Level.SEVERE, e.getMessage(), e);
}
if(toBeClosed!=null)
try {
toBeClosed.close();
} catch (IOException e) {
// ignore
LOGGER.log(Level.SEVERE, e.getMessage(), e);
}
toBeFlushed = 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.
*
* 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;
/**
* Maintains namespace&lt;->prefix bindings.
* Maintains {@code namespace <-> prefix} bindings.
*
* <p>
* 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.
*
* 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
* to {@link Class} objects representing their boxed types.
* <p>
* e.g., int -> Integer.
* e.g., {@code int -> Integer}.
*/
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.
*
* 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.
*
* @see com.sun.xml.internal.bind.api.C14nSupport_ArchitectureDocument
* @author Kohsuke Kawaguchi
*/
public class C14nXmlOutput extends UTF8XmlOutput {
@ -68,7 +67,6 @@ public class C14nXmlOutput extends UTF8XmlOutput {
* (AKA attribute wildcard.)
*
* 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>();

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.
*
* 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;
/**
* {@link XmlOutput} for {@link LowLevelStAXDocumentSerializer}.
* {@link XmlOutput} for {@link StAXDocumentSerializer}.
* <p>
* 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
@ -99,7 +99,7 @@ public final class FastInfosetStreamWriterOutput extends XMLStreamWriterOutput {
/**
* Create a new set of tables for a JAXB context.
* <p>
* @param content the JAXB context.
* @param context the JAXB context.
* @param initialIndexOffset the initial index offset to calculate
* the maximum possible index
*
@ -124,7 +124,7 @@ public final class FastInfosetStreamWriterOutput extends XMLStreamWriterOutput {
/**
* Clear or reset the tables.
* <p>
* @param initialIndexOffset the initial index offset to calculate
* @param intialIndexOffset the initial index offset to calculate
* the maximum possible index
*/
public void clearOrResetTables(int intialIndexOffset) {
@ -202,7 +202,7 @@ public final class FastInfosetStreamWriterOutput extends XMLStreamWriterOutput {
* Holder of JAXB contexts -> tables.
* <p>
* An instance will be registered with the
* {@link LowLevelStAXDocumentSerializer}.
* {@link StAXDocumentSerializer}.
*/
final static class AppData implements VocabularyApplicationData {
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.
*
* 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.
*
* <ul>
* <li>If a non-empty prefix is declared, it will never be reassigned to different namespace URIs.
* <li>
* <li>If a non-empty prefix is declared, it will never be reassigned to different namespace URIs.</li>
* </ul>
*/
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.
*
* 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;
/**
* 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
* allows us to write "/>" for empty elements.
* allows us to write {@code "/>"} for empty elements.
*/
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 {
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.
*
* This code is free software; you can redistribute it and/or modify it
@ -158,7 +158,7 @@ public interface XmlOutput {
*
* @param value
* this string can contain characters that might need escaping
* (such as '&amp;' or '>')
* (such as {@code '&' or '>'})
* @param needsSeparatingWhitespace
*/
public void text( String value, boolean needsSeparatingWhitespace ) throws IOException, SAXException, XMLStreamException;
@ -168,7 +168,7 @@ public interface XmlOutput {
*
* @param value
* this string can contain characters that might need escaping
* (such as '&amp;' or '>')
* (such as {@code '&' or '>'})
* @param needsSeparatingWhitespace
*/
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.
*
* 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.
* <p/>
* <p/>
* <p>
* <p>
* This interface encapsulates the access to the actual data store.
* The intention is to generate implementations for a particular bean
* and a property to improve the performance.
* <p/>
* <p/>
* <p>
* <p>
* Accessor can be used as a receiver. Upon receiving an object
* 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.
* <p/>
* <p>
* This ugly entry point is only used by JAX-WS.
* See {@link JAXBRIContext#getElementPropertyAccessor}
*/
@ -129,7 +129,7 @@ public abstract class Accessor<BeanT, ValueT> implements Receiver {
/**
* Returns true if this accessor wraps an adapter.
* <p/>
* <p>
* This method needs to be used with care, but it helps some optimization.
*/
public boolean isAdapted() {
@ -138,7 +138,7 @@ public abstract class Accessor<BeanT, ValueT> implements Receiver {
/**
* Sets the value without adapting the value.
* <p/>
* <p>
* This ugly entry point is only used by JAX-WS.
* 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.
* <p/>
* <p/>
* <p>
* <p>
* This provides a user-friendly error message.
*/
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.
* <p/>
* <p/>
* <p>
* <p>
* This provides a user-friendly error message.
*/
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.
*
* 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;
/**
* 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
*/

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.
*
* 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 org.xml.sax.ErrorHandler;
import org.xml.sax.Locator;
import org.xml.sax.SAXException;
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.
*
* This code is free software; you can redistribute it and/or modify it
@ -145,7 +145,7 @@ public interface XmlVisitor {
* <p>
* If this method returns true, all the whitespaces are considered significant
* 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.
*/
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.
*
* 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.
*
* For example:
* <p>
* For example: <pre>{@code
* /a/b/c/ -> /a/b/c/
* /a/b/c -> /a/b/
* /a/ -> /a/
* /a -> /
* }</pre>
*
* @param uriPath path of a URI (as returned by java.net.URI#getPath()
* @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.
*
* 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() {
try {
return (CleanUpExecutorFactory) FactoryFinder.find(DEFAULT_PROPERTY_NAME);
} catch (RuntimeException e) {
return null;
} catch (Exception e) {
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.
*
* 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 {
/**
* Constructor
* Constructs a {@code DecodingException} with the specified detail message.
*
* @param message
* The detail message
*/
public DecodingException(String s) {
super(s);
public DecodingException(String message) {
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.
*
* 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.InputStream;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.util.logging.Level;
import java.util.logging.Logger;
@ -70,11 +71,7 @@ class FactoryFinder {
String factoryClassName;
BufferedReader rd = null;
try {
try {
rd = new BufferedReader(new InputStreamReader(is, "UTF-8"));
} catch (java.io.UnsupportedEncodingException e) {
rd = new BufferedReader(new InputStreamReader(is));
}
rd = new BufferedReader(new InputStreamReader(is, StandardCharsets.UTF_8));
try {
factoryClassName = rd.readLine();
} 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.
*
* This code is free software; you can redistribute it and/or modify it
@ -37,6 +37,9 @@ import java.util.Collection;
* @author Kohsuke Kawaguchi
*/
final class FinalArrayList<T> extends ArrayList<T> {
private static final long serialVersionUID = 7996571518730043311L;
public FinalArrayList(int 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.
*
* 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) {
if (tempDir == null && dir != null && !dir.equals("")) {
tempDir = new File(dir);
public final void setDir(String directory) {
if (tempDir == null && directory != null && !directory.equals("")) {
tempDir = new File(directory);
}
}
@ -143,7 +144,9 @@ public class MIMEConfig {
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
}
}

View File

@ -62,7 +62,10 @@ public class MIMEMessage implements Closeable {
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) {
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
* 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
*/
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}.
* 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
* 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.
*
* This code is free software; you can redistribute it and/or modify it
@ -123,6 +123,11 @@ class MIMEParser implements Iterable<MIMEEvent> {
@Override
public MIMEEvent next() {
if (parsed) {
throw new NoSuchElementException();
}
switch(state) {
case 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.
*
* 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;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardCopyOption;
import java.util.concurrent.TimeUnit;
import java.io.File;
@ -133,10 +136,12 @@ final class WeakDataFile extends WeakReference<DataFile> {
refList.remove(this);
try {
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 (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) {

View File

@ -210,7 +210,7 @@ public class XMLStreamReaderToXMLStreamWriter {
int nsCount = in.getNamespaceCount();
for (int i = 0; i < nsCount; i++) {
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
}

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.
*
* 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>
* 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.
*
* This code is free software; you can redistribute it and/or modify it
@ -43,7 +43,7 @@ public abstract class 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},
* {@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.
*
* 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>
*
* <pre>{@code
* <?xml version="1.0" standalone="yes"?>
* <?xml version="1.0" standalone="yes"?>
*
* <greeting>Hello, world!</greeting>
* }</pre>
@ -168,7 +168,7 @@ import java.util.Map;
*
* <ol>
* <li>the qualified name</li>
* <li>the {@link #setPrefix setPrefix} method.</li>
* <li>the {@link #startPrefixMapping(String, String)} method.</li>
* </ol>
*
* <p>Whenever the XML writer finds a new Namespace URI, it checks

View File

@ -372,8 +372,8 @@ public interface Marshaller {
* @throws MarshalException
* If the {@link ValidationEventHandler ValidationEventHandler}
* returns false from its {@code handleEvent} method or the
* {@code Marshaller} is unable to marshal {@code obj} (or any
* object reachable from {@code obj}). See <a href="#elementMarshalling">
* {@code Marshaller} is unable to marshal {@code jaxbElement} (or any
* object reachable from {@code jaxbElement}). See <a href="#elementMarshalling">
* Marshalling a JAXB element</a>.
* @throws IllegalArgumentException
* If any of the method parameters are null
@ -394,8 +394,8 @@ public interface Marshaller {
* @throws MarshalException
* If the {@link ValidationEventHandler ValidationEventHandler}
* returns false from its {@code handleEvent} method or the
* {@code Marshaller} is unable to marshal {@code obj} (or any
* object reachable from {@code obj}). See <a href="#elementMarshalling">
* {@code Marshaller} is unable to marshal {@code jaxbElement} (or any
* object reachable from {@code jaxbElement}). See <a href="#elementMarshalling">
* Marshalling a JAXB element</a>.
* @throws IllegalArgumentException
* If any of the method parameters are null
@ -416,8 +416,8 @@ public interface Marshaller {
* @throws MarshalException
* If the {@link ValidationEventHandler ValidationEventHandler}
* returns false from its {@code handleEvent} method or the
* {@code Marshaller} is unable to marshal {@code obj} (or any
* object reachable from {@code obj}). See <a href="#elementMarshalling">
* {@code Marshaller} is unable to marshal {@code jaxbElement} (or any
* object reachable from {@code jaxbElement}). See <a href="#elementMarshalling">
* Marshalling a JAXB element</a>.
* @throws IllegalArgumentException
* If any of the method parameters are null
@ -439,8 +439,8 @@ public interface Marshaller {
* @throws MarshalException
* If the {@link ValidationEventHandler ValidationEventHandler}
* returns false from its {@code handleEvent} method or the
* {@code Marshaller} is unable to marshal {@code obj} (or any
* object reachable from {@code obj}). See <a href="#elementMarshalling">
* {@code Marshaller} is unable to marshal {@code jaxbElement} (or any
* object reachable from {@code jaxbElement}). See <a href="#elementMarshalling">
* Marshalling a JAXB element</a>.
* @throws IllegalArgumentException
* If any of the method parameters are null
@ -461,8 +461,8 @@ public interface Marshaller {
* @throws MarshalException
* If the {@link ValidationEventHandler ValidationEventHandler}
* returns false from its {@code handleEvent} method or the
* {@code Marshaller} is unable to marshal {@code obj} (or any
* object reachable from {@code obj}). See <a href="#elementMarshalling">
* {@code Marshaller} is unable to marshal {@code jaxbElement} (or any
* object reachable from {@code jaxbElement}). See <a href="#elementMarshalling">
* Marshalling a JAXB element</a>.
* @throws IllegalArgumentException
* If any of the method parameters are null
@ -510,8 +510,8 @@ public interface Marshaller {
* @throws MarshalException
* If the {@link ValidationEventHandler ValidationEventHandler}
* returns false from its {@code handleEvent} method or the
* {@code Marshaller} is unable to marshal {@code obj} (or any
* object reachable from {@code obj}). See <a href="#elementMarshalling">
* {@code Marshaller} is unable to marshal {@code jaxbElement} (or any
* object reachable from {@code jaxbElement}). See <a href="#elementMarshalling">
* Marshalling a JAXB element</a>.
* @throws IllegalArgumentException
* If any of the method parameters are null
@ -534,8 +534,8 @@ public interface Marshaller {
* @throws MarshalException
* If the {@link ValidationEventHandler ValidationEventHandler}
* returns false from its {@code handleEvent} method or the
* {@code Marshaller} is unable to marshal {@code obj} (or any
* object reachable from {@code obj}). See <a href="#elementMarshalling">
* {@code Marshaller} is unable to marshal {@code jaxbElement} (or any
* object reachable from {@code jaxbElement}). See <a href="#elementMarshalling">
* Marshalling a JAXB element</a>.
* @throws IllegalArgumentException
* 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.
*
* 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]);
protected com.sun.xml.internal.ws.api.message.saaj.SAAJFactory saajFactory = null;
protected abstract MessageContextFactory newFactory(WebServiceFeature ... f);
public abstract MessageContext createContext();
@ -127,4 +129,8 @@ public abstract class MessageContextFactory
private static interface Creator {
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.
*
* 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 {
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 boolean isSunVM = sunVmVendor.equals(vmVendor) ? true: false;
private static final boolean isIBMVM = ibmVmVendor.equals(vmVendor) ? true : false;
private static final String JAXM_URLENDPOINT="javax.xml.messaging.URLEndpoint";
@ -95,7 +93,7 @@ class HttpSOAPConnection extends SOAPConnection {
throw new SOAPExceptionImpl("Connection is closed");
}
Class urlEndpointClass = null;
Class<?> urlEndpointClass = null;
ClassLoader loader = Thread.currentThread().getContextClassLoader();
try {
if (loader != null) {
@ -198,7 +196,7 @@ class HttpSOAPConnection extends SOAPConnection {
MimeHeaders headers = message.getMimeHeaders();
Iterator it = headers.getAllHeaders();
Iterator<?> it = headers.getAllHeaders();
boolean hasAuth = false; // true if we find explicit Auth header
while (it.hasNext()) {
MimeHeader header = (MimeHeader) it.next();
@ -209,7 +207,7 @@ class HttpSOAPConnection extends SOAPConnection {
header.getName(),
header.getValue());
else {
StringBuffer concat = new StringBuffer();
StringBuilder concat = new StringBuilder();
int i = 0;
while (i < values.length) {
if (i != 0)
@ -355,7 +353,7 @@ class HttpSOAPConnection extends SOAPConnection {
log.severe("SAAJ0011.p2p.get.already.closed.conn");
throw new SOAPExceptionImpl("Connection is closed");
}
Class urlEndpointClass = null;
Class<?> urlEndpointClass = null;
try {
urlEndpointClass = Class.forName("javax.xml.messaging.URLEndpoint");
@ -441,7 +439,7 @@ class HttpSOAPConnection extends SOAPConnection {
httpConnection.setDoOutput(true);
httpConnection.setDoInput(true);
httpConnection.setUseCaches(false);
httpConnection.setFollowRedirects(true);
httpConnection.setInstanceFollowRedirects(true);
httpConnection.connect();
@ -591,7 +589,7 @@ class HttpSOAPConnection extends SOAPConnection {
log.log(Level.FINE, "SAAJ0054.p2p.set.providers",
new String[] { pkgs });
try {
Class c = Class.forName(SSL_PROVIDER);
Class<?> c = Class.forName(SSL_PROVIDER);
Provider p = (Provider) c.newInstance();
Security.addProvider(p);
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.
*
* 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();
Exception n = next;
String s = super.getMessage();
StringBuffer sb = new StringBuffer(s == null ? "" : s);
StringBuilder sb = new StringBuilder(s == null ? "" : s);
while (n != null) {
sb.append(";\n nested exception is:\n\t");
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.
*
* 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");
for (int i = 0; i < parts.size(); i++) {
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
}

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.
*
* This code is free software; you can redistribute it and/or modify it
@ -169,7 +169,7 @@ public class ContentDisposition {
if (list == null)
return disposition;
StringBuffer sb = new StringBuffer(disposition);
StringBuilder sb = new StringBuilder(disposition);
// append the parameter list
// 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.
*
* 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
return null;
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
sb.append(primaryType).append('/').append(subType);
if (list != null)
// 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.
*
* This code is free software; you can redistribute it and/or modify it
@ -346,7 +346,7 @@ public class HeaderTokenizer {
* quoted string.
*/
private static String filterToken(String s, int start, int end) {
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
char c;
boolean gotEscape = 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.
*
* 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 {
private final FinalArrayList headers = new FinalArrayList();
private final FinalArrayList<hdr> headers = new FinalArrayList<hdr>();
/**
* Lazily cerated view of header lines (Strings).
*/
private List headerValueView;
private List<String> headerValueView;
/**
* Create an empty InternetHeaders object.
@ -119,7 +119,7 @@ public final class InternetHeaders {
LineInputStream lis = new LineInputStream(is);
String prevline = null; // the previous header line, as a string
// a buffer to accumulate the header in, when we know it's needed
StringBuffer lineBuffer = new StringBuffer();
StringBuilder lineBuffer = new StringBuilder();
try {
//while ((line = lis.readLine()) != null) {
@ -161,11 +161,11 @@ public final class InternetHeaders {
*/
public String[] getHeader(String name) {
// 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();
for( int i=0; i<len; i++ ) {
hdr h = (hdr) headers.get(i);
hdr h = headers.get(i);
if (name.equalsIgnoreCase(h.name)) {
v.add(h.getValue());
}
@ -173,7 +173,7 @@ public final class InternetHeaders {
if (v.size() == 0)
return (null);
// 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)
return s[0];
StringBuffer r = new StringBuffer(s[0]);
StringBuilder r = new StringBuilder(s[0]);
for (int i = 1; i < s.length; i++) {
r.append(delimiter);
r.append(s[i]);
@ -219,7 +219,7 @@ public final class InternetHeaders {
boolean found = false;
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 (!found) {
int j;
@ -252,7 +252,7 @@ public final class InternetHeaders {
public void addHeader(String name, String value) {
int pos = headers.size();
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)) {
headers.add(i + 1, new hdr(name, value));
return;
@ -271,7 +271,7 @@ public final class InternetHeaders {
*/
public void removeHeader(String name) {
for (int i = 0; i < headers.size(); i++) {
hdr h = (hdr) headers.get(i);
hdr h = headers.get(i);
if (name.equalsIgnoreCase(h.name)) {
headers.remove(i);
i--; // have to look at i again
@ -285,7 +285,7 @@ public final class InternetHeaders {
*
* @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
}
@ -302,7 +302,7 @@ public final class InternetHeaders {
try {
char c = line.charAt(0);
if (c == ' ' || c == '\t') {
hdr h = (hdr) headers.get(headers.size() - 1);
hdr h = headers.get(headers.size() - 1);
h.line += "\r\n" + line;
} else
headers.add(new hdr(line));
@ -317,11 +317,11 @@ public final class InternetHeaders {
/**
* Return all the header lines as a collection
*/
public List getAllHeaderLines() {
public List<String> getAllHeaderLines() {
if(headerValueView==null)
headerValueView = new AbstractList() {
public Object get(int index) {
return ((hdr)headers.get(index)).line;
headerValueView = new AbstractList<String>() {
public String get(int index) {
return headers.get(index).line;
}
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.
*
* 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.FinalArrayList;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.activation.DataHandler;
import java.io.BufferedInputStream;
import java.io.ByteArrayInputStream;
@ -526,7 +524,7 @@ public final class MimeBodyPart {
// Tokenize the header to obtain the Language-tags (skip comments)
HeaderTokenizer h = new HeaderTokenizer(s, HeaderTokenizer.MIME);
FinalArrayList v = new FinalArrayList();
FinalArrayList<String> v = new FinalArrayList<String>();
HeaderTokenizer.Token tk;
int tkType;
@ -544,7 +542,7 @@ public final class MimeBodyPart {
if (v.size() == 0)
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
*/
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++)
sb.append(',').append(languages[i]);
setHeader("Content-Language", sb.toString());
@ -943,10 +941,10 @@ public final class MimeBodyPart {
throws IOException, MessagingException {
// First, write out the header
List hdrLines = headers.getAllHeaderLines();
List<String> hdrLines = headers.getAllHeaderLines();
int sz = hdrLines.size();
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
OutputUtil.writeln(os);
@ -1043,7 +1041,7 @@ public final class MimeBodyPart {
* Return all the headers from this Message as an Enumeration of
* Header objects.
*/
public FinalArrayList getAllHeaders() {
public FinalArrayList<hdr> 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.
*
* This code is free software; you can redistribute it and/or modify it
@ -93,7 +93,7 @@ public class MimeMultipart {
/**
* 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
@ -212,7 +212,7 @@ public class MimeMultipart {
if (parts == null)
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 {
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)
throw new IndexOutOfBoundsException("No such BodyPart");
MimeBodyPart part = (MimeBodyPart)parts.get(index);
MimeBodyPart part = parts.get(index);
parts.remove(index);
part.setParent(null);
}
@ -609,7 +609,7 @@ public class MimeMultipart {
*/
public synchronized void addBodyPart(MimeBodyPart part) {
if (parts == null)
parts = new FinalArrayList();
parts = new FinalArrayList<MimeBodyPart>();
parts.add(part);
part.setParent(this);
@ -627,7 +627,7 @@ public class MimeMultipart {
*/
public synchronized void addBodyPart(MimeBodyPart part, int index) {
if (parts == null)
parts = new FinalArrayList();
parts = new FinalArrayList<MimeBodyPart>();
parts.add(index,part);
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.
*
* 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.util.List;
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.MIMEMessage;
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.
*
* 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 ...
st = new StringTokenizer(etext, lwsp, true);
StringBuffer sb = new StringBuffer(); // decode buffer
StringBuffer wsb = new StringBuffer(); // white space buffer
StringBuilder sb = new StringBuilder(); // decode buffer
StringBuilder wsb = new StringBuilder(); // white space buffer
boolean prevWasEncoded = false;
while (st.hasMoreTokens()) {
@ -648,7 +648,7 @@ public class MimeUtility {
throw new UnsupportedEncodingException(
"Unknown transfer encoding: " + encoding);
StringBuffer outb = new StringBuffer(); // the output buffer
StringBuilder outb = new StringBuilder(); // the output buffer
doEncode(string, b64, jcharset,
// As per RFC 2047, size of an encoded string should not
// exceed 75 bytes.
@ -662,7 +662,7 @@ public class MimeUtility {
private static void doEncode(String string, boolean b64,
String jcharset, int avail, String prefix,
boolean first, boolean encodingWord, StringBuffer buf)
boolean first, boolean encodingWord, StringBuilder buf)
throws UnsupportedEncodingException {
// First find out what the length of the encoded version of
@ -812,7 +812,7 @@ public class MimeUtility {
private static String decodeInnerWords(String word)
throws UnsupportedEncodingException {
int start = 0, i;
StringBuffer buf = new StringBuffer();
StringBuilder buf = new StringBuilder();
while ((i = word.indexOf("=?", start)) >= 0) {
buf.append(word.substring(start, i));
int end = word.indexOf("?=", i);
@ -862,7 +862,7 @@ public class MimeUtility {
char c = word.charAt(i);
if (c == '"' || c == '\\' || c == '\r' || c == '\n') {
// 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(word.substring(0, i));
int lastc = 0;
@ -885,7 +885,7 @@ public class MimeUtility {
}
if (needQuoting) {
StringBuffer sb = new StringBuffer(len + 2);
StringBuilder sb = new StringBuilder(len + 2);
sb.append('"').append(word).append('"');
return sb.toString();
} else
@ -927,7 +927,7 @@ public class MimeUtility {
return s;
// have to actually fold the string
StringBuffer sb = new StringBuffer(s.length() + 4);
StringBuilder sb = new StringBuilder(s.length() + 4);
char lastc = 0;
while (used + s.length() > 76) {
int lastspace = -1;
@ -969,7 +969,7 @@ public class MimeUtility {
if (!foldText)
return s;
StringBuffer sb = null;
StringBuilder sb = null;
int i;
while ((i = indexOfAny(s, "\r\n")) >= 0) {
int start = i;
@ -986,7 +986,7 @@ public class MimeUtility {
while (i < l && ((c = s.charAt(i)) == ' ' || c == '\t'))
i++;
if (sb == null)
sb = new StringBuffer(s.length());
sb = new StringBuilder(s.length());
if (start != 0) {
sb.append(s.substring(0, start));
sb.append(' ');
@ -996,14 +996,14 @@ public class MimeUtility {
}
// it's not a continuation line, just leave it in
if (sb == null)
sb = new StringBuffer(s.length());
sb = new StringBuilder(s.length());
sb.append(s.substring(0, i));
s = s.substring(i);
} else {
// there's a backslash at "start - 1"
// strip it out, but leave in the line break
if (sb == null)
sb = new StringBuffer(s.length());
sb = new StringBuilder(s.length());
sb.append(s.substring(0, start - 1));
sb.append(s.substring(start, i));
s = s.substring(i);
@ -1051,7 +1051,7 @@ public class MimeUtility {
// no mapping table, or charset parameter is null
return charset;
String alias = (String)mime2java.get(charset.toLowerCase());
String alias = mime2java.get(charset.toLowerCase());
return alias == null ? charset : alias;
}
@ -1073,7 +1073,7 @@ public class MimeUtility {
// no mapping table or charset param is null
return charset;
String alias = (String)java2mime.get(charset.toLowerCase());
String alias = java2mime.get(charset.toLowerCase());
return alias == null ? charset : alias;
}
@ -1140,12 +1140,12 @@ public class MimeUtility {
// Tables to map MIME charset names to Java names and vice versa.
// XXX - Should eventually use J2SE 1.4 java.nio.charset.Charset
private static Hashtable mime2java;
private static Hashtable java2mime;
private static Hashtable<String, String> mime2java;
private static Hashtable<String, String> java2mime;
static {
java2mime = new Hashtable(40);
mime2java = new Hashtable(10);
java2mime = new Hashtable<String, String>(40);
mime2java = new Hashtable<String, String>(10);
try {
// 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;
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.
*
* 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 {
private final HashMap list;
private final HashMap<String, String> list;
/**
* No-arg Constructor.
*/
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;
}
@ -73,7 +73,7 @@ public final class ParameterList {
int type;
String name;
list = new HashMap();
list = new HashMap<String, String>();
while (true) {
tk = h.next();
type = tk.getType();
@ -130,7 +130,7 @@ public final class ParameterList {
* present.
*/
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.
*/
public Iterator getNames() {
public Iterator<String> getNames() {
return list.keySet().iterator();
}
@ -190,13 +190,13 @@ public final class ParameterList {
* @return String
*/
public String toString(int used) {
StringBuffer sb = new StringBuffer();
Iterator itr = list.entrySet().iterator();
StringBuilder sb = new StringBuilder();
Iterator<Map.Entry<String, String>> itr = list.entrySet().iterator();
while (itr.hasNext()) {
Map.Entry e = (Map.Entry)itr.next();
String name = (String)e.getKey();
String value = quote((String)e.getValue());
Map.Entry<String, String> e = itr.next();
String name = e.getKey();
String value = quote(e.getValue());
sb.append("; ");
used += 2;
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.
*
* 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).
*/
public static String getUniqueBoundaryValue() {
StringBuffer s = new StringBuffer();
StringBuilder s = new StringBuilder();
// Unique string is ----=_Part_<part>_<hashcode>.<currentTime>
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.
*
* 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;
import com.sun.xml.internal.messaging.saaj.util.ByteOutputStream;
import java.io.OutputStream;
import java.io.IOException;

View File

@ -70,9 +70,8 @@ abstract class ContextClassloaderLocal<V> {
}
private static ClassLoader getContextClassLoader() {
return (ClassLoader)
AccessController.doPrivileged(new PrivilegedAction() {
public Object run() {
return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
public ClassLoader run() {
ClassLoader cl = null;
try {
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.RejectDoctypeSaxFilter;
import com.sun.xml.internal.messaging.saaj.util.transform.EfficientStreamingTransformer;
import org.xml.sax.InputSource;
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.stax.StAXSource;
import javax.xml.transform.stream.StreamSource;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.logging.Logger;
/**
@ -53,6 +57,8 @@ import java.util.logging.Logger;
* underlying implementations.
*/
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
log = Logger.getLogger(LogDomainConstants.SOAP_DOMAIN,
@ -62,9 +68,22 @@ public class EnvelopeFactory {
new ContextClassloaderLocal<ParserPool>() {
@Override
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)
throws SOAPException
@ -132,51 +151,55 @@ public class EnvelopeFactory {
}
private static Envelope parseEnvelopeSax(Source src, SOAPPartImpl soapPart)
throws SOAPException {
// Insert SAX filter to disallow Document Type Declarations since
// they are not legal in SOAP
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 {
Transformer transformer =
EfficientStreamingTransformer.newTransformer();
DOMResult result = new DOMResult(soapPart);
transformer.transform(src, result);
// Insert SAX filter to disallow Document Type Declarations since
// they are not legal in SOAP
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);
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 {
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 {
//no matter what condition occurs, always return the parser to the pool
if (saxParser != null) {
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.
*
* 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());
}
ImageWriter writer = null;
Iterator i = ImageIO.getImageWritersByMIMEType(type);
Iterator<ImageWriter> i = ImageIO.getImageWritersByMIMEType(type);
if (i.hasNext()) {
writer = (ImageWriter)i.next();
writer = i.next();
}
if (writer != 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.
*
* 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 ContentType contentType;
protected SOAPPartImpl soapPartImpl;
protected FinalArrayList attachments;
protected FinalArrayList<AttachmentPart> attachments;
protected boolean saved = false;
protected byte[] messageBytes;
protected int messageByteCount;
@ -855,7 +855,7 @@ public abstract class MessageImpl
throw new RuntimeException(e);
}
if (attachments == null)
attachments = new FinalArrayList();
attachments = new FinalArrayList<AttachmentPart>();
attachments.add(attachment);
@ -887,15 +887,15 @@ public abstract class MessageImpl
headers.setHeader("Content-Type", ct.toString());
}
private class MimeMatchingIterator implements Iterator {
private class MimeMatchingIterator implements Iterator<AttachmentPart> {
public MimeMatchingIterator(MimeHeaders headers) {
this.headers = headers;
this.iter = attachments.iterator();
}
private Iterator iter;
private Iterator<AttachmentPart> iter;
private MimeHeaders headers;
private Object nextAttachment;
private AttachmentPart nextAttachment;
public boolean hasNext() {
if (nextAttachment == null)
@ -903,9 +903,9 @@ public abstract class MessageImpl
return nextAttachment != null;
}
public Object next() {
public AttachmentPart next() {
if (nextAttachment != null) {
Object ret = nextAttachment;
AttachmentPart ret = nextAttachment;
nextAttachment = null;
return ret;
}
@ -916,7 +916,7 @@ public abstract class MessageImpl
return null;
}
Object nextMatch() {
AttachmentPart nextMatch() {
while (iter.hasNext()) {
AttachmentPartImpl ap = (AttachmentPartImpl) iter.next();
if (ap.hasAllHeaders(headers))
@ -951,12 +951,12 @@ public abstract class MessageImpl
if (attachments == null)
return ;
Iterator it = new MimeMatchingIterator(headers);
Iterator<AttachmentPart> it = new MimeMatchingIterator(headers);
while (it.hasNext()) {
int index = attachments.indexOf(it.next());
attachments.set(index, null);
}
FinalArrayList f = new FinalArrayList();
FinalArrayList<AttachmentPart> f = new FinalArrayList<AttachmentPart>();
for (int i = 0; i < attachments.size(); i++) {
if (attachments.get(i) != null) {
f.add(attachments.get(i));
@ -1066,7 +1066,7 @@ public abstract class MessageImpl
}
private String convertToSingleLine(String contentType) {
StringBuffer buffer = new StringBuffer();
StringBuilder buffer = new StringBuilder();
for (int i = 0; i < contentType.length(); i ++) {
char c = contentType.charAt(i);
if (c != '\r' && c != '\n' && c != '\t')
@ -1098,7 +1098,7 @@ public abstract class MessageImpl
headerAndBody = new BMMimeMultipart();
headerAndBody.addBodyPart(mimeSoapPart);
if (attachments != null) {
for (Iterator eachAttachment = attachments.iterator();
for (Iterator<AttachmentPart> eachAttachment = attachments.iterator();
eachAttachment.hasNext();) {
headerAndBody.addBodyPart(
((AttachmentPartImpl) eachAttachment.next())
@ -1424,7 +1424,7 @@ public abstract class MessageImpl
}
if (attachments == null)
attachments = new FinalArrayList();
attachments = new FinalArrayList<AttachmentPart>();
int count = multiPart.getCount();
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.
*
* 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 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.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.
*
* 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.soap.SOAPException;
import javax.xml.stream.XMLStreamConstants;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
import javax.xml.stream.XMLStreamWriter;
@ -76,7 +77,7 @@ public class StaxLazySourceBridge extends StaxBridge {
public String getPayloadAttributeValue(String attName) {
if (lazySource.isPayloadStreamReader()) {
XMLStreamReader reader = lazySource.readPayload();
if (reader.getEventType() == reader.START_ELEMENT) {
if (reader.getEventType() == XMLStreamConstants.START_ELEMENT) {
return reader.getAttributeValue(null, attName);
}
}
@ -87,7 +88,7 @@ public class StaxLazySourceBridge extends StaxBridge {
public String getPayloadAttributeValue(QName attName) {
if (lazySource.isPayloadStreamReader()) {
XMLStreamReader reader = lazySource.readPayload();
if (reader.getEventType() == reader.START_ELEMENT) {
if (reader.getEventType() == XMLStreamConstants.START_ELEMENT) {
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.
*
* 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.soap.SOAPException;
import javax.xml.stream.XMLStreamConstants;
import javax.xml.stream.XMLStreamReader;
import com.sun.xml.internal.org.jvnet.staxex.util.XMLStreamReaderToXMLStreamWriter;
@ -65,14 +66,14 @@ public class StaxReaderBridge extends StaxBridge {
}
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) {
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) {
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.
*
* This code is free software; you can redistribute it and/or modify it
@ -30,7 +30,6 @@ import java.io.*;
import javax.activation.*;
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;
/**

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.
*
* 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 static final String STR_SRC = "javax.xml.transform.stream.StreamSource";
private static Class streamSourceClass = null;
private static Class<?> streamSourceClass = null;
public XmlDataContentHandler() throws ClassNotFoundException {
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.
*
* 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;
import java.io.IOException;
import java.io.InputStream;
import javax.xml.soap.*;
import com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl;
import com.sun.xml.internal.messaging.saaj.soap.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.
*
* 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() {
Iterator eachChild = getChildElementNodes();
Iterator<Node> eachChild = getChildElementNodes();
while (eachChild.hasNext()) {
SOAPElement child = (SOAPElement) eachChild.next();
if (isFault(child)) {
@ -247,7 +247,7 @@ public abstract class BodyImpl extends ElementImpl implements SOAPBody {
org.w3c.dom.Node replacingNode = ownerDoc.importNode(docFrag, true);
// Adding replacingNode at the last of the children list of body
addNode(replacingNode);
Iterator i =
Iterator<Node> i =
getChildElements(NameImpl.copyElementName(rootElement));
// Return the child element with the required name which is at the
// end of the list
@ -284,7 +284,7 @@ public abstract class BodyImpl extends ElementImpl implements SOAPBody {
public Document extractContentAsDocument() throws SOAPException {
Iterator eachChild = getChildElements();
Iterator<Node> eachChild = getChildElements();
javax.xml.soap.Node firstBodyElement = null;
while (eachChild.hasNext() &&
@ -314,8 +314,7 @@ public abstract class BodyImpl extends ElementImpl implements SOAPBody {
Document document = null;
try {
DocumentBuilderFactory factory =
new com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl();
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(true);
DocumentBuilder builder = factory.newDocumentBuilder();
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.
*
* 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() {
return new Iterator() {
Iterator eachNode = getChildElementNodes();
return new Iterator<SOAPElement>() {
Iterator<org.w3c.dom.Node> eachNode = getChildElementNodes();
SOAPElement next = null;
SOAPElement last = null;
@ -95,7 +95,7 @@ public abstract class DetailImpl extends FaultElementImpl implements Detail {
return next != null;
}
public Object next() {
public SOAPElement next() {
if (!hasNext()) {
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.
*
* This code is free software; you can redistribute it and/or modify it
@ -162,8 +162,8 @@ public class ElementImpl
!(currentAncestor instanceof Document)) {
if (currentAncestor instanceof ElementImpl) {
QName name = ((ElementImpl) currentAncestor).getElementQName();
/*
QName name = ((ElementImpl) currentAncestor).getElementQName();
if (prefix.equals(name.getPrefix())) {
String uri = name.getNamespaceURI();
if ("".equals(uri)) {
@ -339,7 +339,7 @@ public class ElementImpl
log.severe("SAAJ0158.impl.version.mismatch.fault");
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()) {
log.severe("SAAJ0156.impl.adding.fault.error");
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) {
Iterator eachChild = getChildElementNodes();
Iterator<Node> eachChild = getChildElementNodes();
while (eachChild.hasNext()) {
SOAPElement child = (SOAPElement) eachChild.next();
if (child.getElementName().equals(name)) {
@ -560,10 +560,10 @@ public class ElementImpl
}
public Iterator getAllAttributes() {
Iterator i = getAllAttributesFrom(this);
ArrayList list = new ArrayList();
Iterator<Name> i = getAllAttributesFrom(this);
ArrayList<Name> list = new ArrayList<Name>();
while (i.hasNext()) {
Name name = (Name) i.next();
Name name = i.next();
if (!"xmlns".equalsIgnoreCase(name.getPrefix()))
list.add(name);
}
@ -571,10 +571,10 @@ public class ElementImpl
}
public Iterator getAllAttributesAsQNames() {
Iterator i = getAllAttributesFrom(this);
ArrayList list = new ArrayList();
Iterator<Name> i = getAllAttributesFrom(this);
ArrayList<QName> list = new ArrayList<QName>();
while (i.hasNext()) {
Name name = (Name) i.next();
Name name = i.next();
if (!"xmlns".equalsIgnoreCase(name.getPrefix())) {
list.add(NameImpl.convertToQName(name));
}
@ -591,8 +591,8 @@ public class ElementImpl
return doGetNamespacePrefixes(true);
}
protected Iterator doGetNamespacePrefixes(final boolean deep) {
return new Iterator() {
protected Iterator<String> doGetNamespacePrefixes(final boolean deep) {
return new Iterator<String>() {
String next = null;
String last = null;
NamespaceContextIterator eachNamespace =
@ -613,7 +613,7 @@ public class ElementImpl
return next != null;
}
public Object next() {
public String next() {
findNext();
if (next == null) {
throw new NoSuchElementException();
@ -676,7 +676,7 @@ public class ElementImpl
return true;
}
public Iterator getChildElements() {
public Iterator<Node> getChildElements() {
return getChildElementsFrom(this);
}
@ -694,15 +694,15 @@ public class ElementImpl
Element element,
ElementImpl copy) {
Iterator eachAttribute = getAllAttributesFrom(element);
Iterator<Name> eachAttribute = getAllAttributesFrom(element);
while (eachAttribute.hasNext()) {
Name name = (Name) eachAttribute.next();
Name name = eachAttribute.next();
copy.addAttributeBare(name, getAttributeValueFrom(element, name));
}
Iterator eachChild = getChildElementsFrom(element);
Iterator<Node> eachChild = getChildElementsFrom(element);
while (eachChild.hasNext()) {
Node nextChild = (Node) eachChild.next();
Node nextChild = eachChild.next();
copy.insertBefore(nextChild, null);
}
@ -714,16 +714,16 @@ public class ElementImpl
return copy;
}
protected Iterator getChildElementNodes() {
return new Iterator() {
Iterator eachNode = getChildElements();
protected Iterator<Node> getChildElementNodes() {
return new Iterator<Node>() {
Iterator<Node> eachNode = getChildElements();
Node next = null;
Node last = null;
public boolean hasNext() {
if (next == null) {
while (eachNode.hasNext()) {
Node node = (Node) eachNode.next();
Node node = eachNode.next();
if (node instanceof SOAPElement) {
next = node;
break;
@ -733,7 +733,7 @@ public class ElementImpl
return next != null;
}
public Object next() {
public Node next() {
if (hasNext()) {
last = next;
next = null;
@ -761,16 +761,16 @@ public class ElementImpl
return getChildElements(qname.getNamespaceURI(), qname.getLocalPart());
}
private Iterator getChildElements(final String nameUri, final String nameLocal) {
return new Iterator() {
Iterator eachElement = getChildElementNodes();
private Iterator<Node> getChildElements(final String nameUri, final String nameLocal) {
return new Iterator<Node>() {
Iterator<Node> eachElement = getChildElementNodes();
Node next = null;
Node last = null;
public boolean hasNext() {
if (next == null) {
while (eachElement.hasNext()) {
Node element = (Node) eachElement.next();
Node element = eachElement.next();
String elementUri = element.getNamespaceURI();
elementUri = elementUri == null ? "" : elementUri;
String elementName = element.getLocalName();
@ -784,7 +784,7 @@ public class ElementImpl
return next != null;
}
public Object next() {
public Node next() {
if (!hasNext()) {
throw new NoSuchElementException();
}
@ -894,7 +894,7 @@ public class ElementImpl
}
protected javax.xml.soap.Node getValueNode() {
Iterator i = getChildElements();
Iterator<Node> i = getChildElements();
while (i.hasNext()) {
javax.xml.soap.Node n = (javax.xml.soap.Node) i.next();
if (n.getNodeType() == org.w3c.dom.Node.TEXT_NODE ||
@ -1054,10 +1054,10 @@ public class ElementImpl
return null;
}
protected static Iterator getAllAttributesFrom(final Element element) {
protected static Iterator<Name> getAllAttributesFrom(final Element element) {
final NamedNodeMap attributes = element.getAttributes();
return new Iterator() {
return new Iterator<Name>() {
int attributesLength = attributes.getLength();
int attributeIndex = 0;
String currentName;
@ -1066,7 +1066,7 @@ public class ElementImpl
return attributeIndex < attributesLength;
}
public Object next() {
public Name next() {
if (!hasNext()) {
throw new NoSuchElementException();
}
@ -1133,8 +1133,8 @@ public class ElementImpl
return attribute == null ? null : attribute.getValue();
}
protected static Iterator getChildElementsFrom(final Element element) {
return new Iterator() {
protected static Iterator<Node> getChildElementsFrom(final Element element) {
return new Iterator<Node>() {
Node next = element.getFirstChild();
Node nextNext = null;
Node last = null;
@ -1150,7 +1150,7 @@ public class ElementImpl
return next != null;
}
public Object next() {
public Node next() {
if (hasNext()) {
last = next;
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.
*
* 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;
}
private String getOmitXmlDecl() {
return this.omitXmlDecl;
}
public void setCharsetEncoding(String value) {
charset = value;
}
@ -309,7 +305,6 @@ public abstract class EnvelopeImpl extends ElementImpl implements LazyEnvelope {
else {
try {
// Run transform and generate FI output from content
Source source = getContent();
Transformer transformer = EfficientStreamingTransformer.newTransformer();
transformer.transform(getContent(),
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.
*
* 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 org.w3c.dom.Element;
import org.w3c.dom.Node;
import com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl;
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);
}
protected Iterator getHeaderElementsForActor(
protected Iterator<SOAPHeaderElement> getHeaderElementsForActor(
String actor,
boolean detach,
boolean mustUnderstand) {
@ -127,15 +126,15 @@ public abstract class HeaderImpl extends ElementImpl implements SOAPHeader {
return getHeaderElements(actor, detach, mustUnderstand);
}
protected Iterator getHeaderElements(
protected Iterator<SOAPHeaderElement> getHeaderElements(
String actor,
boolean detach,
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) {
if (!(currentChild instanceof SOAPHeaderElement)) {
currentChild = iterate(eachChild);
@ -173,7 +172,7 @@ public abstract class HeaderImpl extends ElementImpl implements SOAPHeader {
return elementList.listIterator();
}
private Object iterate(Iterator each) {
private <T> T iterate(Iterator<T> each) {
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.
*
* 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.soap.SOAPElement;
import javax.xml.soap.SOAPFaultElement;
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPConstants;
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.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.
*
* 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;
import java.util.List;
import java.util.Iterator;
import java.util.logging.Level;
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.
*
* 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;
import java.util.logging.Level;
import java.util.logging.Logger;
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.
*
* 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;
import java.util.logging.Logger;
import java.util.Locale;
import javax.xml.namespace.QName;
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.
*
* This code is free software; you can redistribute it and/or modify it
@ -146,7 +146,7 @@ public class Fault1_2Impl extends FaultImpl {
findReasonElement();
Iterator eachTextElement =
this.faultStringElement.getChildElements(textName);
List texts = new ArrayList();
List<String> texts = new ArrayList<String>();
while (eachTextElement.hasNext()) {
SOAPElement textElement = (SOAPElement) eachTextElement.next();
Locale thisLocale = getLocale(textElement);
@ -235,7 +235,7 @@ public class Fault1_2Impl extends FaultImpl {
findReasonElement();
Iterator eachTextElement =
this.faultStringElement.getChildElements(textName);
List localeSet = new ArrayList();
List<Locale> localeSet = new ArrayList<Locale>();
while (eachTextElement.hasNext()) {
SOAPElement textElement = (SOAPElement) eachTextElement.next();
Locale thisLocale = getLocale(textElement);
@ -435,7 +435,7 @@ public class Fault1_2Impl extends FaultImpl {
public Iterator getFaultSubcodes() {
if (this.faultCodeElement == null)
findFaultCodeElement();
final List subcodeList = new ArrayList();
final List<QName> subcodeList = new ArrayList<QName>();
SOAPElement currentCodeElement = this.faultCodeElement;
Iterator subcodeElements =
currentCodeElement.getChildElements(subcodeName);
@ -449,14 +449,14 @@ public class Fault1_2Impl extends FaultImpl {
subcodeElements = currentCodeElement.getChildElements(subcodeName);
}
//return subcodeList.iterator();
return new Iterator() {
Iterator subCodeIter = subcodeList.iterator();
return new Iterator<QName>() {
Iterator<QName> subCodeIter = subcodeList.iterator();
public boolean hasNext() {
return subCodeIter.hasNext();
}
public Object next() {
public QName 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.
*
* 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;
import java.util.List;
import java.util.Iterator;
import java.util.logging.Logger;
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.soap.SOAPDocument;
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.name.NameImpl;
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.
*
* 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;
import java.util.logging.Logger;
import javax.xml.namespace.QName;
import javax.xml.soap.Name;
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 {
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) {
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.
*
* 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;
import java.util.logging.Level;
import java.util.logging.Logger;
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.
*
* 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 EIGHTBIT = 8;
static private final int SIXTEENBIT = 16;
static private final int SIXBIT = 6;
static private final int FOURBYTE = 4;
@ -244,7 +243,7 @@ public final class Base64 {
public static String base64Decode( String orig ) {
char chars[]=orig.toCharArray();
StringBuffer sb=new StringBuffer();
StringBuilder sb=new StringBuilder();
int i=0;
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.
*
* 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.
*/
static Constructor fiDOMDocumentParser_new;
static Constructor<?> fiDOMDocumentParser_new;
/**
* FI <code>DOMDocumentParser.parse()</code> method via reflection.
@ -54,7 +54,7 @@ public class FastInfosetReflection {
/**
* FI DOMDocumentSerializer constructor using reflection.
*/
static Constructor fiDOMDocumentSerializer_new;
static Constructor<?> fiDOMDocumentSerializer_new;
/**
* FI <code>FastInfosetSource.serialize(Document)</code> method via reflection.
@ -69,12 +69,12 @@ public class FastInfosetReflection {
/**
* FI FastInfosetSource constructor using reflection.
*/
static Class fiFastInfosetSource_class;
static Class<?> fiFastInfosetSource_class;
/**
* FI FastInfosetSource constructor using reflection.
*/
static Constructor fiFastInfosetSource_new;
static Constructor<?> fiFastInfosetSource_new;
/**
* FI <code>FastInfosetSource.getInputStream()</code> method via reflection.
@ -89,7 +89,7 @@ public class FastInfosetReflection {
/**
* FI FastInfosetResult constructor using reflection.
*/
static Constructor fiFastInfosetResult_new;
static Constructor<?> fiFastInfosetResult_new;
/**
* FI <code>FastInfosetResult.getOutputSTream()</code> method via reflection.
@ -98,7 +98,7 @@ public class FastInfosetReflection {
static {
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_parse = clazz.getMethod("parse",
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");
}
public static Class getFastInfosetSource_class() {
public static Class<?> getFastInfosetSource_class() {
if (fiFastInfosetSource_class == null) {
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.
*
* 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.
* @author Kohsuke Kawaguchi
*/
public final class FinalArrayList extends ArrayList {
public final class FinalArrayList<E> extends ArrayList<E> {
public FinalArrayList(int initialCapacity) {
super(initialCapacity);
}
@ -40,7 +40,7 @@ public final class FinalArrayList extends ArrayList {
public FinalArrayList() {
}
public FinalArrayList(Collection collection) {
public FinalArrayList(Collection<? extends E> 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.
*
* 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;
return;
}
CharWriter cout = new CharWriter();
CharArrayWriter cout = new CharArrayWriter();
char[] temp = new char[1024];
int len;
while (-1 != (len = rdr.read(temp)))
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() {

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.
*
* 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.
* <p>
* Parsing of a URI specification is done according to the URI
* syntax described in RFC 2396
* <http://www.ietf.org/rfc/rfc2396.txt?number=2396>. Every URI consists
* of a scheme, followed by a colon (':'), followed by a scheme-specific
* syntax described in <a href="http://www.ietf.org/rfc/rfc2396.txt?number=2396">RFC 2396</a>.
* Every URI consists of a scheme, followed by a colon (':'), followed by a scheme-specific
* part. For URIs that follow the "generic URI" syntax, the scheme-
* specific part begins with two slashes ("//") and may be followed
* 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 */
private String m_fragment = null;
private static boolean DEBUG = false;
/**
* Construct a new and uninitialized URI.
*/
@ -725,7 +722,7 @@ import java.io.Serializable;
* @return the scheme-specific part for this URI
*/
public String getSchemeSpecificPart() {
StringBuffer schemespec = new StringBuffer();
StringBuilder schemespec = new StringBuilder();
if (m_userinfo != null || m_host != null || m_port != -1) {
schemespec.append("//");
@ -805,7 +802,7 @@ import java.io.Serializable;
*/
public String getPath(boolean p_includeQueryString,
boolean p_includeFragment) {
StringBuffer pathString = new StringBuffer(m_path);
StringBuilder pathString = new StringBuilder(m_path);
if (p_includeQueryString && m_queryString != null) {
pathString.append('?');
@ -1148,7 +1145,7 @@ import java.io.Serializable;
* @return the URI string specification
*/
public String toString() {
StringBuffer uriSpecString = new StringBuffer();
StringBuilder uriSpecString = new StringBuilder();
if (m_scheme != null) {
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.
*
* This code is free software; you can redistribute it and/or modify it
@ -42,7 +42,7 @@ public class ParseUtil {
* represent.
*/
public static String decode(String s) {
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
int i=0;
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.
*
* This code is free software; you can redistribute it and/or modify it
@ -76,10 +76,8 @@ public class XMLDeclarationParser {
{
int c = 0;
int index = 0;
char[] aChar = new char[65535];
StringBuffer xmlDeclStr = new StringBuffer();
StringBuilder xmlDeclStr = new StringBuilder();
while ((c = m_pushbackReader.read()) != -1) {
aChar[index] = (char)c;
xmlDeclStr.append((char)c);
index++;
if (c == '>') {
@ -104,7 +102,7 @@ public class XMLDeclarationParser {
// no XML decl
if (!utf16 && !utf8) {
m_pushbackReader.unread(aChar, 0, len);
m_pushbackReader.unread(decl.toCharArray(), 0, len);
return;
}
m_hasHeader = true;

View File

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

View File

@ -115,12 +115,12 @@ public class SaajStaxWriterEx extends SaajStaxWriter implements XMLStreamWriterE
return currentElement.lookupPrefix(namespaceURI);
}
public Iterator getPrefixes(final String namespaceURI) {
return new Iterator() {
return new Iterator<String>() {
String prefix = getPrefix(namespaceURI);
public boolean hasNext() {
return (prefix != null);
}
public Object next() {
public String next() {
if (prefix == null) throw new java.util.NoSuchElementException();
String next = prefix;
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.
*
* 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,
* this exception can be thrown to abort the creation with error.
* 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 {
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.
*
* 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) {
throwIfIllegalMessageArgument(soap);
if (saajFactory!= null) return packet(saajFactory.createMessage(soap));
return packet(Messages.create(soap));
}
@ -162,6 +163,7 @@ public class MessageContextFactory extends com.oracle.webservices.internal.api.m
if (mf != null) {
p.setMtomFeature(mf);
}
p.setSAAJFactory(saajFactory);
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.
*
* 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) {
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.
*
* 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
*/
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)) {
SOAPMessage msg = s.readAsSOAPMessage(soapVersion, message, packet);
if (msg != null)
@ -173,6 +178,11 @@ public class SAAJFactory {
* @throws SOAPException if SAAJ processing fails
*/
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
// in the ServiceFinder is such that find(Class) is not equivalent
// 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.
*
* 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
* {@code finally} block.
*
*
* @author Kohsuke Kawaguchi
*/
public interface FiberContextSwitchInterceptor {

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