Commit 772ecfd9 authored by Lukas Jungmann's avatar Lukas Jungmann
Browse files

javadoc and spotbugs warnings,

turn javadoc warnings into errors,
remove obsolete code,
update build plugins
Signed-off-by: default avatarLukas Jungmann <lukas.jungmann@oracle.com>
parent 377453ab
...@@ -67,6 +67,9 @@ ...@@ -67,6 +67,9 @@
<plugin> <plugin>
<artifactId>maven-javadoc-plugin</artifactId> <artifactId>maven-javadoc-plugin</artifactId>
<configuration> <configuration>
<failOnWarnings>true</failOnWarnings>
<doclint>all,-missing</doclint>
<quiet>true</quiet>
<nodeprecated>false</nodeprecated> <nodeprecated>false</nodeprecated>
<notimestamp>true</notimestamp> <notimestamp>true</notimestamp>
<nosince>true</nosince> <nosince>true</nosince>
...@@ -173,6 +176,7 @@ Use is subject to <a href="{@docRoot}/doc-files/speclicense.html" target="_top"> ...@@ -173,6 +176,7 @@ Use is subject to <a href="{@docRoot}/doc-files/speclicense.html" target="_top">
<configuration> <configuration>
<compilerArgs> <compilerArgs>
<arg>-Xlint:all</arg> <arg>-Xlint:all</arg>
<arg>-Xdoclint:all,-missing</arg>
</compilerArgs> </compilerArgs>
<showDeprecation>true</showDeprecation> <showDeprecation>true</showDeprecation>
<showWarnings>true</showWarnings> <showWarnings>true</showWarnings>
......
...@@ -49,7 +49,6 @@ import javax.xml.validation.Schema; ...@@ -49,7 +49,6 @@ import javax.xml.validation.Schema;
* A Binder instance is created using the factory method * A Binder instance is created using the factory method
* {@link JAXBContext#createBinder()} or {@link JAXBContext#createBinder(Class)}. * {@link JAXBContext#createBinder()} or {@link JAXBContext#createBinder(Class)}.
* *
* <p>
* @param <XmlNode> the template parameter, <code>XmlNode</code>, is the * @param <XmlNode> the template parameter, <code>XmlNode</code>, is the
* root interface/class for the XML infoset preserving representation. * root interface/class for the XML infoset preserving representation.
* A Binder implementation is required to minimally support * A Binder implementation is required to minimally support
......
...@@ -367,43 +367,6 @@ class ContextFinder { ...@@ -367,43 +367,6 @@ class ContextFinder {
return value; return value;
} }
private static Properties loadJAXBProperties(URL url) throws JAXBException {
try {
Properties props;
logger.log(Level.FINE, "loading props from {0}", url);
props = new Properties();
InputStream is = url.openStream();
props.load(is);
is.close();
return props;
} catch (IOException ioe) {
logger.log(Level.FINE, "Unable to load " + url.toString(), ioe);
throw new JAXBException(ioe.toString(), ioe);
}
}
/**
* If run on JPMS package containing resource must be open unconditionally.
*
* @param classLoader classloader to load resource with
* @param resourceName qualified name of the resource
* @return resource url if found
*/
private static URL getResourceUrl(ClassLoader classLoader, String resourceName) {
URL url;
if (classLoader == null)
url = ClassLoader.getSystemResource(resourceName);
else
url = classLoader.getResource(resourceName);
return url;
}
private static URL getResourceUrl(Class<?> clazz, String resourceName) {
return clazz.getResource(resourceName);
}
/** /**
* Search the given ClassLoader for an instance of the specified class and * Search the given ClassLoader for an instance of the specified class and
* return a string representation of the URL that points to the resource. * return a string representation of the URL that points to the resource.
......
...@@ -75,7 +75,7 @@ final class DatatypeConverterImpl implements DatatypeConverterInterface { ...@@ -75,7 +75,7 @@ final class DatatypeConverterImpl implements DatatypeConverterInterface {
} }
/** /**
* Faster but less robust String->int conversion. * Faster but less robust {@code String->int} conversion.
* *
* Note that: * Note that:
* <ol> * <ol>
......
...@@ -289,7 +289,7 @@ public final class JAXB { ...@@ -289,7 +289,7 @@ public final class JAXB {
* the body. If this object has {@link XmlRootElement} * the body. If this object has {@link XmlRootElement}
* on its class definition, that will be used as the root tag name * on its class definition, that will be used as the root tag name
* and the given object will provide the body. Otherwise, * and the given object will provide the body. Otherwise,
* the root tag name is {@link java.beans.Introspector#decapitalize(String) infered} from * the root tag name is inferred from
* {@link Class#getSimpleName() the short class name}. * {@link Class#getSimpleName() the short class name}.
* This parameter must not be null. * This parameter must not be null.
* *
...@@ -313,7 +313,7 @@ public final class JAXB { ...@@ -313,7 +313,7 @@ public final class JAXB {
* the body. If this object has {@link XmlRootElement} * the body. If this object has {@link XmlRootElement}
* on its class definition, that will be used as the root tag name * on its class definition, that will be used as the root tag name
* and the given object will provide the body. Otherwise, * and the given object will provide the body. Otherwise,
* the root tag name is {@link java.beans.Introspector#decapitalize(String) infered} from * the root tag name is inferred from
* {@link Class#getSimpleName() the short class name}. * {@link Class#getSimpleName() the short class name}.
* This parameter must not be null. * This parameter must not be null.
* *
...@@ -340,7 +340,7 @@ public final class JAXB { ...@@ -340,7 +340,7 @@ public final class JAXB {
* the body. If this object has {@link XmlRootElement} * the body. If this object has {@link XmlRootElement}
* on its class definition, that will be used as the root tag name * on its class definition, that will be used as the root tag name
* and the given object will provide the body. Otherwise, * and the given object will provide the body. Otherwise,
* the root tag name is {@link java.beans.Introspector#decapitalize(String) infered} from * the root tag name is inferred from
* {@link Class#getSimpleName() the short class name}. * {@link Class#getSimpleName() the short class name}.
* This parameter must not be null. * This parameter must not be null.
* *
...@@ -364,7 +364,7 @@ public final class JAXB { ...@@ -364,7 +364,7 @@ public final class JAXB {
* the body. If this object has {@link XmlRootElement} * the body. If this object has {@link XmlRootElement}
* on its class definition, that will be used as the root tag name * on its class definition, that will be used as the root tag name
* and the given object will provide the body. Otherwise, * and the given object will provide the body. Otherwise,
* the root tag name is {@link java.beans.Introspector#decapitalize(String) infered} from * the root tag name is inferred from
* {@link Class#getSimpleName() the short class name}. * {@link Class#getSimpleName() the short class name}.
* This parameter must not be null. * This parameter must not be null.
* *
...@@ -389,7 +389,7 @@ public final class JAXB { ...@@ -389,7 +389,7 @@ public final class JAXB {
* the body. If this object has {@link XmlRootElement} * the body. If this object has {@link XmlRootElement}
* on its class definition, that will be used as the root tag name * on its class definition, that will be used as the root tag name
* and the given object will provide the body. Otherwise, * and the given object will provide the body. Otherwise,
* the root tag name is {@link java.beans.Introspector#decapitalize(String) infered} from * the root tag name is inferred from
* {@link Class#getSimpleName() the short class name}. * {@link Class#getSimpleName() the short class name}.
* This parameter must not be null. * This parameter must not be null.
* *
...@@ -413,7 +413,7 @@ public final class JAXB { ...@@ -413,7 +413,7 @@ public final class JAXB {
* the body. If this object has {@link XmlRootElement} * the body. If this object has {@link XmlRootElement}
* on its class definition, that will be used as the root tag name * on its class definition, that will be used as the root tag name
* and the given object will provide the body. Otherwise, * and the given object will provide the body. Otherwise,
* the root tag name is {@link java.beans.Introspector#decapitalize(String) infered} from * the root tag name is inferred from
* {@link Class#getSimpleName() the short class name}. * {@link Class#getSimpleName() the short class name}.
* This parameter must not be null. * This parameter must not be null.
* *
...@@ -437,7 +437,7 @@ public final class JAXB { ...@@ -437,7 +437,7 @@ public final class JAXB {
* the body. If this object has {@link XmlRootElement} * the body. If this object has {@link XmlRootElement}
* on its class definition, that will be used as the root tag name * on its class definition, that will be used as the root tag name
* and the given object will provide the body. Otherwise, * and the given object will provide the body. Otherwise,
* the root tag name is {@link java.beans.Introspector#decapitalize(String) infered} from * the root tag name is inferred from
* {@link Class#getSimpleName() the short class name}. * {@link Class#getSimpleName() the short class name}.
* This parameter must not be null. * This parameter must not be null.
* *
...@@ -477,14 +477,16 @@ public final class JAXB { ...@@ -477,14 +477,16 @@ public final class JAXB {
* the body. If this object has {@link XmlRootElement} * the body. If this object has {@link XmlRootElement}
* on its class definition, that will be used as the root tag name * on its class definition, that will be used as the root tag name
* and the given object will provide the body. Otherwise, * and the given object will provide the body. Otherwise,
* the root tag name is {@link java.beans.Introspector#decapitalize(String) infered} from * the root tag name is inferred from
* {@link Class#getSimpleName() the short class name}. * {@link Class#getSimpleName() the short class name}.
* This parameter must not be null. * This parameter must not be null.
* *
* @param xml * @param xml
* Represents the receiver of XML. Objects of the following types are allowed. * Represents the receiver of XML. Objects of the following types are allowed.
* *
* <table><tr> * <table>
* <caption>Allowed Objects</caption>
* <tr>
* <th>Type</th> * <th>Type</th>
* <th>Operation</th> * <th>Operation</th>
* </tr><tr> * </tr><tr>
...@@ -552,14 +554,14 @@ public final class JAXB { ...@@ -552,14 +554,14 @@ public final class JAXB {
// XXX - behaviour of this method must be same as of Introspector.decapitalize // XXX - behaviour of this method must be same as of Introspector.decapitalize
// which is not used to avoid dependency on java.desktop // which is not used to avoid dependency on java.desktop
String simpleName = clazz.getSimpleName(); String simpleName = clazz.getSimpleName();
if (simpleName == null || simpleName.isEmpty()) { if (simpleName.isEmpty()) {
return simpleName; return simpleName;
} }
if (simpleName.length() > 1 && Character.isUpperCase(simpleName.charAt(1)) if (simpleName.length() > 1 && Character.isUpperCase(simpleName.charAt(1))
&& Character.isUpperCase(simpleName.charAt(0))) { && Character.isUpperCase(simpleName.charAt(0))) {
return simpleName; return simpleName;
} }
char chars[] = simpleName.toCharArray(); char[] chars = simpleName.toCharArray();
chars[0] = Character.toLowerCase(chars[0]); chars[0] = Character.toLowerCase(chars[0]);
return new String(chars); return new String(chars);
} }
......
...@@ -48,7 +48,7 @@ import java.security.BasicPermission; ...@@ -48,7 +48,7 @@ import java.security.BasicPermission;
* Malicious code can set {@link DatatypeConverterInterface}, which has * Malicious code can set {@link DatatypeConverterInterface}, which has
* VM-wide singleton semantics, before a genuine Jakarta XML Binding implementation sets one. * VM-wide singleton semantics, before a genuine Jakarta XML Binding implementation sets one.
* This allows malicious code to gain access to objects that it may otherwise * This allows malicious code to gain access to objects that it may otherwise
* not have access to, such as {@link java.awt.Frame#getFrames()} that belongs to * not have access to, such as {@code java.awt.Frame#getFrames()} that belongs to
* another application running in the same JVM. * another application running in the same JVM.
* </td> * </td>
* </tr> * </tr>
......
...@@ -27,7 +27,7 @@ import jakarta.activation.DataHandler; ...@@ -27,7 +27,7 @@ import jakarta.activation.DataHandler;
* *
* <p> * <p>
* When XOP encoding is enabled as described in {@link AttachmentMarshaller#isXOPPackage()}, * When XOP encoding is enabled as described in {@link AttachmentMarshaller#isXOPPackage()},
* this annotation disables datatypes such as {@link java.awt.Image} or {@link Source} * this annotation disables datatypes such as {@code java.awt.Image} or {@link Source}
* or {@code byte[]} that are bound to base64-encoded binary from being considered for * or {@code byte[]} that are bound to base64-encoded binary from being considered for
* XOP encoding. If a Jakarta XML Binding property is annotated with this annotation or if * XOP encoding. If a Jakarta XML Binding property is annotated with this annotation or if
* the Jakarta XML Binding property's base type is annotated with this annotation, * the Jakarta XML Binding property's base type is annotated with this annotation,
......
...@@ -24,7 +24,7 @@ import javax.xml.transform.Source; ...@@ -24,7 +24,7 @@ import javax.xml.transform.Source;
* *
* <p> * <p>
* This annotation is used in conjunction with datatypes such as * This annotation is used in conjunction with datatypes such as
* {@link java.awt.Image} or {@link Source} that are bound to base64-encoded binary in XML. * {@code java.awt.Image} or {@link Source} that are bound to base64-encoded binary in XML.
* *
* <p> * <p>
* If a property that has this annotation has a sibling property bound to * If a property that has this annotation has a sibling property bound to
......
...@@ -81,6 +81,7 @@ public @interface XmlJavaTypeAdapter { ...@@ -81,6 +81,7 @@ public @interface XmlJavaTypeAdapter {
* Points to the class that converts a value type to a bound type or vice versa. * Points to the class that converts a value type to a bound type or vice versa.
* See {@link XmlAdapter} for more details. * See {@link XmlAdapter} for more details.
*/ */
@SuppressWarnings({"rawtypes"})
Class<? extends XmlAdapter> value(); Class<? extends XmlAdapter> value();
/** /**
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
* <h2>Package Specification</h2> * <h2>Package Specification</h2>
* <p>The following table shows the Jakarta XML Binding mapping annotations * <p>The following table shows the Jakarta XML Binding mapping annotations
* that can be associated with each program element. </p> * that can be associated with each program element. </p>
* <p>
* <table class="striped"> * <table class="striped">
* <caption>Annotations for customizing Java program elements to XML Schema mapping</caption> * <caption>Annotations for customizing Java program elements to XML Schema mapping</caption>
* <thead> * <thead>
...@@ -143,7 +142,6 @@ ...@@ -143,7 +142,6 @@
* <b>Namespace prefixes</b> * <b>Namespace prefixes</b>
* <p>The following namespace prefixes are used in the XML Schema * <p>The following namespace prefixes are used in the XML Schema
* fragments in this package. * fragments in this package.
* <p>
* <table class="striped"> * <table class="striped">
* <caption>XML Schema fragments namespace prefixes</caption> * <caption>XML Schema fragments namespace prefixes</caption>
* <thead> * <thead>
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
* enables the interpretation and creation of optimized binary data * enables the interpretation and creation of optimized binary data
* within an MIME-based package format. * within an MIME-based package format.
* <p> * <p>
* <p>
* Soap MTOM[1], XOP([2][3]) and WS-I AP[4] standardize approaches to * Soap MTOM[1], XOP([2][3]) and WS-I AP[4] standardize approaches to
* optimized transmission of binary datatypes as an attachment. * optimized transmission of binary datatypes as an attachment.
* To optimally support these standards within a message passing * To optimally support these standards within a message passing
...@@ -23,13 +22,10 @@ ...@@ -23,13 +22,10 @@
* References in this document to JAXB refer to the Jakarta XML Binding unless otherwise noted. * References in this document to JAXB refer to the Jakarta XML Binding unless otherwise noted.
* *
* <h2>Package Specification</h2> * <h2>Package Specification</h2>
* <p>
* <ul> * <ul>
* <li><a href="https://projects.eclipse.org/projects/ee4j.jaxb">Jakarta XML Binding Specification project</a> * <li><a href="https://projects.eclipse.org/projects/ee4j.jaxb">Jakarta XML Binding Specification project</a>
* </ul> * </ul>
* <p>
* <h2>Related Standards</h2> * <h2>Related Standards</h2>
* <p>
* <ul> * <ul>
* <li><a href="http://www.w3.org/TR/2004/WD-soap12-mtom-20040608/">[1]SOAP Message Transmission Optimization Mechanism</a> </li> * <li><a href="http://www.w3.org/TR/2004/WD-soap12-mtom-20040608/">[1]SOAP Message Transmission Optimization Mechanism</a> </li>
* <li><a href="http://www.w3.org/TR/2005/REC-xop10-20050125/">[2]XML-binary Optimized Packaging</a></li> * <li><a href="http://www.w3.org/TR/2005/REC-xop10-20050125/">[2]XML-binary Optimized Packaging</a></li>
......
...@@ -12,21 +12,16 @@ ...@@ -12,21 +12,16 @@
* Provides a runtime binding framework for client applications including * Provides a runtime binding framework for client applications including
* unmarshalling, marshalling, and validation capabilities. * unmarshalling, marshalling, and validation capabilities.
* <p> * <p>
* <p>
* <code>JAXBContext</code> is the client-entry point to the runtime binding * <code>JAXBContext</code> is the client-entry point to the runtime binding
* framework. * framework.
* <p> * <p>
* <p>
* References in this document to JAXB refer to the Jakarta XML Binding unless otherwise noted. * References in this document to JAXB refer to the Jakarta XML Binding unless otherwise noted.
* *
* <h2>Package Specification</h2> * <h2>Package Specification</h2>
* <p>
* <ul> * <ul>
* <li><a href="https://projects.eclipse.org/projects/ee4j.jaxb">Jakarta XML Binding Specification project</a> * <li><a href="https://projects.eclipse.org/projects/ee4j.jaxb">Jakarta XML Binding Specification project</a>
* </ul> * </ul>
* <p>
* <h2>Related Documentation</h2> * <h2>Related Documentation</h2>
* <p>
* For overviews, tutorials, examples, guides, and tool documentation, * For overviews, tutorials, examples, guides, and tool documentation,
* please see: * please see:
* <ul> * <ul>
......
...@@ -13,29 +13,49 @@ ...@@ -13,29 +13,49 @@
<FindBugsFilter> <FindBugsFilter>
<!-- <!--
As designed. TODO: reevaluate for MR
As designed, impossible to change, maybe with MR.
--> -->
<Match> <Match>
<Class name="jakarta.xml.bind.util.JAXBSource$1"/> <Bug pattern="EI_EXPOSE_REP"/>
<Bug pattern="XFB_XML_FACTORY_BYPASS"/> <Or>
<Class name="~.*\.*Exception"/>
<Class name="~.*\.W3CDomHandler"/>
<Class name="~.*\.ValidationEventImpl"/>
<Class name="~.*\.ValidationEventLocatorImpl"/>
</Or>
</Match> </Match>
<!-- <!--
TODO: reevaluate for MR TODO: reevaluate for MR
As designed, impossible to change, maybe with MR? As designed, impossible to change, maybe with MR.
--> -->
<Match> <Match>
<Class name="jakarta.xml.bind.annotation.adapters.HexBinaryAdapter"/> <Bug pattern="EI_EXPOSE_REP2"/>
<Bug pattern="PZLA_PREFER_ZERO_LENGTH_ARRAYS"/> <Or>
<Class name="~.*\.*Exception"/>
<Class name="~.*\.W3CDomHandler"/>
<Class name="~.*\.ValidationEventImpl"/>
<Class name="~.*\.ValidationEventLocatorImpl"/>
<Class name="jakarta.xml.bind.util.JAXBSource"/>
</Or>
</Match> </Match>
<!-- <!--
https://github.com/eclipse-ee4j/jaxb-api/issues/78 As designed.
--> -->
<Match> <Match>
<Class name="jakarta.xml.bind.ModuleUtil"/> <Class name="jakarta.xml.bind.util.JAXBSource$1"/>
<Bug pattern="DM_STRING_TOSTRING"/> <Bug pattern="XFB_XML_FACTORY_BYPASS"/>
</Match> </Match>
<!--
TODO: reevaluate for MR
As designed, impossible to change, maybe with MR?
-->
<Match>
<Class name="jakarta.xml.bind.annotation.adapters.HexBinaryAdapter"/>
<Bug pattern="PZLA_PREFER_ZERO_LENGTH_ARRAYS"/>
</Match>
</FindBugsFilter> </FindBugsFilter>
...@@ -76,12 +76,12 @@ ...@@ -76,12 +76,12 @@
<copyright.update>false</copyright.update> <copyright.update>false</copyright.update>
<spotbugs.skip>false</spotbugs.skip> <spotbugs.skip>false</spotbugs.skip>
<spotbugs.threshold>Low</spotbugs.threshold> <spotbugs.threshold>Low</spotbugs.threshold>
<spotbugs.version>4.3.0</spotbugs.version> <spotbugs.version>4.5.0.0</spotbugs.version>
<maven.compiler.release>11</maven.compiler.release> <maven.compiler.release>11</maven.compiler.release>
<release.spec.feedback>jaxb-dev@eclipse.org</release.spec.feedback> <release.spec.feedback>jaxb-dev@eclipse.org</release.spec.feedback>
<release.spec.date>Jul 2017</release.spec.date> <release.spec.date>Jan 2022</release.spec.date>
<api.package>jakarta.xml.bind</api.package> <api.package>jakarta.xml.bind</api.package>
<extension.name>jakarta.xml.bind</extension.name> <extension.name>jakarta.xml.bind</extension.name>
<spec.version>4.0</spec.version> <spec.version>4.0</spec.version>
...@@ -110,7 +110,7 @@ ...@@ -110,7 +110,7 @@
<plugin> <plugin>
<groupId>org.codehaus.mojo</groupId> <groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId> <artifactId>buildnumber-maven-plugin</artifactId>
<version>1.4</version> <version>3.0.0</version>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.codehaus.mojo</groupId> <groupId>org.codehaus.mojo</groupId>
...@@ -132,7 +132,7 @@ ...@@ -132,7 +132,7 @@
</plugin> </plugin>
<plugin> <plugin>
<artifactId>maven-javadoc-plugin</artifactId> <artifactId>maven-javadoc-plugin</artifactId>
<version>3.3.0</version> <version>3.3.1</version>
</plugin> </plugin>
<plugin> <plugin>
<artifactId>maven-enforcer-plugin</artifactId> <artifactId>maven-enforcer-plugin</artifactId>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment