Details
-
Type: Bug
-
Status: Closed
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 1.2
-
Component/s: None
-
Labels:None
-
JDK version and platform:1.4.2_08-b03
Description
Using a class with an implicite collection that has the same name as the class causes a doublicate id to be generated. Here is the test code:
public class Main {
public static void main(String[] args) {
final XStream x = new XStream(new DomDriver(new ClassPathEntityResolver("utf-8")));
x.setMode(XStream.ID_REFERENCES);
x.alias("strings", Strings.class);
x.addImplicitCollection(Strings.class, "strings");
final Strings m = new Strings(new String[]
);
System.out.println(x.toXML(m));
}
}
class Strings {
private ArrayList strings = new ArrayList();
public Strings(String[] strings)
}
Leads to:
<strings id="1" id="2">
<string>Hallo</string>
<string>Daniel</string>
</strings>
Cheers
Daniel
Issue Links
- is related to
-
XSTR-283 Implicite Collections lead to wrong reference in plain XML text
Actually it seems always to be the case. Even if the names are not identical.