XStream
  1. XStream
  2. XSTR-378

TextAttributeConverter uses reflection to access non-portable instanceMap field.

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.2.2
    • Component/s: None
    • Labels:
      None
    • JDK version and platform:
      Apache Harmony on Debian

      Description

      TextAttributeConverter uses reflection to access non-portable instanceMap field which is not present on all VM's. Apache Harmony, specifically, does not have this field, leading to;

      java.lang.InternalError: Missing TextAttribute.instanceMap
      at com.thoughtworks.xstream.converters.extended.TextAttributeConverter.<clinit>(TextAttributeConverter.java:30)
      at com.thoughtworks.xstream.XStream.setupConverters(XStream.java:583)
      at com.thoughtworks.xstream.XStream.<init>(XStream.java:370)
      at com.thoughtworks.xstream.XStream.<init>(XStream.java:316)

      The source as shown at http://svn.codehaus.org/xstream/trunk/xstream/src/java/com/thoughtworks/xstream/converters/extended/TextAttributeConverter.java

      contains this;

      instanceMap = TextAttribute.class.getDeclaredField("instanceMap");

      Can this class be changed to work on all VM's, not just Sun's RI?

        Issue Links

          People

          • Assignee:
            Unassigned
            Reporter:
            Robert Newson
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: