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 @@
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<failOnWarnings>true</failOnWarnings>
<doclint>all,-missing</doclint>
<quiet>true</quiet>
<nodeprecated>false</nodeprecated>
<notimestamp>true</notimestamp>
<nosince>true</nosince>
......@@ -173,6 +176,7 @@ Use is subject to <a href="{@docRoot}/doc-files/speclicense.html" target="_top">
<configuration>
<compilerArgs>
<arg>-Xlint:all</arg>
<arg>-Xdoclint:all,-missing</arg>
</compilerArgs>
<showDeprecation>true</showDeprecation>
<showWarnings>true</showWarnings>
......
......@@ -49,7 +49,6 @@ import javax.xml.validation.Schema;
* A Binder instance is created using the factory method
* {@link JAXBContext#createBinder()} or {@link JAXBContext#createBinder(Class)}.
*
* <p>
* @param <XmlNode> the template parameter, <code>XmlNode</code>, is the
* root interface/class for the XML infoset preserving representation.
* A Binder implementation is required to minimally support
......
......@@ -367,43 +367,6 @@ class ContextFinder {
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
* return a string representation of the URL that points to the resource.
......
......@@ -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:
* <ol>
......
......@@ -289,7 +289,7 @@ public final class JAXB {
* the body. If this object has {@link XmlRootElement}
* on its class definition, that will be used as the root tag name
* 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}.
* This parameter must not be null.
*
......@@ -313,7 +313,7 @@ public final class JAXB {
* the body. If this object has {@link XmlRootElement}
* on its class definition, that will be used as the root tag name
* 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}.
* This parameter must not be null.
*
......@@ -340,7 +340,7 @@ public final class JAXB {
* the body. If this object has {@link XmlRootElement}
* on its class definition, that will be used as the root tag name
* 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}.
* This parameter must not be null.
*
......@@ -364,7 +364,7 @@ public final class JAXB {
* the body. If this object has {@link XmlRootElement}
* on its class definition, that will be used as the root tag name
* 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}.
* This parameter must not be null.
*
......@@ -389,7 +389,7 @@ public final class JAXB {
* the body. If this object has {@link XmlRootElement}
* on its class definition, that will be used as the root tag name
* 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}.
* This parameter must not be null.
*
......@@ -413,7 +413,7 @@ public final class JAXB {
* the body. If this object has {@link XmlRootElement}
* on its class definition, that will be used as the root tag name
* 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}.
* This parameter must not be null.
*
......@@ -437,7 +437,7 @@ public final class JAXB {
* the body. If this object has {@link XmlRootElement}
* on its class definition, that will be used as the root tag name
* 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}.
* This parameter must not be null.
*
......@@ -477,14 +477,16 @@ public final class JAXB {
* the body. If this object has {@link XmlRootElement}
* on its class definition, that will be used as the root tag name
* 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}.
* This parameter must not be null.
*
* @param xml
* Represents the receiver of XML. Objects of the following types are allowed.
*
* <table><tr>
* <table>
* <caption>Allowed Objects</caption>
* <tr>
* <th>Type</th>
* <th>Operation</th>
* </tr><tr>
......@@ -552,14 +554,14 @@ public final class JAXB {
// XXX - behaviour of this method must be same as of Introspector.decapitalize
// which is not used to avoid dependency on java.desktop
String simpleName = clazz.getSimpleName();
if (simpleName == null || simpleName.isEmpty()) {
if (simpleName.isEmpty()) {
return simpleName;
}
if (simpleName.length() > 1 && Character.isUpperCase(simpleName.charAt(1))
&& Character.isUpperCase(simpleName.charAt(0))) {
return simpleName;
}
char chars[] = simpleName.toCharArray();
char[] chars = simpleName.toCharArray();
chars[0] = Character.toLowerCase(chars[0]);
return new String(chars);
}
......
......@@ -48,7 +48,7 @@ import java.security.BasicPermission;
* Malicious code can set {@link DatatypeConverterInterface}, which has
* 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
* 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.
* </td>
* </tr>
......
......@@ -27,7 +27,7 @@ import jakarta.activation.DataHandler;
*
* <p>
* 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
* 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,
......
......@@ -24,7 +24,7 @@ import javax.xml.transform.Source;
*
* <p>
* 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>
* If a property that has this annotation has a sibling property bound to
......
......@@ -81,6 +81,7 @@ public @interface XmlJavaTypeAdapter {
* Points to the class that converts a value type to a bound type or vice versa.
* See {@link XmlAdapter} for more details.
*/
@SuppressWarnings({"rawtypes"})
Class<? extends XmlAdapter> value();
/**
......
......@@ -16,7 +16,6 @@
* <h2>Package Specification</h2>
* <p>The following table shows the Jakarta XML Binding mapping annotations
* that can be associated with each program element. </p>
* <p>
* <table class="striped">
* <caption>Annotations for customizing Java program elements to XML Schema mapping</caption>
* <thead>
......@@ -143,7 +142,6 @@
* <b>Namespace prefixes</b>
* <p>The following namespace prefixes are used in the XML Schema
* fragments in this package.
* <p>
* <table class="striped">
* <caption>XML Schema fragments namespace prefixes</caption>
* <thead>
......
......@@ -13,7 +13,6 @@
* enables the interpretation and creation of optimized binary data
* within an MIME-based package format.
* <p>
* <p>
* Soap MTOM[1], XOP([2][3]) and WS-I AP[4] standardize approaches to
* optimized transmission of binary datatypes as an attachment.
* To optimally support these standards within a message passing
......@@ -23,13 +22,10 @@
* References in this document to JAXB refer to the Jakarta XML Binding unless otherwise noted.
*
* <h2>Package Specification</h2>
* <p>
* <ul>
* <li><a href="https://projects.eclipse.org/projects/ee4j.jaxb">Jakarta XML Binding Specification project</a>
* </ul>
* <p>
* <h2>Related Standards</h2>
* <p>
* <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/2005/REC-xop10-20050125/">[2]XML-binary Optimized Packaging</a></li>
......
......@@ -12,21 +12,16 @@
* Provides a runtime binding framework for client applications including
* unmarshalling, marshalling, and validation capabilities.
* <p>
* <p>
* <code>JAXBContext</code> is the client-entry point to the runtime binding
* framework.
* <p>
* <p>
* References in this document to JAXB refer to the Jakarta XML Binding unless otherwise noted.
*
* <h2>Package Specification</h2>
* <p>
* <ul>
* <li><a href="https://projects.eclipse.org/projects/ee4j.jaxb">Jakarta XML Binding Specification project</a>
* </ul>
* <p>
* <h2>Related Documentation</h2>
* <p>
* For overviews, tutorials, examples, guides, and tool documentation,
* please see:
* <ul>
......
......@@ -13,29 +13,49 @@
<FindBugsFilter>
<!--
As designed.
TODO: reevaluate for MR
As designed, impossible to change, maybe with MR.
-->
<Match>
<Class name="jakarta.xml.bind.util.JAXBSource$1"/>
<Bug pattern="XFB_XML_FACTORY_BYPASS"/>
<Bug pattern="EI_EXPOSE_REP"/>
<Or>
<Class name="~.*\.*Exception"/>
<Class name="~.*\.W3CDomHandler"/>
<Class name="~.*\.ValidationEventImpl"/>
<Class name="~.*\.ValidationEventLocatorImpl"/>
</Or>
</Match>
<!--
TODO: reevaluate for MR
As designed, impossible to change, maybe with 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"/>
<Bug pattern="EI_EXPOSE_REP2"/>
<Or>
<Class name="~.*\.*Exception"/>
<Class name="~.*\.W3CDomHandler"/>
<Class name="~.*\.ValidationEventImpl"/>
<Class name="~.*\.ValidationEventLocatorImpl"/>
<Class name="jakarta.xml.bind.util.JAXBSource"/>
</Or>
</Match>
<!--
https://github.com/eclipse-ee4j/jaxb-api/issues/78
As designed.
-->
<Match>
<Class name="jakarta.xml.bind.ModuleUtil"/>
<Bug pattern="DM_STRING_TOSTRING"/>
<Class name="jakarta.xml.bind.util.JAXBSource$1"/>
<Bug pattern="XFB_XML_FACTORY_BYPASS"/>
</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>
......@@ -76,12 +76,12 @@
<copyright.update>false</copyright.update>
<spotbugs.skip>false</spotbugs.skip>
<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>
<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>
<extension.name>jakarta.xml.bind</extension.name>
<spec.version>4.0</spec.version>
......@@ -110,7 +110,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
<version>1.4</version>
<version>3.0.0</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
......@@ -132,7 +132,7 @@
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.3.0</version>
<version>3.3.1</version>
</plugin>
<plugin>
<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