Skip to content

Commit

Permalink
8274415: Suppress warnings on non-serializable non-transient instance…
Browse files Browse the repository at this point in the history
… fields in java.xml
  • Loading branch information
jddarcy committed Sep 28, 2021
1 parent 5b660f3 commit 7f31bfd
Show file tree
Hide file tree
Showing 27 changed files with 45 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@
*/
public class TypeCheckError extends Exception {
static final long serialVersionUID = 3246224233917854640L;
@SuppressWarnings("serial") // Type of field is not Serializable
ErrorMsg _error = null;
@SuppressWarnings("serial") // Type of field is not Serializable
SyntaxTreeNode _node = null;

public TypeCheckError(SyntaxTreeNode node) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ public class AttrImpl
//

/** This can either be a String or the first child node. */
@SuppressWarnings("serial") // Type of field is not Serializable
protected Object value = null;

/** Attribute name. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,7 @@ class LEntry implements Serializable {

private static final long serialVersionUID = -8426757059492421631L;
String type;
@SuppressWarnings("serial") // Type of field is not Serializable
EventListener listener;
boolean useCapture;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ public class NamedNodeMapImpl
protected final static short HASDEFAULTS = 0x1<<2;

/** Nodes. */
@SuppressWarnings("serial") // Type of field is not Serializable
protected List<Node> nodes;

protected NodeImpl ownerNode; // the node this map belongs to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,19 @@ public PSVIAttrNSImpl(CoreDocumentImpl ownerDocument, String namespaceURI,
}

/** attribute declaration */
@SuppressWarnings("serial") // Type of field is not Serializable
protected XSAttributeDeclaration fDeclaration = null;

/** type of attribute, simpleType */
@SuppressWarnings("serial") // Type of field is not Serializable
protected XSTypeDefinition fTypeDecl = null;

/** If this attribute was explicitly given a
* value in the original document, this is true; otherwise, it is false */
protected boolean fSpecified = true;

/** Schema value */
@SuppressWarnings("serial") // Type of field is not Serializable
protected ValidatedInfo fValue = new ValidatedInfo();

/** validation attempted: none, partial, full */
Expand All @@ -79,9 +82,11 @@ public PSVIAttrNSImpl(CoreDocumentImpl ownerDocument, String namespaceURI,
protected short fValidity = AttributePSVI.VALIDITY_NOTKNOWN;

/** error codes */
@SuppressWarnings("serial") // Type of field is not Serializable
protected StringList fErrorCodes = null;

/** error messages */
@SuppressWarnings("serial") // Type of field is not Serializable
protected StringList fErrorMessages = null;

/** validation context: could be QName or XPath expression*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,11 @@ public PSVIElementNSImpl(CoreDocumentImpl ownerDocument, String namespaceURI,
}

/** element declaration */
@SuppressWarnings("serial") // Type of field is not Serializable
protected XSElementDeclaration fDeclaration = null;

/** type of element, could be xsi:type */
@SuppressWarnings("serial") // Type of field is not Serializable
protected XSTypeDefinition fTypeDecl = null;

/** true if clause 3.2 of Element Locally Valid (Element) (3.3.4)
Expand All @@ -75,9 +77,11 @@ public PSVIElementNSImpl(CoreDocumentImpl ownerDocument, String namespaceURI,
protected boolean fSpecified = true;

/** Schema value */
@SuppressWarnings("serial") // Type of field is not Serializable
protected ValidatedInfo fValue = new ValidatedInfo();

/** http://www.w3.org/TR/xmlschema-1/#e-notation*/
@SuppressWarnings("serial") // Type of field is not Serializable
protected XSNotationDeclaration fNotation = null;

/** validation attempted: none, partial, full */
Expand All @@ -87,15 +91,18 @@ public PSVIElementNSImpl(CoreDocumentImpl ownerDocument, String namespaceURI,
protected short fValidity = ElementPSVI.VALIDITY_NOTKNOWN;

/** error codes */
@SuppressWarnings("serial") // Type of field is not Serializable
protected StringList fErrorCodes = null;

/** error messages */
@SuppressWarnings("serial") // Type of field is not Serializable
protected StringList fErrorMessages = null;

/** validation context: could be QName or XPath expression*/
protected String fValidationContext = null;

/** the schema information property */
@SuppressWarnings("serial") // Type of field is not Serializable
protected XSModel fSchemaInformation = null;

//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1024,7 +1024,9 @@ class UserDataRecord implements Serializable {
/** Serialization version. */
private static final long serialVersionUID = 3258126977134310455L;

@SuppressWarnings("serial") // Type of field is not Serializable
Object fData;
@SuppressWarnings("serial") // Type of field is not Serializable
UserDataHandler fHandler;
UserDataRecord(Object data, UserDataHandler handler) {
fData = data;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public class MalformedByteSequenceException extends CharConversionException {
//

/** message formatter **/
@SuppressWarnings("serial") // Type of field is not Serializable
private MessageFormatter fFormatter;

/** locale for error message **/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ private static final class ComplexTypeRecoverableError extends Exception {
private static final long serialVersionUID = 6802729912091130335L;

Object[] errorSubstText=null;
@SuppressWarnings("serial") // Type of field is not Serializable
Element errorElem = null;
ComplexTypeRecoverableError() {
super();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public class ObjectPool implements java.io.Serializable

/** Stack of given objects this points to.
* @serial */
@SuppressWarnings("serial") // Type of field is not Serializable
private final List<Object> freeStack;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public class SAXSourceLocator extends LocatorImpl
/** The SAX Locator object.
* @serial
*/
@SuppressWarnings("serial") // Type of field is not Serializable
Locator m_locator;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public abstract class Expression implements java.io.Serializable, ExpressionNode
* messages. May be null.
* @serial
*/
@SuppressWarnings("serial") // Type of field is not Serializable
private ExpressionNode m_parent;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@ public DTM getDTM(int nodeHandle)
}

/* An instance of the DTMManager. */
@SuppressWarnings("serial") // Type of field is not Serializable
DTMManager m_manager;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public class XPathException extends TransformerException

/** The home of the expression that caused the error.
* @serial */
@SuppressWarnings("serial") // Type of field is not Serializable
Object m_styleNode = null;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,7 @@ public int getLastPos(XPathContext xctxt)
* from multiple documents.
* Never, ever, access this value without going through getDTM(int node).
*/
@SuppressWarnings("serial") // Type of field is not Serializable
private DTM m_dtm;

/**
Expand Down Expand Up @@ -587,5 +588,6 @@ public boolean deepEquals(Expression expr)
protected int m_axis = -1;

/** The DTM inner traversal class, that corresponds to the super axis. */
@SuppressWarnings("serial") // Type of field is not Serializable
protected DTMAxisTraverser m_traverser;
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,13 @@ public final class IteratorPool implements java.io.Serializable
/**
* Type of objects in this pool.
*/
@SuppressWarnings("serial") // Type of field is not Serializable
private final DTMIterator m_orig;

/**
* Stack of given objects this points to.
*/
@SuppressWarnings("serial") // Type of field is not Serializable
private final List<DTMIterator> m_freeStack;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -978,6 +978,7 @@ public void callVisitors(ExpressionOwner owner, XPathVisitor visitor)
* clear that this is needed.
* @serial
*/
@SuppressWarnings("serial") // Type of field is not Serializable
private PrefixResolver m_prefixResolver;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public class MatchPatternIterator extends LocPathIterator
protected int m_superAxis = -1;

/** The DTM inner traversal class, that corresponds to the super axis. */
@SuppressWarnings("serial") // Type of field is not Serializable
protected DTMAxisTraverser m_traverser;

/** DEBUG flag for diagnostic dumps. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public class NodeSequence extends XObject
* <p>
* Multiple NodeSequence objects may share the same cache.
*/
@SuppressWarnings("serial") // Type of field is not Serializable
private IteratorCache m_cache;

/**
Expand Down Expand Up @@ -128,6 +129,7 @@ private void markCacheComplete() {
/**
* The functional iterator that fetches nodes.
*/
@SuppressWarnings("serial") // Type of field is not Serializable
protected DTMIterator m_iter;

/**
Expand All @@ -152,6 +154,7 @@ public final DTMIterator getContainedIter()
* The DTMManager to use if we're using a NodeVector only.
* We may well want to do away with this, and store it in the NodeVector.
*/
@SuppressWarnings("serial") // Type of field is not Serializable
protected DTMManager m_dtmMgr;

// ==== Constructors ====
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public class OneStepIterator extends ChildTestIterator
protected int m_axis = -1;

/** The DTM inner traversal class, that corresponds to the super axis. */
@SuppressWarnings("serial") // Type of field is not Serializable
protected DTMAxisIterator m_iterator;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,5 +244,6 @@ public boolean isDocOrdered()
}

/** The DTM inner traversal class, that corresponds to the super axis. */
@SuppressWarnings("serial") // Type of field is not Serializable
protected DTMAxisIterator m_iterator;
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,15 @@ public class FuncExtFunction extends Function
* order to allow caching of the method.
* @serial
*/
@SuppressWarnings("serial") // Type of field is not Serializable
Object m_methodKey;

/**
* Array of static expressions which represent the parameters to the
* function.
* @serial
*/
@SuppressWarnings("serial") // Type of field is not Serializable
List<Expression> m_argVec = new ArrayList<>();

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
public class XNodeSetForDOM extends XNodeSet
{
static final long serialVersionUID = -8396190713754624640L;
@SuppressWarnings("serial") // Type of field is not Serializable
Object m_origObj;

public XNodeSetForDOM(Node node, DTMManager dtmMgr)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public class XObject extends Expression implements Serializable, Cloneable
* The java object which this object wraps.
* @serial
*/
@SuppressWarnings("serial") // Type of field is not Serializable
protected Object m_obj; // This may be NULL!!!

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
public class XRTreeFrag extends XObject implements Cloneable
{
static final long serialVersionUID = -3201553822254911567L;
@SuppressWarnings("serial") // Type of field is not Serializable
private DTMXRTreeFrag m_DTMXRTreeFrag;
private int m_dtmRoot = DTM.NULL;
protected boolean m_allowRelease = false;
Expand Down Expand Up @@ -169,6 +170,7 @@ public boolean bool()
return true;
}

@SuppressWarnings("serial") // Type of field is not Serializable
private XMLString m_xmlStr = null;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public class XMLStreamException extends Exception {
/**
* The location of the error.
*/
@SuppressWarnings("serial") // Type of field is not Serializable
protected Location location;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public class TransformerException extends Exception {
private static final long serialVersionUID = 975798773772956428L;

/** Field locator specifies where the error occurred */
@SuppressWarnings("serial") // Type of field is not Serializable
SourceLocator locator;

/**
Expand Down

0 comments on commit 7f31bfd

Please sign in to comment.