XStream
  1. XStream
  2. XSTR-24

Converter for old collections: Vector and Hashtable

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Reported by Jim Gentilesco

      Here's the error message:

      Exception in thread "main" java.lang.NullPointerException
      at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.createCollection(AbstractCollectionConverter.java:48)
      at com.thoughtworks.xstream.converters.collections.CollectionConverter.fromXML(CollectionConverter.java:31)
      at com.thoughtworks.xstream.XStream.fromXML(XStream.java:121)
      at com.thoughtworks.xstream.XStream.fromXML(XStream.java:114)
      at Bug.main(Bug.java:15)

      Here's the code:

      import java.util.*;
      import com.thoughtworks.xstream.*;

      public class Bug
      {
      public static void main(String[] args)

      { Vector o1 = new Vector(); o1.addElement("bug"); XStream xstream = new XStream(); String xml = xstream.toXML(o1); System.out.println(xml); Vector o2 = (Vector)xstream.fromXML(xml); // String xml2 = xstream.toXML(o2); // System.out.println(xml2); }

      }

        People

        • Assignee:
          Unassigned
          Reporter:
          Joe Walnes
        • Votes:
          0 Vote for this issue
          Watchers:
          0 Start watching this issue

          Dates

          • Created:
            Updated:
            Resolved: