Permalink
Browse files

Fixes #47 - serialization.

Also Fix FindBugs issues - some serialization warnings corrected.
  • Loading branch information...
1 parent 3a79d1c commit 7307ae519962cfa52aa87c2d25ac8f5a300a2923 @rolfl rolfl committed Feb 14, 2012
@@ -1,7 +1,7 @@
<FindBugsFilter>
<Match>
- <Package name="org.jdom2" />
+ <Package name="~org\.jdom2" />
</Match>
<Match>
<Package name="~org\.jdom2\..*" />
@@ -81,7 +81,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
protected String rawData;
/** The data for the PI in name/value pairs */
- protected transient Map<String,String> mapData;
+ protected transient Map<String,String> mapData = null;
/**
* Default, no-args constructor for implementations
@@ -88,7 +88,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
*/
private static final long serialVersionUID = 200L;
- private transient final IdentityHashMap<Element, NamespaceContainer[]> emtnsmap
+ private transient IdentityHashMap<Element, NamespaceContainer[]> emtnsmap
= new IdentityHashMap<Element, NamespaceContainer[]>();
void reset() {
@@ -322,5 +322,16 @@ public final Object getParentNode(Object contextNode) throws UnsupportedAxisExce
}
return JaxenConstants.EMPTY_ITERATOR;
}
+
+ private void readObject(java.io.ObjectInputStream in)
+ throws IOException, ClassNotFoundException {
+ in.defaultReadObject();
+ emtnsmap = new IdentityHashMap<Element, NamespaceContainer[]>();
+ }
+
+ private void writeObject(java.io.ObjectOutputStream out)
+ throws IOException {
+ out.defaultWriteObject();
+ }
}
@@ -84,6 +84,14 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
public class JDOMXPath extends org.jdom2.xpath.XPath {
/**
+ * Default mechanism.
+ * The serialization for this class is broken. It is only included here for
+ * compatibility with JDOM 1.x
+ */
+ private static final long serialVersionUID = 200L;
+
+
+ /**
* The compiled XPath object to select nodes. This attribute cannot be made
* final as it needs to be set upon object deserialization.
*/

0 comments on commit 7307ae5

Please sign in to comment.