Details
-
Type: Bug
-
Status: Closed
-
Resolution: Won't Fix
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
JDK version and platform:Sun 1.4.2_05 for linux, jikes 1.22
Description
When streaming an inner class, the XML is different depending on whether the bytecode was generated with javac or jikes.
XML written by one cannot be read by the other, it fails with a ConversionException caused by a CannotResolveClassException.
For this code, the following XML is generated:
import com.thoughtworks.xstream.XStream;
public class XStreamTest
{
private class Inner {}
private Inner inner = new Inner();
public static void main(String[] args)
{ XStream xstream = new XStream(); XStreamTest test = new XStreamTest(); String xml = xstream.toXML( test ); System.out.println( xml ); }}
javac:
<XStreamTest>
<inner>
<outer-class reference="../.."/>
</inner>
</XStreamTest>
jikes:
<XStreamTest>
<inner>
<this reference="../.."/>
</inner>
</XStreamTest>
Unfortunately the code generated by the different compilers are vendor specific and may lead to incompatibilities, see http://java.sun.com/j2se/1.5.0/docs/guide/serialization/spec/serial-arch.html#4539. We will analyse the situation though and can probably come up with a solution .. but nothing can be promised at this time.