fix high sbugs warning, some jdoc warnings
Signed-off-by: Lukas Jungmann <lukas.jungmann@oracle.com>
diff --git a/jaxb-ri/codemodel/codemodel-annotation-compiler/src/main/java/com/sun/codemodel/ac/ACTask.java b/jaxb-ri/codemodel/codemodel-annotation-compiler/src/main/java/com/sun/codemodel/ac/ACTask.java
index f64d7de..0af76e8 100644
--- a/jaxb-ri/codemodel/codemodel-annotation-compiler/src/main/java/com/sun/codemodel/ac/ACTask.java
+++ b/jaxb-ri/codemodel/codemodel-annotation-compiler/src/main/java/com/sun/codemodel/ac/ACTask.java
@@ -104,6 +104,7 @@
/**
* Nested {@code <classpath>} element.
+ * @param cp path
*/
public void setClasspath(Path cp) {
classpath.createPath().append(cp);
@@ -111,6 +112,7 @@
/**
* Nested {@code <classpath>} element.
+ * @return path
*/
public Path createClasspath() {
return classpath.createPath();
@@ -192,6 +194,7 @@
/**
* List of classes to be handled
+ * @param c classes
*/
public void addConfiguredClasses(Classes c) {
patterns.add(c);
@@ -211,6 +214,7 @@
/**
* List of endorsed jars
+ * @param e endorsed jar
*/
public void addConfiguredEndorse(Endorse e) {
endorsedJars.add(e.endorsedJar);
diff --git a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/SchemaGenBase.java b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/SchemaGenBase.java
index 92cd948..f3deb92 100644
--- a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/SchemaGenBase.java
+++ b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/SchemaGenBase.java
@@ -30,7 +30,7 @@
* @author Yan GAO (gaoyan.gao@oracle.com)
*/
public class SchemaGenBase extends ApBasedTask {
- private final List<SchemaGenBase.Schema>/*<Schema>*/ schemas = new ArrayList<SchemaGenBase.Schema>();
+ private final List<SchemaGenBase.Schema>/*<Schema>*/ schemas = new ArrayList<>();
private File episode = null;
@@ -180,6 +180,7 @@
/**
* Sets the episode file to be generated.
* Null to not to generate one, which is the default behavior.
+ * @param f episode file
*/
public void setEpisode(File f) {
this.episode = f;
@@ -191,7 +192,7 @@
@Override
protected Processor getProcessor() {
- Map<String, File> m = new HashMap<String, File>();
+ Map<String, File> m = new HashMap<>();
for (SchemaGenBase.Schema schema : schemas) {
if (m.containsKey(schema.namespace)) {
@@ -269,7 +270,7 @@
getCommandline().createArgument().setValue("-d");
getCommandline().createArgument().setFile(getDestdir());
}
- if (getEpisode() != null && !getEpisode().equals("")) {
+ if (getEpisode() != null && getEpisode().exists() && getEpisode().isFile()) {
getCommandline().createArgument().setValue("-episode");
getCommandline().createArgument().setFile(getEpisode());
}
diff --git a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/gen/config/NGCCEventSource.java b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/gen/config/NGCCEventSource.java
index 152706d..620902b 100644
--- a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/gen/config/NGCCEventSource.java
+++ b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/gen/config/NGCCEventSource.java
@@ -33,7 +33,7 @@
int replace( NGCCEventReceiver _old, NGCCEventReceiver _new );
/** Sends an enter element event to the specified EventReceiver thread.
- * @param receiverThreadId
+ * @param receiverThreadId Thread ID of the receiver that can handle this event
* @param uri element uri
* @param local element local name
* @param qname element qname
diff --git a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/gen/config/NGCCRuntime.java b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/gen/config/NGCCRuntime.java
index 2542220..ef3f460 100644
--- a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/gen/config/NGCCRuntime.java
+++ b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/gen/config/NGCCRuntime.java
@@ -474,6 +474,7 @@
* @param qname
* Parameter passed to the enter element event. Used to
* simulate the startElement event for the new ContentHandler.
+ * @throws SAXException for errors
*/
public void redirectSubtree( ContentHandler child,
String uri, String local, String qname ) throws SAXException {
diff --git a/jaxb-ri/pom.xml b/jaxb-ri/pom.xml
index 12864f7..388dd4e 100644
--- a/jaxb-ri/pom.xml
+++ b/jaxb-ri/pom.xml
@@ -78,7 +78,7 @@
<copyright.update>false</copyright.update>
<spotbugs.exclude/>
<spotbugs.skip>false</spotbugs.skip>
- <spotbugs.threshold>High</spotbugs.threshold>
+ <spotbugs.threshold>Low</spotbugs.threshold>
<spotbugs.version>4.3.0</spotbugs.version>
<junit.version>4.13.2</junit.version>
diff --git a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/DatatypeWriter.java b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/DatatypeWriter.java
index d83204d..2108c57 100644
--- a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/DatatypeWriter.java
+++ b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/DatatypeWriter.java
@@ -38,6 +38,8 @@
* the datatype object to be printed.
* @param resolver
* allows the converter to declare additional namespace prefixes.
+ * @param buf
+ * buffer
*/
void print(DT dt, NamespaceResolver resolver, StringBuilder buf);
diff --git a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/TXW.java b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/TXW.java
index b67c883..e0e46e0 100644
--- a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/TXW.java
+++ b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/TXW.java
@@ -62,12 +62,16 @@
/**
* Creates a new {@link TypedXmlWriter} to write a new instance of a document.
*
+ * @param <T> an instance of {@link TypedXmlWriter}
* @param rootElement
* The {@link TypedXmlWriter} interface that declares the content model of the root element.
* This interface must have {@link XmlElement} annotation on it to designate the tag name
* of the root element.
* @param out
* The target of the writing.
+ * @return
+ * always return non-null {@link TypedXmlWriter} that can be used
+ * to write the contents of the root element.
*/
public static <T extends TypedXmlWriter> T create( Class<T> rootElement, XmlSerializer out ) {
if (out instanceof TXWSerializer) {
@@ -87,8 +91,18 @@
* Similar to the other method, but this version allows the caller to set the
* tag name at the run-time.
*
+ * @param <T> an instance of {@link TypedXmlWriter}
* @param tagName
* The tag name of the root document.
+ * @param rootElement
+ * The {@link TypedXmlWriter} interface that declares the content model of the root element.
+ * This interface must have {@link XmlElement} annotation on it to designate the tag name
+ * of the root element.
+ * @param out
+ * The target of the writing.
+ * @return
+ * always return non-null {@link TypedXmlWriter} that can be used
+ * to write the contents of the root element.
*
* @see #create(Class,XmlSerializer)
*/
diff --git a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/TypedXmlWriter.java b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/TypedXmlWriter.java
index 0a08180..5e99c1b 100644
--- a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/TypedXmlWriter.java
+++ b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/TypedXmlWriter.java
@@ -78,6 +78,8 @@
* <p>
* Short for <pre>_attribute("",localName,value);</pre>
*
+ * @param localName the name
+ * @param value the value
* @see #_attribute(String, String, Object)
*/
void _attribute( String localName, Object value );
@@ -88,6 +90,9 @@
* <p>
* Short for <pre>_attribute(new QName(nsUri,localName),value);</pre>
*
+ * @param nsUri the namespace URI
+ * @param value the value
+ * @param localName the name
* @see #_attribute(QName, Object)
*/
void _attribute( String nsUri, String localName, Object value );
@@ -186,6 +191,15 @@
* <p>
* The namespace URI will be inherited from the parent element.
*
+ * @param <T> type
+ * @param localName
+ * The local name of the newly created element.
+ * @param contentModel
+ * The typed XML writer interface used to write the children of
+ * the new child element.
+ * @return
+ * always return non-null {@link TypedXmlWriter} that can be used
+ * to write the contents of the newly created child element.
* @see #_element(String, String, Class)
*/
<T extends TypedXmlWriter> T _element( String localName, Class<T> contentModel );
@@ -196,6 +210,7 @@
* <p>
* The newly created child element is appended at the end of the children.
*
+ * @param <T> type
* @param nsUri
* The namespace URI of the newly created element.
* @param localName
@@ -216,6 +231,15 @@
* <p>
* Short for <pre>_element(tagName.getNamespaceURI(),tagName.getLocalPart(),contentModel);</pre>
*
+ * @param <T> type
+ * @param tagName
+ * The local name of the newly created element.
+ * @param contentModel
+ * The typed XML writer interface used to write the children of
+ * the new child element.
+ * @return
+ * always return non-null {@link TypedXmlWriter} that can be used
+ * to write the contents of the newly created child element.
* @see #_element(String, String, Class)
*/
<T extends TypedXmlWriter> T _element( QName tagName, Class<T> contentModel );
@@ -228,6 +252,13 @@
* annotated with {@link XmlElement} annotation. The element name will be
* taken from there.
*
+ * @param <T> type
+ * @param contentModel
+ * The typed XML writer interface used to write the children of
+ * the new child element.
+ * @return
+ * always return non-null {@link TypedXmlWriter} that can be used
+ * to write the contents of the newly created child element.
* @see #_element(String, String, Class)
*/
<T extends TypedXmlWriter> T _element( Class<T> contentModel );
@@ -244,6 +275,8 @@
* But this is different from Java's ordinary cast because the returned object
* is not always the same as the current object.
*
+ * @param <T> type
+ * @param targetInterface target interface
* @return
* always return non-null.
*/
diff --git a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/annotation/XmlAttribute.java b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/annotation/XmlAttribute.java
index 5ea7184..108b978 100644
--- a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/annotation/XmlAttribute.java
+++ b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/annotation/XmlAttribute.java
@@ -10,7 +10,6 @@
package com.sun.xml.txw2.annotation;
-import com.sun.xml.txw2.TypedXmlWriter;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
@@ -48,11 +47,13 @@
* <p>
* If left unspecified, the method name is used as the attribute name.
*
+ * @return the local name
*/
String value() default "";
/**
* The namespace URI of the attribute.
+ * @return the namespace URI
*/
String ns() default "";
}
diff --git a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/annotation/XmlElement.java b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/annotation/XmlElement.java
index c764e0d..6989728 100644
--- a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/annotation/XmlElement.java
+++ b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/annotation/XmlElement.java
@@ -14,7 +14,6 @@
import com.sun.xml.txw2.TXW;
import com.sun.xml.txw2.output.XmlSerializer;
-import javax.xml.namespace.QName;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
@@ -63,6 +62,7 @@
public @interface XmlElement {
/**
* The local name of the element.
+ * @return the local name
*/
String value() default "";
@@ -78,6 +78,7 @@
* <p>
* If the annotation is on a method and this parameter is left unspecified,
* then the namespace URI is the same as the namespace URI of the writer interface.
+ * @return namespace URI
*/
String ns() default "##default";
}
diff --git a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/annotation/XmlNamespace.java b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/annotation/XmlNamespace.java
index a2ecefb..7924733 100644
--- a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/annotation/XmlNamespace.java
+++ b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/annotation/XmlNamespace.java
@@ -33,6 +33,7 @@
public @interface XmlNamespace {
/**
* The namespace URI.
+ * @return URI
*/
String value();
}
diff --git a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/CharacterEscapeHandler.java b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/CharacterEscapeHandler.java
index f63c52e..2a83fc6 100644
--- a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/CharacterEscapeHandler.java
+++ b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/CharacterEscapeHandler.java
@@ -28,6 +28,8 @@
* @param start The starting position.
* @param length The number of characters to use.
* @param isAttVal true if this is an attribute value literal.
+ * @param out writer
+ * @throws java.io.IOException for errors
*/
void escape( char ch[], int start, int length, boolean isAttVal, Writer out ) throws IOException;
diff --git a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/DataWriter.java b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/DataWriter.java
index 4f9cc6b..13d612f 100644
--- a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/DataWriter.java
+++ b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/DataWriter.java
@@ -98,6 +98,7 @@
* @param encoding
* If non-null string is specified, it is written as a part
* of the XML declaration.
+ * @param _escapeHandler escape handler
*/
public DataWriter ( Writer writer, String encoding, CharacterEscapeHandler _escapeHandler )
{
diff --git a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/DomSerializer.java b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/DomSerializer.java
index dcdef05..029d9cc 100644
--- a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/DomSerializer.java
+++ b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/DomSerializer.java
@@ -13,7 +13,6 @@
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
-import org.w3c.dom.Text;
import org.xml.sax.Attributes;
import org.xml.sax.ContentHandler;
import org.xml.sax.Locator;
diff --git a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/SaxSerializer.java b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/SaxSerializer.java
index 96020dc..c0abaa5 100644
--- a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/SaxSerializer.java
+++ b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/SaxSerializer.java
@@ -39,6 +39,8 @@
* <p>
* Sepcifying a non-null {@link LexicalHandler} allows applications
* to write comments and CDATA sections.
+ * @param handler writer
+ * @param lex writer for comments and CDATA
*/
public SaxSerializer(ContentHandler handler,LexicalHandler lex) {
this(handler, lex, true);
diff --git a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/XMLWriter.java b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/XMLWriter.java
index d7b83da..f65cca6 100644
--- a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/XMLWriter.java
+++ b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/XMLWriter.java
@@ -258,9 +258,10 @@
*
* @param writer
* The output destination, or null to use standard output.
- * @param encoding
+ * @param encoding
* If non-null string is specified, it is written as a part
* of the XML declaration.
+ * @param _escapeHandler escape handler
*/
public XMLWriter (Writer writer, String encoding, CharacterEscapeHandler _escapeHandler )
{
@@ -332,6 +333,7 @@
* {@link #endDocument endDocument} method after writing a
* document.</p>
*
+ * @throws java.io.IOException for errors
* @see #reset()
*/
public void flush ()
@@ -346,6 +348,9 @@
*
* @param writer The output destination, or null to use
* standard output.
+ * @param _encoding
+ * If non-null string is specified, it is written as a part
+ * of the XML declaration.
* @see #flush()
*/
public void setOutput (Writer writer,String _encoding)
@@ -367,6 +372,7 @@
* ({@code <?xml version='1.0' ... ?>}).
* <p>
* This option is set to true by default.
+ * @param _writeXmlDecl write out the XML declaration
*/
public void setXmlDecl( boolean _writeXmlDecl ) {
this.writeXmlDecl = _writeXmlDecl;
diff --git a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/XmlSerializer.java b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/XmlSerializer.java
index 5eeba3d..c0365c6 100644
--- a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/XmlSerializer.java
+++ b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/XmlSerializer.java
@@ -53,6 +53,8 @@
*
* @param uri
* the namespace URI of the element. Can be empty but never be null.
+ * @param localName
+ * the local name of the element.
* @param prefix
* the prefix that should be used for this element. Can be empty,
* but never null.
@@ -68,6 +70,8 @@
*
* @param uri
* the namespace URI of the attribute. Can be empty but never be null.
+ * @param localName
+ * the local name of the attribute.
* @param prefix
* the prefix that should be used for this attribute. Can be empty,
* but never null.
@@ -89,6 +93,8 @@
*
* @param uri
* the namespace URI of the element. Can be empty but never be null.
+ * @param localName
+ * the local name of the element.
* @param prefix
* the prefix that should be used for this element. Can be empty,
* but never null.
@@ -111,12 +117,14 @@
/**
* Writes CDATA.
+ * @param text CDATA
*/
void cdata(StringBuilder text);
/**
* Writes a comment.
*
+ * @param comment a comment
* @throws UnsupportedOperationException
* if the writer doesn't support writing a comment, it can throw this exception.
*/
diff --git a/jaxb-ri/txw/runtime/src/test/java/t1/Main.java b/jaxb-ri/txw/runtime/src/test/java/t1/Main.java
index a9d69dd..cdb70a5 100644
--- a/jaxb-ri/txw/runtime/src/test/java/t1/Main.java
+++ b/jaxb-ri/txw/runtime/src/test/java/t1/Main.java
@@ -13,7 +13,6 @@
import com.sun.xml.txw2.TXW;
import com.sun.xml.txw2.output.DumpSerializer;
-import javax.xml.namespace.QName;
/**
* @author Kohsuke Kawaguchi