jaxb/0001-Avoid-runtime-dependency-on-istack-commons-from-main.patch

1616 lines
74 KiB
Diff
Raw Normal View History

From d7988b7d7846fb9e6676c700ab21513903f68303 Mon Sep 17 00:00:00 2001
From: Mat Booth <mat.booth@redhat.com>
Date: Tue, 11 Aug 2020 11:46:45 +0100
Subject: [PATCH] Avoid runtime dependency on istack-commons from main impl jar
---
jaxb-ri/bundles/runtime/pom.xml | 9 +-
.../runtime/src/main/java/module-info.java | 3 -
jaxb-ri/runtime/impl/pom.xml | 4 -
.../java/com/sun/xml/bind/api/Bridge.java | 54 +++++-----
.../com/sun/xml/bind/api/ClassResolver.java | 4 +-
.../com/sun/xml/bind/api/JAXBRIContext.java | 52 +++++----
.../sun/xml/bind/marshaller/SAX2DOMEx.java | 3 +-
.../com/sun/xml/bind/v2/ContextFactory.java | 5 +-
.../v2/model/annotation/AnnotationReader.java | 4 -
.../xml/bind/v2/model/core/PropertyInfo.java | 3 +-
.../v2/model/impl/ByteArrayDataSource.java | 65 +++++++++++
.../xml/bind/v2/model/impl/ClassInfoImpl.java | 7 +-
.../bind/v2/model/impl/ElementInfoImpl.java | 5 +-
.../model/impl/ElementPropertyInfoImpl.java | 3 +-
.../impl/RuntimeBuiltinLeafInfoImpl.java | 1 -
.../v2/model/impl/RuntimeClassInfoImpl.java | 3 +-
.../v2/model/impl/RuntimeModelBuilder.java | 3 +-
.../xml/bind/v2/runtime/BridgeAdapter.java | 11 +-
.../sun/xml/bind/v2/runtime/BridgeImpl.java | 9 +-
.../bind/v2/runtime/ClassBeanInfoImpl.java | 5 +-
.../v2/runtime/ContentHandlerAdaptor.java | 12 +--
.../xml/bind/v2/runtime/FilterTransducer.java | 3 +-
.../v2/runtime/InlineBinaryTransducer.java | 3 +-
.../xml/bind/v2/runtime/JAXBContextImpl.java | 16 ++-
.../sun/xml/bind/v2/runtime/JaxBeanInfo.java | 3 +-
.../bind/v2/runtime/NamespaceContext2.java | 3 +-
.../com/sun/xml/bind/v2/runtime/Pool.java | 101 ++++++++++++++++++
.../sun/xml/bind/v2/runtime/Transducer.java | 7 +-
.../v2/runtime/ValueListBeanInfoImpl.java | 3 +-
.../xml/bind/v2/runtime/XMLSerializer.java | 11 +-
.../bind/v2/runtime/output/C14nXmlOutput.java | 3 +-
.../runtime/output/NamespaceContextImpl.java | 6 +-
.../xml/bind/v2/runtime/reflect/Accessor.java | 3 +-
.../xml/bind/v2/runtime/reflect/Lister.java | 3 +-
.../runtime/reflect/TransducedAccessor.java | 9 +-
.../v2/runtime/unmarshaller/Base64Data.java | 8 +-
.../unmarshaller/UnmarshallingContext.java | 11 +-
.../runtime/unmarshaller/XsiTypeLoader.java | 3 +-
.../bind/v2/schemagen/XmlSchemaGenerator.java | 6 +-
.../impl/src/main/java/module-info.java | 1 -
jaxb-ri/xjc/pom.xml | 4 +
41 files changed, 290 insertions(+), 182 deletions(-)
create mode 100644 jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/model/impl/ByteArrayDataSource.java
create mode 100644 jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/Pool.java
diff --git a/jaxb-ri/bundles/runtime/pom.xml b/jaxb-ri/bundles/runtime/pom.xml
index 9277e9b..5d481ed 100644
--- a/jaxb-ri/bundles/runtime/pom.xml
+++ b/jaxb-ri/bundles/runtime/pom.xml
@@ -67,11 +67,6 @@
<artifactId>txw2</artifactId>
<scope>provided</scope>
</dependency>
- <dependency>
- <groupId>com.sun.istack</groupId>
- <artifactId>istack-commons-runtime</artifactId>
- <scope>provided</scope>
- </dependency>
<dependency>
<groupId>junit</groupId>
@@ -129,7 +124,7 @@
<goal>unpack-dependencies</goal>
</goals>
<configuration>
- <includeGroupIds>org.glassfish.jaxb,com.sun.istack</includeGroupIds>
+ <includeGroupIds>org.glassfish.jaxb</includeGroupIds>
<includeScope>provided</includeScope>
<classifier>sources</classifier>
<excludeTransitive>true</excludeTransitive>
@@ -144,7 +139,7 @@
<goal>unpack-dependencies</goal>
</goals>
<configuration>
- <includeGroupIds>org.glassfish.jaxb,com.sun.istack</includeGroupIds>
+ <includeGroupIds>org.glassfish.jaxb</includeGroupIds>
<includeScope>provided</includeScope>
<classifier>sources</classifier>
<excludeTransitive>true</excludeTransitive>
diff --git a/jaxb-ri/bundles/runtime/src/main/java/module-info.java b/jaxb-ri/bundles/runtime/src/main/java/module-info.java
index 252fefe..2fa8190 100644
--- a/jaxb-ri/bundles/runtime/src/main/java/module-info.java
+++ b/jaxb-ri/bundles/runtime/src/main/java/module-info.java
@@ -20,9 +20,6 @@ module com.sun.xml.bind {
requires static com.sun.xml.fastinfoset;
requires static org.jvnet.staxex;
- exports com.sun.istack;
- exports com.sun.istack.localization;
- exports com.sun.istack.logging;
exports com.sun.xml.bind;
exports com.sun.xml.bind.annotation;
exports com.sun.xml.bind.api;
diff --git a/jaxb-ri/runtime/impl/pom.xml b/jaxb-ri/runtime/impl/pom.xml
index 67390ff..3b38efd 100644
--- a/jaxb-ri/runtime/impl/pom.xml
+++ b/jaxb-ri/runtime/impl/pom.xml
@@ -56,10 +56,6 @@
<groupId>${project.groupId}</groupId>
<artifactId>txw2</artifactId>
</dependency>
- <dependency>
- <groupId>com.sun.istack</groupId>
- <artifactId>istack-commons-runtime</artifactId>
- </dependency>
<dependency>
<groupId>org.jvnet.staxex</groupId>
diff --git a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/api/Bridge.java b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/api/Bridge.java
index fb20366..5e7b035 100644
--- a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/api/Bridge.java
+++ b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/api/Bridge.java
@@ -24,8 +24,6 @@ import javax.xml.stream.XMLStreamWriter;
import javax.xml.transform.Result;
import javax.xml.transform.Source;
-import com.sun.istack.NotNull;
-import com.sun.istack.Nullable;
import com.sun.xml.bind.v2.runtime.BridgeContextImpl;
import com.sun.xml.bind.v2.runtime.JAXBContextImpl;
@@ -61,7 +59,7 @@ public abstract class Bridge<T> {
*
* @since 2.1
*/
- public @NotNull JAXBRIContext getContext() {
+ public JAXBRIContext getContext() {
return context;
}
@@ -83,11 +81,11 @@ public abstract class Bridge<T> {
context.marshallerPool.recycle(m);
}
- public final void marshal(@NotNull BridgeContext context,T object,XMLStreamWriter output) throws JAXBException {
+ public final void marshal(BridgeContext context,T object,XMLStreamWriter output) throws JAXBException {
marshal( ((BridgeContextImpl)context).marshaller, object, output );
}
- public abstract void marshal(@NotNull Marshaller m,T object,XMLStreamWriter output) throws JAXBException;
+ public abstract void marshal(Marshaller m,T object,XMLStreamWriter output) throws JAXBException;
/**
@@ -117,11 +115,11 @@ public abstract class Bridge<T> {
context.marshallerPool.recycle(m);
}
- public final void marshal(@NotNull BridgeContext context,T object,OutputStream output, NamespaceContext nsContext) throws JAXBException {
+ public final void marshal(BridgeContext context,T object,OutputStream output, NamespaceContext nsContext) throws JAXBException {
marshal( ((BridgeContextImpl)context).marshaller, object, output, nsContext );
}
- public abstract void marshal(@NotNull Marshaller m,T object,OutputStream output, NamespaceContext nsContext) throws JAXBException;
+ public abstract void marshal(Marshaller m,T object,OutputStream output, NamespaceContext nsContext) throws JAXBException;
public final void marshal(T object,Node output) throws JAXBException {
@@ -130,11 +128,11 @@ public abstract class Bridge<T> {
context.marshallerPool.recycle(m);
}
- public final void marshal(@NotNull BridgeContext context,T object,Node output) throws JAXBException {
+ public final void marshal(BridgeContext context,T object,Node output) throws JAXBException {
marshal( ((BridgeContextImpl)context).marshaller, object, output );
}
- public abstract void marshal(@NotNull Marshaller m,T object,Node output) throws JAXBException;
+ public abstract void marshal(Marshaller m,T object,Node output) throws JAXBException;
/**
@@ -153,10 +151,10 @@ public abstract class Bridge<T> {
m.setAttachmentMarshaller(null);
context.marshallerPool.recycle(m);
}
- public final void marshal(@NotNull BridgeContext context,T object, ContentHandler contentHandler) throws JAXBException {
+ public final void marshal(BridgeContext context,T object, ContentHandler contentHandler) throws JAXBException {
marshal( ((BridgeContextImpl)context).marshaller, object, contentHandler );
}
- public abstract void marshal(@NotNull Marshaller m,T object, ContentHandler contentHandler) throws JAXBException;
+ public abstract void marshal(Marshaller m,T object, ContentHandler contentHandler) throws JAXBException;
/**
* @since 2.0 EA4
@@ -166,10 +164,10 @@ public abstract class Bridge<T> {
marshal(m,object,result);
context.marshallerPool.recycle(m);
}
- public final void marshal(@NotNull BridgeContext context,T object, Result result) throws JAXBException {
+ public final void marshal(BridgeContext context,T object, Result result) throws JAXBException {
marshal( ((BridgeContextImpl)context).marshaller, object, result );
}
- public abstract void marshal(@NotNull Marshaller m,T object, Result result) throws JAXBException;
+ public abstract void marshal(Marshaller m,T object, Result result) throws JAXBException;
@@ -195,21 +193,21 @@ public abstract class Bridge<T> {
*
* @since 2.0 EA1
*/
- public final @NotNull T unmarshal(@NotNull XMLStreamReader in) throws JAXBException {
+ public final T unmarshal(XMLStreamReader in) throws JAXBException {
return unmarshal(in,null);
}
/**
* @since 2.0.3
*/
- public final @NotNull T unmarshal(@NotNull XMLStreamReader in, @Nullable AttachmentUnmarshaller au) throws JAXBException {
+ public final T unmarshal(XMLStreamReader in, AttachmentUnmarshaller au) throws JAXBException {
Unmarshaller u = context.unmarshallerPool.take();
u.setAttachmentUnmarshaller(au);
return exit(unmarshal(u,in),u);
}
- public final @NotNull T unmarshal(@NotNull BridgeContext context, @NotNull XMLStreamReader in) throws JAXBException {
+ public final T unmarshal(BridgeContext context, XMLStreamReader in) throws JAXBException {
return unmarshal( ((BridgeContextImpl)context).unmarshaller, in );
}
- public abstract @NotNull T unmarshal(@NotNull Unmarshaller u, @NotNull XMLStreamReader in) throws JAXBException;
+ public abstract T unmarshal(Unmarshaller u, XMLStreamReader in) throws JAXBException;
/**
* Unmarshals the specified type object.
@@ -227,21 +225,21 @@ public abstract class Bridge<T> {
*
* @since 2.0 EA1
*/
- public final @NotNull T unmarshal(@NotNull Source in) throws JAXBException {
+ public final T unmarshal(Source in) throws JAXBException {
return unmarshal(in,null);
}
/**
* @since 2.0.3
*/
- public final @NotNull T unmarshal(@NotNull Source in, @Nullable AttachmentUnmarshaller au) throws JAXBException {
+ public final T unmarshal(Source in, AttachmentUnmarshaller au) throws JAXBException {
Unmarshaller u = context.unmarshallerPool.take();
u.setAttachmentUnmarshaller(au);
return exit(unmarshal(u,in),u);
}
- public final @NotNull T unmarshal(@NotNull BridgeContext context, @NotNull Source in) throws JAXBException {
+ public final T unmarshal(BridgeContext context, Source in) throws JAXBException {
return unmarshal( ((BridgeContextImpl)context).unmarshaller, in );
}
- public abstract @NotNull T unmarshal(@NotNull Unmarshaller u, @NotNull Source in) throws JAXBException;
+ public abstract T unmarshal(Unmarshaller u, Source in) throws JAXBException;
/**
* Unmarshals the specified type object.
@@ -259,14 +257,14 @@ public abstract class Bridge<T> {
*
* @since 2.0 EA1
*/
- public final @NotNull T unmarshal(@NotNull InputStream in) throws JAXBException {
+ public final T unmarshal(InputStream in) throws JAXBException {
Unmarshaller u = context.unmarshallerPool.take();
return exit(unmarshal(u,in),u);
}
- public final @NotNull T unmarshal(@NotNull BridgeContext context, @NotNull InputStream in) throws JAXBException {
+ public final T unmarshal(BridgeContext context, InputStream in) throws JAXBException {
return unmarshal( ((BridgeContextImpl)context).unmarshaller, in );
}
- public abstract @NotNull T unmarshal(@NotNull Unmarshaller u, @NotNull InputStream in) throws JAXBException;
+ public abstract T unmarshal(Unmarshaller u, InputStream in) throws JAXBException;
/**
* Unmarshals the specified type object.
@@ -282,21 +280,21 @@ public abstract class Bridge<T> {
*
* @since 2.0 FCS
*/
- public final @NotNull T unmarshal(@NotNull Node n) throws JAXBException {
+ public final T unmarshal(Node n) throws JAXBException {
return unmarshal(n,null);
}
/**
* @since 2.0.3
*/
- public final @NotNull T unmarshal(@NotNull Node n, @Nullable AttachmentUnmarshaller au) throws JAXBException {
+ public final T unmarshal(Node n, AttachmentUnmarshaller au) throws JAXBException {
Unmarshaller u = context.unmarshallerPool.take();
u.setAttachmentUnmarshaller(au);
return exit(unmarshal(u,n),u);
}
- public final @NotNull T unmarshal(@NotNull BridgeContext context, @NotNull Node n) throws JAXBException {
+ public final T unmarshal(BridgeContext context, Node n) throws JAXBException {
return unmarshal( ((BridgeContextImpl)context).unmarshaller, n );
}
- public abstract @NotNull T unmarshal(@NotNull Unmarshaller context, @NotNull Node n) throws JAXBException;
+ public abstract T unmarshal(Unmarshaller context, Node n) throws JAXBException;
/**
* Gets the {@link TypeReference} from which this bridge was created.
diff --git a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/api/ClassResolver.java b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/api/ClassResolver.java
index b184668..612f5a2 100644
--- a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/api/ClassResolver.java
+++ b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/api/ClassResolver.java
@@ -15,8 +15,6 @@ import javax.xml.bind.Unmarshaller;
import javax.xml.bind.ValidationEventHandler;
import javax.xml.bind.annotation.XmlAnyElement;
-import com.sun.istack.NotNull;
-import com.sun.istack.Nullable;
/**
* Dynamically locates classes to represent elements discovered during the unmarshalling.
@@ -85,5 +83,5 @@ public abstract class ClassResolver {
* reproted to {@link ValidationEventHandler} (just like any other error
* during the unmarshalling.)
*/
- public abstract @Nullable Class<?> resolveElementName(@NotNull String nsUri, @NotNull String localName) throws Exception;
+ public abstract Class<?> resolveElementName(String nsUri, String localName) throws Exception;
}
diff --git a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/api/JAXBRIContext.java b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/api/JAXBRIContext.java
index c8611d9..1a28dc6 100644
--- a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/api/JAXBRIContext.java
+++ b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/api/JAXBRIContext.java
@@ -25,8 +25,6 @@ import javax.xml.bind.annotation.XmlAttachmentRef;
import javax.xml.namespace.QName;
import javax.xml.transform.Result;
-import com.sun.istack.NotNull;
-import com.sun.istack.Nullable;
import com.sun.xml.bind.api.impl.NameConverter;
import com.sun.xml.bind.v2.ContextFactory;
import com.sun.xml.bind.v2.model.annotation.RuntimeAnnotationReader;
@@ -73,11 +71,11 @@ public abstract class JAXBRIContext extends JAXBContext {
* Can be null.
* @since JAXB 2.1 EA2
*/
- public static JAXBRIContext newInstance(@NotNull Class[] classes,
- @Nullable Collection<TypeReference> typeRefs,
- @Nullable Map<Class,Class> subclassReplacements,
- @Nullable String defaultNamespaceRemap, boolean c14nSupport,
- @Nullable RuntimeAnnotationReader ar) throws JAXBException {
+ public static JAXBRIContext newInstance(Class[] classes,
+ Collection<TypeReference> typeRefs,
+ Map<Class,Class> subclassReplacements,
+ String defaultNamespaceRemap, boolean c14nSupport,
+ RuntimeAnnotationReader ar) throws JAXBException {
return newInstance(classes, typeRefs, subclassReplacements,
defaultNamespaceRemap, c14nSupport, ar, false, false, false, false);
}
@@ -115,11 +113,11 @@ public abstract class JAXBRIContext extends JAXBContext {
* @param supressAccessorWarnings
* See {@link #SUPRESS_ACCESSOR_WARNINGS} for the meaning of this parameter.
*/
- public static JAXBRIContext newInstance(@NotNull Class[] classes,
- @Nullable Collection<TypeReference> typeRefs,
- @Nullable Map<Class,Class> subclassReplacements,
- @Nullable String defaultNamespaceRemap, boolean c14nSupport,
- @Nullable RuntimeAnnotationReader ar,
+ public static JAXBRIContext newInstance(Class[] classes,
+ Collection<TypeReference> typeRefs,
+ Map<Class,Class> subclassReplacements,
+ String defaultNamespaceRemap, boolean c14nSupport,
+ RuntimeAnnotationReader ar,
boolean xmlAccessorFactorySupport,
boolean allNillable,
boolean retainPropertyInfo,
@@ -141,9 +139,9 @@ public abstract class JAXBRIContext extends JAXBContext {
* @deprecated
* Compatibility with older versions.
*/
- public static JAXBRIContext newInstance(@NotNull Class[] classes,
- @Nullable Collection<TypeReference> typeRefs,
- @Nullable String defaultNamespaceRemap, boolean c14nSupport ) throws JAXBException {
+ public static JAXBRIContext newInstance(Class[] classes,
+ Collection<TypeReference> typeRefs,
+ String defaultNamespaceRemap, boolean c14nSupport ) throws JAXBException {
return newInstance(classes,typeRefs, Collections.<Class,Class>emptyMap(),
defaultNamespaceRemap,c14nSupport,null);
}
@@ -167,7 +165,7 @@ public abstract class JAXBRIContext extends JAXBContext {
*
* @since 2.0 EA1
*/
- public abstract @Nullable QName getElementName(@NotNull Object o) throws JAXBException;
+ public abstract QName getElementName(Object o) throws JAXBException;
/**
* Allows to retrieve the element name based on Class.
@@ -176,7 +174,7 @@ public abstract class JAXBRIContext extends JAXBContext {
* @throws javax.xml.bind.JAXBException
* @since 2.1.10
*/
- public abstract @Nullable QName getElementName(@NotNull Class o) throws JAXBException;
+ public abstract QName getElementName(Class o) throws JAXBException;
/**
* Creates a mini-marshaller/unmarshaller that can process a {@link TypeReference}.
@@ -186,7 +184,7 @@ public abstract class JAXBRIContext extends JAXBContext {
*
* @since 2.0 EA1
*/
- public abstract Bridge createBridge(@NotNull TypeReference ref);
+ public abstract Bridge createBridge(TypeReference ref);
/**
* Creates a new {@link BridgeContext} instance.
@@ -196,7 +194,7 @@ public abstract class JAXBRIContext extends JAXBContext {
*
* @since 2.0 EA1
*/
- public abstract @NotNull BridgeContext createBridgeContext();
+ public abstract BridgeContext createBridgeContext();
/**
* Gets a {@link RawAccessor} for the specified element property of the specified wrapper bean class.
@@ -244,7 +242,7 @@ public abstract class JAXBRIContext extends JAXBContext {
*
* @since 2.0 EA2
*/
- public abstract @NotNull List<String> getKnownNamespaceURIs();
+ public abstract List<String> getKnownNamespaceURIs();
/**
@@ -272,7 +270,7 @@ public abstract class JAXBRIContext extends JAXBContext {
* if {@link SchemaOutputResolver} throws an {@link IOException}.
*/
@Override
- public abstract void generateSchema(@NotNull SchemaOutputResolver outputResolver) throws IOException;
+ public abstract void generateSchema(SchemaOutputResolver outputResolver) throws IOException;
/**
* Returns the name of the XML Type bound to the
@@ -289,7 +287,7 @@ public abstract class JAXBRIContext extends JAXBContext {
* @return null
* if the referenced type is an anonymous and therefore doesn't have a name.
*/
- public abstract QName getTypeName(@NotNull TypeReference tr);
+ public abstract QName getTypeName(TypeReference tr);
/**
* Gets the build information of the JAXB runtime.
@@ -298,7 +296,7 @@ public abstract class JAXBRIContext extends JAXBContext {
* may be null, if the runtime is loaded by a class loader that doesn't support
* the access to the manifest informatino.
*/
- public abstract @NotNull String getBuildId();
+ public abstract String getBuildId();
/**
* Generates the episode file that represents the binding known to this {@link JAXBContext},
@@ -342,7 +340,7 @@ public abstract class JAXBRIContext extends JAXBContext {
* @return
* Typically, this method returns "nameLikeThis".
*/
- public static @NotNull String mangleNameToVariableName(@NotNull String localName) {
+ public static String mangleNameToVariableName(String localName) {
return NameConverter.standard.toVariableName(localName);
}
@@ -355,7 +353,7 @@ public abstract class JAXBRIContext extends JAXBContext {
* @return
* Typically, this method returns "NameLikeThis".
*/
- public static @NotNull String mangleNameToClassName(@NotNull String localName) {
+ public static String mangleNameToClassName(String localName) {
return NameConverter.standard.toClassName(localName);
}
@@ -370,7 +368,7 @@ public abstract class JAXBRIContext extends JAXBContext {
* @return
* Typically, this method returns "NameLikeThis".
*/
- public static @NotNull String mangleNameToPropertyName(@NotNull String localName) {
+ public static String mangleNameToPropertyName(String localName) {
return NameConverter.standard.toPropertyName(localName);
}
@@ -400,7 +398,7 @@ public abstract class JAXBRIContext extends JAXBContext {
* or null if the type is not assignable to the base type.
* @since 2.0 FCS
*/
- public static @Nullable Type getBaseType(@NotNull Type type, @NotNull Class baseType) {
+ public static Type getBaseType(Type type, Class baseType) {
return Utils.REFLECTION_NAVIGATOR.getBaseClass(type, baseType);
}
diff --git a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/marshaller/SAX2DOMEx.java b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/marshaller/SAX2DOMEx.java
index a7e0dd0..65d9e0f 100644
--- a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/marshaller/SAX2DOMEx.java
+++ b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/marshaller/SAX2DOMEx.java
@@ -16,7 +16,6 @@ import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import com.sun.xml.bind.util.Which;
-import com.sun.istack.FinalArrayList;
import com.sun.xml.bind.v2.util.XmlFactory;
import org.w3c.dom.Document;
@@ -38,7 +37,7 @@ public class SAX2DOMEx implements ContentHandler {
private Node node = null;
private boolean isConsolidate;
protected final Stack<Node> nodeStack = new Stack<Node>();
- private final FinalArrayList<String> unprocessedNamespaces = new FinalArrayList<String>();
+ private final java.util.ArrayList<String> unprocessedNamespaces = new java.util.ArrayList<String>();
/**
* Document object that owns the specified node.
*/
diff --git a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/ContextFactory.java b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/ContextFactory.java
index a05635f..5ae425c 100644
--- a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/ContextFactory.java
+++ b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/ContextFactory.java
@@ -25,7 +25,6 @@ import java.util.logging.Level;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
-import com.sun.istack.FinalArrayList;
import com.sun.xml.bind.Utils;
import com.sun.xml.bind.api.JAXBRIContext;
import com.sun.xml.bind.api.TypeReference;
@@ -222,7 +221,7 @@ public class ContextFactory {
*/
public static JAXBContext createContext( String contextPath,
ClassLoader classLoader, Map<String,Object> properties ) throws JAXBException {
- FinalArrayList<Class> classes = new FinalArrayList<Class>();
+ java.util.ArrayList<Class> classes = new java.util.ArrayList<Class>();
StringTokenizer tokens = new StringTokenizer(contextPath,":");
List<Class> indexedClasses;
@@ -285,7 +284,7 @@ public class ContextFactory {
BufferedReader in =
new BufferedReader(new InputStreamReader(resourceAsStream, "UTF-8"));
try {
- FinalArrayList<Class> classes = new FinalArrayList<Class>();
+ java.util.ArrayList<Class> classes = new java.util.ArrayList<Class>();
String className = in.readLine();
while (className != null) {
className = className.trim();
diff --git a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/model/annotation/AnnotationReader.java b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/model/annotation/AnnotationReader.java
index cb097ae..06bd0d9 100644
--- a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/model/annotation/AnnotationReader.java
+++ b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/model/annotation/AnnotationReader.java
@@ -14,7 +14,6 @@ import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
-import com.sun.istack.Nullable;
import com.sun.xml.bind.v2.model.core.ErrorHandler;
/**
@@ -110,20 +109,17 @@ public interface AnnotationReader<T,C,F,M> {
* @return null
* if the annotation was not found.
*/
- @Nullable
<A extends Annotation> A getMethodParameterAnnotation(
Class<A> annotation, M method, int paramIndex, Locatable srcPos );
/**
* Reads an annotation on a class.
*/
- @Nullable
<A extends Annotation> A getClassAnnotation(Class<A> annotation, C clazz, Locatable srcpos) ;
/**
* Reads an annotation on the package that the given class belongs to.
*/
- @Nullable
<A extends Annotation> A getPackageAnnotation(Class<A> annotation, C clazz, Locatable srcpos);
/**
diff --git a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/model/core/PropertyInfo.java b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/model/core/PropertyInfo.java
index af5431c..20c7524 100644
--- a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/model/core/PropertyInfo.java
+++ b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/model/core/PropertyInfo.java
@@ -19,7 +19,6 @@ import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.namespace.QName;
-import com.sun.istack.Nullable;
import com.sun.xml.bind.v2.model.annotation.AnnotationSource;
/**
@@ -133,5 +132,5 @@ public interface PropertyInfo<T,C> extends AnnotationSource {
* when this returns non-null, it overrides the type names of all types
* that are in this property.)
*/
- @Nullable QName getSchemaType();
+ QName getSchemaType();
}
diff --git a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/model/impl/ByteArrayDataSource.java b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/model/impl/ByteArrayDataSource.java
new file mode 100644
index 0000000..4e19c60
--- /dev/null
+++ b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/model/impl/ByteArrayDataSource.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package com.sun.xml.bind.v2.model.impl;
+
+import javax.activation.DataSource;
+import java.io.InputStream;
+import java.io.ByteArrayInputStream;
+import java.io.OutputStream;
+
+/**
+ * {@link DataSource} backed by a byte buffer.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public final class ByteArrayDataSource implements DataSource {
+
+ private final String contentType;
+ private final byte[] buf;
+ private final int len;
+
+ /**
+ * @param buf input buffer - the byte array isn't being copied; used directly
+ * @param contentType
+ */
+ public ByteArrayDataSource(byte[] buf, String contentType) {
+ this(buf,buf.length,contentType);
+ }
+
+ /**
+ * @param buf input buffer - the byte array isn't being copied; used directly
+ * @param length
+ * @param contentType
+ */
+ public ByteArrayDataSource(byte[] buf, int length, String contentType) {
+ this.buf = buf;
+ this.len = length;
+ this.contentType = contentType;
+ }
+
+ public String getContentType() {
+ if(contentType==null)
+ return "application/octet-stream";
+ return contentType;
+ }
+
+ public InputStream getInputStream() {
+ return new ByteArrayInputStream(buf,0,len);
+ }
+
+ public String getName() {
+ return null;
+ }
+
+ public OutputStream getOutputStream() {
+ throw new UnsupportedOperationException();
+ }
+}
diff --git a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/model/impl/ClassInfoImpl.java b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/model/impl/ClassInfoImpl.java
index 91bf82c..5115643 100644
--- a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/model/impl/ClassInfoImpl.java
+++ b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/model/impl/ClassInfoImpl.java
@@ -52,7 +52,6 @@ import javax.xml.bind.annotation.XmlValue;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import javax.xml.namespace.QName;
-import com.sun.istack.FinalArrayList;
import com.sun.xml.bind.annotation.OverrideAnnotationOf;
import com.sun.xml.bind.v2.model.annotation.Locatable;
import com.sun.xml.bind.v2.model.annotation.MethodLocatable;
@@ -94,7 +93,7 @@ public class ClassInfoImpl<T,C,F,M> extends TypeInfoImpl<T,C,F,M>
*
* @see #getProperties()
*/
- private FinalArrayList<PropertyInfoImpl<T,C,F,M>> properties;
+ private java.util.ArrayList<PropertyInfoImpl<T,C,F,M>> properties;
/**
* The property order.
@@ -276,7 +275,7 @@ public class ClassInfoImpl<T,C,F,M> extends TypeInfoImpl<T,C,F,M>
// check the access type first
XmlAccessType at = getAccessType();
- properties = new FinalArrayList<PropertyInfoImpl<T,C,F,M>>();
+ properties = new java.util.ArrayList<PropertyInfoImpl<T,C,F,M>>();
findFieldProperties(clazz,at);
@@ -549,7 +548,7 @@ public class ClassInfoImpl<T,C,F,M> extends TypeInfoImpl<T,C,F,M>
}
private static <T> List<T> makeSet( T... args ) {
- List<T> l = new FinalArrayList<T>();
+ List<T> l = new java.util.ArrayList<T>();
for( T arg : args )
if(arg!=null) l.add(arg);
return l;
diff --git a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/model/impl/ElementInfoImpl.java b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/model/impl/ElementInfoImpl.java
index a1dcb05..176fb9d 100644
--- a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/model/impl/ElementInfoImpl.java
+++ b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/model/impl/ElementInfoImpl.java
@@ -26,7 +26,6 @@ import javax.xml.bind.annotation.XmlSchema;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import javax.xml.namespace.QName;
-import com.sun.istack.FinalArrayList;
import com.sun.xml.bind.v2.TODO;
import com.sun.xml.bind.v2.model.annotation.AnnotationSource;
import com.sun.xml.bind.v2.model.annotation.Locatable;
@@ -77,7 +76,7 @@ class ElementInfoImpl<T,C,F,M> extends TypeInfoImpl<T,C,F,M> implements ElementI
* This could be null.
* @see #link()
*/
- private FinalArrayList<ElementInfoImpl<T,C,F,M>> substitutionMembers;
+ private java.util.ArrayList<ElementInfoImpl<T,C,F,M>> substitutionMembers;
/**
* The factory method from which this mapping was created.
@@ -405,7 +404,7 @@ class ElementInfoImpl<T,C,F,M> extends TypeInfoImpl<T,C,F,M> implements ElementI
private void addSubstitutionMember(ElementInfoImpl<T,C,F,M> child) {
if(substitutionMembers==null)
- substitutionMembers = new FinalArrayList<ElementInfoImpl<T,C,F,M>>();
+ substitutionMembers = new java.util.ArrayList<ElementInfoImpl<T,C,F,M>>();
substitutionMembers.add(child);
}
diff --git a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/model/impl/ElementPropertyInfoImpl.java b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/model/impl/ElementPropertyInfoImpl.java
index e9a1dcb..8e90a71 100644
--- a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/model/impl/ElementPropertyInfoImpl.java
+++ b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/model/impl/ElementPropertyInfoImpl.java
@@ -19,7 +19,6 @@ import javax.xml.bind.annotation.XmlElements;
import javax.xml.bind.annotation.XmlList;
import javax.xml.namespace.QName;
-import com.sun.istack.FinalArrayList;
import com.sun.xml.bind.v2.model.core.ElementPropertyInfo;
import com.sun.xml.bind.v2.model.core.ID;
import com.sun.xml.bind.v2.model.core.PropertyKind;
@@ -75,7 +74,7 @@ class ElementPropertyInfoImpl<TypeT,ClassDeclT,FieldT,MethodT>
public List<? extends TypeRefImpl<TypeT,ClassDeclT>> getTypes() {
if(types==null) {
- types = new FinalArrayList<TypeRefImpl<TypeT,ClassDeclT>>();
+ types = new java.util.ArrayList<TypeRefImpl<TypeT,ClassDeclT>>();
XmlElement[] ann=null;
XmlElement xe = seed.readAnnotation(XmlElement.class);
diff --git a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/model/impl/RuntimeBuiltinLeafInfoImpl.java b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/model/impl/RuntimeBuiltinLeafInfoImpl.java
index fc412ee..c64a3bb 100644
--- a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/model/impl/RuntimeBuiltinLeafInfoImpl.java
+++ b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/model/impl/RuntimeBuiltinLeafInfoImpl.java
@@ -61,7 +61,6 @@ import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerException;
import javax.xml.transform.stream.StreamResult;
-import com.sun.istack.ByteArrayDataSource;
import com.sun.xml.bind.DatatypeConverterImpl;
import com.sun.xml.bind.WhiteSpaceProcessor;
import com.sun.xml.bind.api.AccessorException;
diff --git a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/model/impl/RuntimeClassInfoImpl.java b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/model/impl/RuntimeClassInfoImpl.java
index 50f0085..95d4cf7 100644
--- a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/model/impl/RuntimeClassInfoImpl.java
+++ b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/model/impl/RuntimeClassInfoImpl.java
@@ -23,7 +23,6 @@ import javax.xml.bind.JAXBException;
import javax.xml.namespace.QName;
import javax.xml.stream.XMLStreamException;
-import com.sun.istack.NotNull;
import com.sun.xml.bind.AccessorFactory;
import com.sun.xml.bind.AccessorFactoryImpl;
import com.sun.xml.bind.InternalAccessorFactory;
@@ -344,7 +343,7 @@ class RuntimeClassInfoImpl extends ClassInfoImpl<Type,Class,Field,Method>
}
}
- public @NotNull CharSequence print(BeanT o) throws AccessorException {
+ public CharSequence print(BeanT o) throws AccessorException {
try {
CharSequence value = xacc.print(o);
if(value==null)
diff --git a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/model/impl/RuntimeModelBuilder.java b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/model/impl/RuntimeModelBuilder.java
index 0b8b889..0b47be1 100644
--- a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/model/impl/RuntimeModelBuilder.java
+++ b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/model/impl/RuntimeModelBuilder.java
@@ -35,7 +35,6 @@ import com.sun.xml.bind.v2.runtime.SchemaTypeTransducer;
import com.sun.xml.bind.v2.runtime.Transducer;
import com.sun.xml.bind.v2.runtime.JAXBContextImpl;
import com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext;
-import com.sun.istack.Nullable;
import com.sun.xml.bind.v2.WellKnownNamespace;
import javax.xml.namespace.QName;
@@ -56,7 +55,7 @@ public class RuntimeModelBuilder extends ModelBuilder<Type,Class,Field,Method> {
* The {@link JAXBContextImpl} for which the model is built.
* Null when created for reflection.
*/
- public final @Nullable JAXBContextImpl context;
+ public final JAXBContextImpl context;
public RuntimeModelBuilder(JAXBContextImpl context, RuntimeAnnotationReader annotationReader, Map<Class, Class> subclassReplacements, String defaultNamespaceRemap) {
super(annotationReader, Utils.REFLECTION_NAVIGATOR, subclassReplacements, defaultNamespaceRemap);
diff --git a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/BridgeAdapter.java b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/BridgeAdapter.java
index 22740bf..98b4677 100644
--- a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/BridgeAdapter.java
+++ b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/BridgeAdapter.java
@@ -27,7 +27,6 @@ import javax.xml.stream.XMLStreamWriter;
import javax.xml.transform.Result;
import javax.xml.transform.Source;
-import com.sun.istack.NotNull;
import com.sun.xml.bind.api.Bridge;
import com.sun.xml.bind.api.TypeReference;
import com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl;
@@ -92,19 +91,19 @@ final class BridgeAdapter<OnWire,InMemory> extends InternalBridge<InMemory> {
}
- public @NotNull InMemory unmarshal(Unmarshaller u, XMLStreamReader in) throws JAXBException {
+ public InMemory unmarshal(Unmarshaller u, XMLStreamReader in) throws JAXBException {
return adaptU(u, core.unmarshal(u,in));
}
- public @NotNull InMemory unmarshal(Unmarshaller u, Source in) throws JAXBException {
+ public InMemory unmarshal(Unmarshaller u, Source in) throws JAXBException {
return adaptU(u, core.unmarshal(u,in));
}
- public @NotNull InMemory unmarshal(Unmarshaller u, InputStream in) throws JAXBException {
+ public InMemory unmarshal(Unmarshaller u, InputStream in) throws JAXBException {
return adaptU(u, core.unmarshal(u,in));
}
- public @NotNull InMemory unmarshal(Unmarshaller u, Node n) throws JAXBException {
+ public InMemory unmarshal(Unmarshaller u, Node n) throws JAXBException {
return adaptU(u, core.unmarshal(u,n));
}
@@ -112,7 +111,7 @@ final class BridgeAdapter<OnWire,InMemory> extends InternalBridge<InMemory> {
return core.getTypeReference();
}
- private @NotNull InMemory adaptU(Unmarshaller _u, OnWire v) throws JAXBException {
+ private InMemory adaptU(Unmarshaller _u, OnWire v) throws JAXBException {
UnmarshallerImpl u = (UnmarshallerImpl) _u;
XmlAdapter<OnWire,InMemory> a = u.coordinator.getAdapter(adapter);
u.coordinator.pushCoordinator();
diff --git a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/BridgeImpl.java b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/BridgeImpl.java
index 416dc8d..ebdc6f5 100644
--- a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/BridgeImpl.java
+++ b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/BridgeImpl.java
@@ -25,7 +25,6 @@ import javax.xml.stream.XMLStreamWriter;
import javax.xml.transform.Result;
import javax.xml.transform.Source;
-import com.sun.istack.NotNull;
import com.sun.xml.bind.api.Bridge;
import com.sun.xml.bind.api.TypeReference;
import com.sun.xml.bind.marshaller.SAX2DOMEx;
@@ -89,22 +88,22 @@ final class BridgeImpl<T> extends InternalBridge<T> {
m.write(tagName,bi,t, m.createXmlOutput(result),m.createPostInitAction(result));
}
- public @NotNull T unmarshal(Unmarshaller _u, XMLStreamReader in) throws JAXBException {
+ public T unmarshal(Unmarshaller _u, XMLStreamReader in) throws JAXBException {
UnmarshallerImpl u = (UnmarshallerImpl)_u;
return ((JAXBElement<T>)u.unmarshal0(in,bi)).getValue();
}
- public @NotNull T unmarshal(Unmarshaller _u, Source in) throws JAXBException {
+ public T unmarshal(Unmarshaller _u, Source in) throws JAXBException {
UnmarshallerImpl u = (UnmarshallerImpl)_u;
return ((JAXBElement<T>)u.unmarshal0(in,bi)).getValue();
}
- public @NotNull T unmarshal(Unmarshaller _u, InputStream in) throws JAXBException {
+ public T unmarshal(Unmarshaller _u, InputStream in) throws JAXBException {
UnmarshallerImpl u = (UnmarshallerImpl)_u;
return ((JAXBElement<T>)u.unmarshal0(in,bi)).getValue();
}
- public @NotNull T unmarshal(Unmarshaller _u, Node n) throws JAXBException {
+ public T unmarshal(Unmarshaller _u, Node n) throws JAXBException {
UnmarshallerImpl u = (UnmarshallerImpl)_u;
return ((JAXBElement<T>)u.unmarshal0(n,bi)).getValue();
}
diff --git a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/ClassBeanInfoImpl.java b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/ClassBeanInfoImpl.java
index 2f220d3..d89af76 100644
--- a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/ClassBeanInfoImpl.java
+++ b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/ClassBeanInfoImpl.java
@@ -27,7 +27,6 @@ import javax.xml.bind.helpers.ValidationEventImpl;
import javax.xml.namespace.QName;
import javax.xml.stream.XMLStreamException;
-import com.sun.istack.FinalArrayList;
import com.sun.xml.bind.api.AccessorException;
import com.sun.xml.bind.v2.ClassFactory;
import com.sun.xml.bind.v2.WellKnownNamespace;
@@ -206,8 +205,8 @@ public final class ClassBeanInfoImpl<BeanT> extends JaxBeanInfo<BeanT> implement
}
// create a list of attribute/URI handlers
- List<AttributeProperty> attProps = new FinalArrayList<AttributeProperty>();
- List<Property> uriProps = new FinalArrayList<Property>();
+ List<AttributeProperty> attProps = new java.util.ArrayList<AttributeProperty>();
+ List<Property> uriProps = new java.util.ArrayList<Property>();
for (ClassBeanInfoImpl bi = this; bi != null; bi = bi.superClazz) {
for (int i = 0; i < bi.properties.length; i++) {
Property p = bi.properties[i];
diff --git a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/ContentHandlerAdaptor.java b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/ContentHandlerAdaptor.java
index e8f554b..f93f9ac 100644
--- a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/ContentHandlerAdaptor.java
+++ b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/ContentHandlerAdaptor.java
@@ -10,8 +10,6 @@
package com.sun.xml.bind.v2.runtime;
-import com.sun.istack.FinalArrayList;
-import com.sun.istack.SAXException2;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;
@@ -29,7 +27,7 @@ import java.io.IOException;
final class ContentHandlerAdaptor extends DefaultHandler {
/** Stores newly declared prefix-URI mapping. */
- private final FinalArrayList<String> prefixMap = new FinalArrayList<String>();
+ private final java.util.ArrayList<String> prefixMap = new java.util.ArrayList<String>();
/** Events will be sent to this object. */
private final XMLSerializer serializer;
@@ -106,9 +104,9 @@ final class ContentHandlerAdaptor extends DefaultHandler {
prefixMap.clear();
serializer.endAttributes();
} catch (IOException e) {
- throw new SAXException2(e);
+ throw new org.xml.sax.SAXException(e);
} catch (XMLStreamException e) {
- throw new SAXException2(e);
+ throw new org.xml.sax.SAXException(e);
}
}
@@ -123,9 +121,9 @@ final class ContentHandlerAdaptor extends DefaultHandler {
flushText();
serializer.endElement();
} catch (IOException e) {
- throw new SAXException2(e);
+ throw new org.xml.sax.SAXException(e);
} catch (XMLStreamException e) {
- throw new SAXException2(e);
+ throw new org.xml.sax.SAXException(e);
}
}
diff --git a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/FilterTransducer.java b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/FilterTransducer.java
index e68cad7..c9678e9 100644
--- a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/FilterTransducer.java
+++ b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/FilterTransducer.java
@@ -15,7 +15,6 @@ import java.io.IOException;
import javax.xml.namespace.QName;
import javax.xml.stream.XMLStreamException;
-import com.sun.istack.NotNull;
import com.sun.xml.bind.api.AccessorException;
import org.xml.sax.SAXException;
@@ -46,7 +45,7 @@ public abstract class FilterTransducer<T> implements Transducer<T> {
core.declareNamespace(o, w);
}
- public @NotNull CharSequence print(@NotNull T o) throws AccessorException {
+ public CharSequence print(T o) throws AccessorException {
return core.print(o);
}
diff --git a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/InlineBinaryTransducer.java b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/InlineBinaryTransducer.java
index 83eb7da..018f311 100644
--- a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/InlineBinaryTransducer.java
+++ b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/InlineBinaryTransducer.java
@@ -14,7 +14,6 @@ import java.io.IOException;
import javax.xml.stream.XMLStreamException;
-import com.sun.istack.NotNull;
import com.sun.xml.bind.api.AccessorException;
import org.xml.sax.SAXException;
@@ -30,7 +29,7 @@ public class InlineBinaryTransducer<V> extends FilterTransducer<V> {
}
@Override
- public @NotNull CharSequence print(@NotNull V o) throws AccessorException {
+ public CharSequence print(V o) throws AccessorException {
XMLSerializer w = XMLSerializer.getInstance();
boolean old = w.setInlineBinaryFlag(true);
try {
diff --git a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/JAXBContextImpl.java b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/JAXBContextImpl.java
index 3e7f327..f69c22a 100644
--- a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/JAXBContextImpl.java
+++ b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/JAXBContextImpl.java
@@ -53,8 +53,6 @@ import javax.xml.transform.TransformerFactory;
import javax.xml.transform.sax.SAXTransformerFactory;
import javax.xml.transform.sax.TransformerHandler;
-import com.sun.istack.NotNull;
-import com.sun.istack.Pool;
import com.sun.xml.bind.v2.WellKnownNamespace;
import com.sun.xml.bind.api.AccessorException;
import com.sun.xml.bind.api.Bridge;
@@ -144,13 +142,13 @@ public final class JAXBContextImpl extends JAXBRIContext {
* Pool of {@link Marshaller}s.
*/
public final Pool<Marshaller> marshallerPool = new Pool.Impl<Marshaller>() {
- protected @NotNull Marshaller create() {
+ protected Marshaller create() {
return createMarshaller();
}
};
public final Pool<Unmarshaller> unmarshallerPool = new Pool.Impl<Unmarshaller>() {
- protected @NotNull Unmarshaller create() {
+ protected Unmarshaller create() {
return createUnmarshaller();
}
};
@@ -211,10 +209,10 @@ public final class JAXBContextImpl extends JAXBRIContext {
private WeakReference<RuntimeTypeInfoSet> typeInfoSetCache;
- private @NotNull RuntimeAnnotationReader annotationReader;
+ private RuntimeAnnotationReader annotationReader;
private /*almost final*/ boolean hasSwaRef;
- private final @NotNull Map<Class,Class> subclassReplacements;
+ private final Map<Class,Class> subclassReplacements;
/**
* If true, we aim for faster {@link JAXBContext} instantiation performance,
@@ -907,7 +905,7 @@ public final class JAXBContextImpl extends JAXBRIContext {
return bridges.get(ref);
}
- public @NotNull BridgeContext createBridgeContext() {
+ public BridgeContext createBridgeContext() {
return new BridgeContextImpl(this);
}
@@ -1020,8 +1018,8 @@ public final class JAXBContextImpl extends JAXBRIContext {
private boolean retainPropertyInfo = false;
private boolean supressAccessorWarnings = false;
private String defaultNsUri = "";
- private @NotNull RuntimeAnnotationReader annotationReader = new RuntimeInlineAnnotationReader();
- private @NotNull Map<Class,Class> subclassReplacements = Collections.emptyMap();
+ private RuntimeAnnotationReader annotationReader = new RuntimeInlineAnnotationReader();
+ private Map<Class,Class> subclassReplacements = Collections.emptyMap();
private boolean c14nSupport = false;
private Class[] classes;
private Collection<TypeReference> typeRefs;
diff --git a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/JaxBeanInfo.java b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/JaxBeanInfo.java
index 53da7d9..1b57e0c 100644
--- a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/JaxBeanInfo.java
+++ b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/JaxBeanInfo.java
@@ -28,7 +28,6 @@ import javax.xml.datatype.XMLGregorianCalendar;
import javax.xml.namespace.QName;
import javax.xml.stream.XMLStreamException;
-import com.sun.istack.NotNull;
import com.sun.xml.bind.Utils;
import com.sun.xml.bind.v2.model.runtime.RuntimeTypeInfo;
import com.sun.xml.bind.v2.runtime.unmarshaller.Loader;
@@ -272,7 +271,7 @@ public abstract class JaxBeanInfo<BeanT> {
* instance, but there's a few exceptions (most notably {@link XMLGregorianCalendar}),
* so as a general rule we need an instance to determine it.
*/
- public QName getTypeName(@NotNull BeanT instance) {
+ public QName getTypeName(BeanT instance) {
if(typeName==null) return null;
if(typeName instanceof QName) return (QName)typeName;
return ((QName[])typeName)[0];
diff --git a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/NamespaceContext2.java b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/NamespaceContext2.java
index 328df5c..71d7867 100644
--- a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/NamespaceContext2.java
+++ b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/NamespaceContext2.java
@@ -12,7 +12,6 @@ package com.sun.xml.bind.v2.runtime;
import javax.xml.namespace.NamespaceContext;
-import com.sun.istack.NotNull;
/**
* Maintains {@code namespace <-> prefix} bindings.
@@ -69,5 +68,5 @@ public interface NamespaceContext2 extends NamespaceContext
* simply returns the assigned prefix index. Otherwise a new
* declaration will be put.
*/
- int force(@NotNull String uri, @NotNull String prefix);
+ int force(String uri, String prefix);
}
diff --git a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/Pool.java b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/Pool.java
new file mode 100644
index 0000000..cbcb10d
--- /dev/null
+++ b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/Pool.java
@@ -0,0 +1,101 @@
+/*
+ * Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package com.sun.xml.bind.v2.runtime;
+
+import java.util.concurrent.ConcurrentLinkedQueue;
+import java.lang.ref.WeakReference;
+
+/**
+ * Pool of reusable objects that are indistinguishable from each other,
+ * such as JAXB marshallers.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+public interface Pool<T> {
+
+ /**
+ * Gets a new object from the pool.
+ *
+ * <p>
+ * If no object is available in the pool, this method creates a new one.
+ */
+ T take();
+
+ /**
+ * Returns an object back to the pool.
+ */
+ void recycle(T t);
+
+ /**
+ * Default implementation that uses {@link ConcurrentLinkedQueue}
+ * as the data store.
+ *
+ * <h2>Note for Implementors</h2>
+ * <p>
+ * Don't rely on the fact that this class extends from {@link ConcurrentLinkedQueue}.
+ */
+ public abstract class Impl<T> implements Pool<T> {
+
+ private volatile WeakReference<ConcurrentLinkedQueue<T>> queue;
+
+ /**
+ * Gets a new object from the pool.
+ *
+ * <p>
+ * If no object is available in the pool, this method creates a new one.
+ *
+ * @return
+ * always non-null.
+ */
+ public final T take() {
+ T t = getQueue().poll();
+ if(t==null) {
+ return create();
+ }
+ return t;
+ }
+
+ /**
+ * Returns an object back to the pool.
+ */
+ public final void recycle(T t) {
+ getQueue().offer(t);
+ }
+
+ private ConcurrentLinkedQueue<T> getQueue() {
+ WeakReference<ConcurrentLinkedQueue<T>> q = queue;
+ if (q != null) {
+ ConcurrentLinkedQueue<T> d = q.get();
+ if (d != null) {
+ return d;
+ }
+ }
+ // overwrite the queue
+ ConcurrentLinkedQueue<T> d = new ConcurrentLinkedQueue<T>();
+ queue = new WeakReference<ConcurrentLinkedQueue<T>>(d);
+
+ return d;
+ }
+
+ /**
+ * Creates a new instance of object.
+ *
+ * <p>
+ * This method is used when someone wants to
+ * {@link #take() take} an object from an empty pool.
+ *
+ * <p>
+ * Also note that multiple threads may call this method
+ * concurrently.
+ */
+ protected abstract T create();
+ }
+}
diff --git a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/Transducer.java b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/Transducer.java
index d95d3d2..f9c9f4d 100644
--- a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/Transducer.java
+++ b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/Transducer.java
@@ -17,7 +17,6 @@ import javax.xml.datatype.XMLGregorianCalendar;
import javax.xml.namespace.QName;
import javax.xml.stream.XMLStreamException;
-import com.sun.istack.NotNull;
import com.sun.xml.bind.api.AccessorException;
import com.sun.xml.bind.v2.model.runtime.RuntimePropertyInfo;
import com.sun.xml.bind.v2.runtime.reflect.opt.OptimizedTransducedAccessorFactory;
@@ -74,7 +73,7 @@ public interface Transducer<ValueT> {
* @return
* always non-null valid lexical representation.
*/
- @NotNull CharSequence print(@NotNull ValueT o) throws AccessorException;
+ CharSequence print(ValueT o) throws AccessorException;
/**
* Converts the lexical representation to a value object.
@@ -102,7 +101,7 @@ public interface Transducer<ValueT> {
* to one of the {@link XMLSerializer#leafElement(Name, String, String)} method.
* but with the best representation of the value, not necessarily String.
*/
- void writeLeafElement(XMLSerializer w, Name tagName, @NotNull ValueT o, String fieldName) throws IOException, SAXException, XMLStreamException, AccessorException;
+ void writeLeafElement(XMLSerializer w, Name tagName, ValueT o, String fieldName) throws IOException, SAXException, XMLStreamException, AccessorException;
/**
* Transducers implicitly work against a single XML type,
@@ -115,5 +114,5 @@ public interface Transducer<ValueT> {
* Most of the time this method returns null, in which case
* the implicitly associated type will be used.
*/
- QName getTypeName(@NotNull ValueT instance);
+ QName getTypeName(ValueT instance);
}
diff --git a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/ValueListBeanInfoImpl.java b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/ValueListBeanInfoImpl.java
index 869a3c4..5bd5c1c 100644
--- a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/ValueListBeanInfoImpl.java
+++ b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/ValueListBeanInfoImpl.java
@@ -19,7 +19,6 @@ import javax.xml.bind.ValidationEvent;
import javax.xml.bind.helpers.ValidationEventImpl;
import javax.xml.stream.XMLStreamException;
-import com.sun.istack.FinalArrayList;
import com.sun.xml.bind.WhiteSpaceProcessor;
import com.sun.xml.bind.api.AccessorException;
import com.sun.xml.bind.v2.runtime.unmarshaller.Loader;
@@ -47,7 +46,7 @@ final class ValueListBeanInfoImpl extends JaxBeanInfo {
private final Loader loader = new Loader(true) {
@Override
public void text(UnmarshallingContext.State state, CharSequence text) throws SAXException {
- List<Object> r = new FinalArrayList<Object>();
+ List<Object> r = new java.util.ArrayList<Object>();
int idx = 0;
int len = text.length();
diff --git a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/XMLSerializer.java b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/XMLSerializer.java
index 9ede39f..a8df571 100644
--- a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/XMLSerializer.java
+++ b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/XMLSerializer.java
@@ -36,7 +36,6 @@ import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerException;
import javax.xml.transform.sax.SAXResult;
-import com.sun.istack.SAXException2;
import com.sun.xml.bind.CycleRecoverable;
import com.sun.xml.bind.api.AccessorException;
import com.sun.xml.bind.marshaller.NamespacePrefixMapper;
@@ -209,14 +208,14 @@ public final class XMLSerializer extends Coordinator {
try {
handler = marshaller.getEventHandler();
} catch( JAXBException e ) {
- throw new SAXException2(e);
+ throw new org.xml.sax.SAXException(e);
}
if(!handler.handleEvent(ve)) {
if(ve.getLinkedException() instanceof Exception)
- throw new SAXException2((Exception)ve.getLinkedException());
+ throw new org.xml.sax.SAXException((Exception)ve.getLinkedException());
else
- throw new SAXException2(ve.getMessage());
+ throw new org.xml.sax.SAXException(ve.getMessage());
}
}
@@ -404,9 +403,9 @@ public final class XMLSerializer extends Coordinator {
try {
out.attribute(prefix,local,value);
} catch (IOException e) {
- throw new SAXException2(e);
+ throw new org.xml.sax.SAXException(e);
} catch (XMLStreamException e) {
- throw new SAXException2(e);
+ throw new org.xml.sax.SAXException(e);
}
}
diff --git a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/output/C14nXmlOutput.java b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/output/C14nXmlOutput.java
index 6d38d96..4a900ff 100644
--- a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/output/C14nXmlOutput.java
+++ b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/output/C14nXmlOutput.java
@@ -17,7 +17,6 @@ import java.util.Collections;
import com.sun.xml.bind.api.JAXBRIContext;
import com.sun.xml.bind.v2.runtime.Name;
-import com.sun.istack.FinalArrayList;
import com.sun.xml.bind.marshaller.CharacterEscapeHandler;
/**
@@ -53,7 +52,7 @@ public class C14nXmlOutput extends UTF8XmlOutput {
*
* As long as this map is empty, there's no need for sorting.
*/
- private final FinalArrayList<DynamicAttribute> otherAttributes = new FinalArrayList<DynamicAttribute>();
+ private final java.util.ArrayList<DynamicAttribute> otherAttributes = new java.util.ArrayList<DynamicAttribute>();
/**
* True if {@link JAXBRIContext} is created with c14n support on,
diff --git a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/output/NamespaceContextImpl.java b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/output/NamespaceContextImpl.java
index 50ad0b0..bef072e 100644
--- a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/output/NamespaceContextImpl.java
+++ b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/output/NamespaceContextImpl.java
@@ -17,8 +17,6 @@ import java.util.Iterator;
import javax.xml.XMLConstants;
import javax.xml.stream.XMLStreamException;
-import com.sun.istack.NotNull;
-import com.sun.istack.Nullable;
import com.sun.xml.bind.marshaller.NamespacePrefixMapper;
import com.sun.xml.bind.v2.WellKnownNamespace;
import com.sun.xml.bind.v2.runtime.Name;
@@ -207,7 +205,7 @@ public final class NamespaceContextImpl implements NamespaceContext2 {
}
}
- public int force(@NotNull String uri, @NotNull String prefix) {
+ public int force(String uri, String prefix) {
// check for the existing binding
for( int i=size-1; i>=0; i-- ) {
@@ -235,7 +233,7 @@ public final class NamespaceContextImpl implements NamespaceContext2 {
* @return
* the index of this new binding.
*/
- public int put(@NotNull String uri, @Nullable String prefix) {
+ public int put(String uri, String prefix) {
if(size==nsUris.length) {
// reallocate
String[] u = new String[nsUris.length*2];
diff --git a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/reflect/Accessor.java b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/reflect/Accessor.java
index 410ace8..ecdd993 100644
--- a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/reflect/Accessor.java
+++ b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/reflect/Accessor.java
@@ -25,7 +25,6 @@ import java.util.logging.Logger;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.annotation.adapters.XmlAdapter;
-import com.sun.istack.Nullable;
import com.sun.xml.bind.api.AccessorException;
import com.sun.xml.bind.api.JAXBRIContext;
import com.sun.xml.bind.v2.model.core.Adapter;
@@ -73,7 +72,7 @@ public abstract class Accessor<BeanT, ValueT> implements Receiver {
* (See {@link RuntimeModelBuilder#context}.)
* @return At least the implementation can return {@code this}.
*/
- public Accessor<BeanT, ValueT> optimize(@Nullable JAXBContextImpl context) {
+ public Accessor<BeanT, ValueT> optimize(JAXBContextImpl context) {
return this;
}
diff --git a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/reflect/Lister.java b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/reflect/Lister.java
index f25fe3f..5658985 100644
--- a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/reflect/Lister.java
+++ b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/reflect/Lister.java
@@ -30,7 +30,6 @@ import java.util.concurrent.Callable;
import javax.xml.bind.JAXBException;
-import com.sun.istack.SAXException2;
import com.sun.xml.bind.api.AccessorException;
import com.sun.xml.bind.v2.ClassFactory;
import com.sun.xml.bind.v2.TODO;
@@ -375,7 +374,7 @@ public abstract class Lister<BeanT,PropT,ItemT,PackT> {
} catch (SAXException e) {
throw e;
} catch (Exception e) {
- throw new SAXException2(e);
+ throw new SAXException(e);
}
if(t==null) {
diff --git a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/reflect/TransducedAccessor.java b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/reflect/TransducedAccessor.java
index 29746be..fea1e2c 100644
--- a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/reflect/TransducedAccessor.java
+++ b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/reflect/TransducedAccessor.java
@@ -17,9 +17,6 @@ import javax.xml.bind.JAXBException;
import javax.xml.bind.annotation.XmlValue;
import javax.xml.stream.XMLStreamException;
-import com.sun.istack.NotNull;
-import com.sun.istack.Nullable;
-import com.sun.istack.SAXException2;
import com.sun.xml.bind.WhiteSpaceProcessor;
import com.sun.xml.bind.api.AccessorException;
import com.sun.xml.bind.v2.model.core.ID;
@@ -80,7 +77,7 @@ public abstract class TransducedAccessor<BeanT> {
* @return
* if the accessor didn't yield a value, return null.
*/
- public abstract @Nullable CharSequence print(@NotNull BeanT o) throws AccessorException, SAXException;
+ public abstract CharSequence print(BeanT o) throws AccessorException, SAXException;
/**
* Parses the text value into the responsible field of the given bean.
@@ -293,7 +290,7 @@ public abstract class TransducedAccessor<BeanT> {
} catch (RuntimeException e) {// from callable.call
throw e;
} catch (Exception e) {// from callable.call
- throw new SAXException2(e);
+ throw new SAXException(e);
}
if(t!=null) {
assign(bean,t,context);
@@ -316,7 +313,7 @@ public abstract class TransducedAccessor<BeanT> {
} catch (RuntimeException e) {// from callable.call
throw e;
} catch (Exception e) {// from callable.call
- throw new SAXException2(e);
+ throw new SAXException(e);
}
}
});
diff --git a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/unmarshaller/Base64Data.java b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/unmarshaller/Base64Data.java
index 00d5e70..93d2035 100644
--- a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/unmarshaller/Base64Data.java
+++ b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/unmarshaller/Base64Data.java
@@ -26,7 +26,6 @@ import com.sun.xml.bind.v2.runtime.XMLSerializer;
import com.sun.xml.bind.v2.runtime.output.Pcdata;
import com.sun.xml.bind.v2.runtime.output.UTF8XmlOutput;
import com.sun.xml.bind.v2.util.ByteArrayOutputStreamEx;
-import com.sun.istack.Nullable;
/**
* Fed to unmarshaller when the 'text' data is actually
@@ -61,8 +60,7 @@ public final class Base64Data extends Pcdata {
* Unused when {@link #dataHandler} is set.
* Use {@link DataHandler#getContentType()} in that case.
*/
- private @Nullable
- String mimeType;
+ private String mimeType;
/**
* Fills in the data object by a portion of the byte[].
@@ -70,7 +68,7 @@ public final class Base64Data extends Pcdata {
* @param len
* data[0] to data[len-1] are treated as the data.
*/
- public void set(byte[] data, int len, @Nullable String mimeType) {
+ public void set(byte[] data, int len, String mimeType) {
this.data = data;
this.dataLen = len;
this.dataHandler = null;
@@ -83,7 +81,7 @@ public final class Base64Data extends Pcdata {
* @param data
* this buffer may be owned directly by the unmarshaleld JAXB object.
*/
- public void set(byte[] data, @Nullable String mimeType) {
+ public void set(byte[] data, String mimeType) {
set(data, data.length, mimeType);
}
diff --git a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/unmarshaller/UnmarshallingContext.java b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/unmarshaller/UnmarshallingContext.java
index b2f72b9..d467f6a 100644
--- a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/unmarshaller/UnmarshallingContext.java
+++ b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/unmarshaller/UnmarshallingContext.java
@@ -34,9 +34,6 @@ import javax.xml.bind.helpers.ValidationEventImpl;
import javax.xml.namespace.NamespaceContext;
import javax.xml.namespace.QName;
-import com.sun.istack.NotNull;
-import com.sun.istack.Nullable;
-import com.sun.istack.SAXParseException2;
import com.sun.xml.bind.IDResolver;
import com.sun.xml.bind.api.AccessorException;
import com.sun.xml.bind.api.ClassResolver;
@@ -87,7 +84,7 @@ public final class UnmarshallingContext extends Coordinator
DUMMY_INSTANCE = new LocatorExWrapper(loc);
}
- private @NotNull LocatorEx locator = DUMMY_INSTANCE;
+ private LocatorEx locator = DUMMY_INSTANCE;
/** Root object that is being unmarshalled. */
private Object result;
@@ -158,13 +155,13 @@ public final class UnmarshallingContext extends Coordinator
/**
* Used to discover additional classes when we hit unknown elements/types.
*/
- public @Nullable ClassResolver classResolver;
+ public ClassResolver classResolver;
/**
* User-supplied {@link ClassLoader} for converting name to {@link Class}.
* For backward compatibility, when null, use thread context classloader.
*/
- public @Nullable ClassLoader classLoader;
+ public ClassLoader classLoader;
/**
* The variable introduced to avoid reporting n^10 similar errors.
@@ -706,7 +703,7 @@ public final class UnmarshallingContext extends Coordinator
if(!recover) aborted = true;
if( !canRecover || !recover )
- throw new SAXParseException2( event.getMessage(), locator,
+ throw new org.xml.sax.SAXParseException( event.getMessage(), locator,
new UnmarshalException(
event.getMessage(),
event.getLinkedException() ) );
diff --git a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/unmarshaller/XsiTypeLoader.java b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/unmarshaller/XsiTypeLoader.java
index 1450d5e..6733f5e 100644
--- a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/unmarshaller/XsiTypeLoader.java
+++ b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/runtime/unmarshaller/XsiTypeLoader.java
@@ -15,7 +15,6 @@ import javax.xml.namespace.QName;
import com.sun.xml.bind.DatatypeConverterImpl;
import com.sun.xml.bind.v2.WellKnownNamespace;
import com.sun.xml.bind.v2.runtime.JaxBeanInfo;
-import com.sun.istack.Nullable;
import java.util.Collection;
import java.util.Collections;
@@ -50,7 +49,7 @@ public class XsiTypeLoader extends Loader {
loader.startElement(state,ea);
}
- /*pacakge*/ static JaxBeanInfo parseXsiType(UnmarshallingContext.State state, TagName ea, @Nullable JaxBeanInfo defaultBeanInfo) throws SAXException {
+ /*pacakge*/ static JaxBeanInfo parseXsiType(UnmarshallingContext.State state, TagName ea, JaxBeanInfo defaultBeanInfo) throws SAXException {
UnmarshallingContext context = state.getContext();
JaxBeanInfo beanInfo = null;
diff --git a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/schemagen/XmlSchemaGenerator.java b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/schemagen/XmlSchemaGenerator.java
index 3428aa5..3bd61f7 100644
--- a/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/schemagen/XmlSchemaGenerator.java
+++ b/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/schemagen/XmlSchemaGenerator.java
@@ -33,8 +33,6 @@ import javax.xml.namespace.QName;
import javax.xml.transform.Result;
import javax.xml.transform.stream.StreamResult;
-import com.sun.istack.Nullable;
-import com.sun.istack.NotNull;
import com.sun.xml.bind.Utils;
import com.sun.xml.bind.api.CompositeStructure;
import com.sun.xml.bind.api.ErrorListener;
@@ -477,7 +475,7 @@ public final class XmlSchemaGenerator<T,C,F,M> {
* Schema components are organized per namespace.
*/
private class Namespace {
- final @NotNull String uri;
+ final String uri;
/**
* Other {@link Namespace}s that this namespace depends on.
@@ -573,7 +571,7 @@ public final class XmlSchemaGenerator<T,C,F,M> {
}
}
- private void addDependencyTo(@Nullable QName qname) {
+ private void addDependencyTo(QName qname) {
// even though the Element interface says getElementName() returns non-null,
// ClassInfo always implements Element (even if an instance of ClassInfo might not be an Element).
// so this check is still necessary
diff --git a/jaxb-ri/runtime/impl/src/main/java/module-info.java b/jaxb-ri/runtime/impl/src/main/java/module-info.java
index a6a8508..248417b 100644
--- a/jaxb-ri/runtime/impl/src/main/java/module-info.java
+++ b/jaxb-ri/runtime/impl/src/main/java/module-info.java
@@ -26,7 +26,6 @@ module org.glassfish.jaxb.runtime {
requires transitive com.sun.xml.txw2;
requires static com.sun.xml.fastinfoset;
requires static org.jvnet.staxex;
- requires transitive com.sun.istack.runtime;
exports com.sun.xml.bind;
exports com.sun.xml.bind.annotation;
diff --git a/jaxb-ri/xjc/pom.xml b/jaxb-ri/xjc/pom.xml
index a8119c6..53a0a48 100644
--- a/jaxb-ri/xjc/pom.xml
+++ b/jaxb-ri/xjc/pom.xml
@@ -83,6 +83,10 @@
<groupId>com.sun.istack</groupId>
<artifactId>istack-commons-tools</artifactId>
</dependency>
+ <dependency>
+ <groupId>com.sun.istack</groupId>
+ <artifactId>istack-commons-runtime</artifactId>
+ </dependency>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant</artifactId>
--
2.26.2