javaBeansWriter.ts writes what java.beans.XMLDecoder reads — the counterpart of javabeans.ts and the base of the .fls writer. Its input says explicitly what Java should do: construct a class with typed arguments, call setters, getters (with statements on their result), methods and indexed access; an object reached twice is written once with an id and referenced after. Unlike XMLEncoder it writes what it is given, defaults included. What XML 1.0 cannot hold (controls, lone surrogates, U+FFFE/F) and a CR, which XML would read as a line break, are written as <char code>. Checked by Java itself: nine files of the writer (strings with every kind of odd unit, all primitive types including NaN, -0.0 and a long beyond 2^53, collections, maps, shared objects, Rectangle, Color, FILIUS beans with getter chains, arrays, indexed access, a static constant) are read by XMLDecoder in the Java oracle (BeansDump), which describes what it got and collects the errors the decoder would only log. Mutation probes regenerate the files and let Java read each mutant. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
56 lines
1.2 KiB
XML
56 lines
1.2 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<java version="17" class="java.beans.XMLDecoder">
|
|
<object class="java.util.LinkedList">
|
|
<void method="add">
|
|
<string>plain</string>
|
|
</void>
|
|
<void method="add">
|
|
<string></string>
|
|
</void>
|
|
<void method="add">
|
|
<string> spaced </string>
|
|
</void>
|
|
<void method="add">
|
|
<string><&>"'</string>
|
|
</void>
|
|
<void method="add">
|
|
<string>]]></string>
|
|
</void>
|
|
<void method="add">
|
|
<string>tab here</string>
|
|
</void>
|
|
<void method="add">
|
|
<string>line
|
|
break</string>
|
|
</void>
|
|
<void method="add">
|
|
<string>cr<char code="#D"/>here</string>
|
|
</void>
|
|
<void method="add">
|
|
<string>crlf<char code="#D"/>
|
|
here</string>
|
|
</void>
|
|
<void method="add">
|
|
<string><char code="#0"/><char code="#1"/><char code="#1F"/></string>
|
|
</void>
|
|
<void method="add">
|
|
<string>
</string>
|
|
</void>
|
|
<void method="add">
|
|
<string>bom</string>
|
|
</void>
|
|
<void method="add">
|
|
<string>Grüße 😀</string>
|
|
</void>
|
|
<void method="add">
|
|
<string>lone <char code="#D800"/> high</string>
|
|
</void>
|
|
<void method="add">
|
|
<string>lone <char code="#DC00"/> low</string>
|
|
</void>
|
|
<void method="add">
|
|
<string><char code="#FFFE"/><char code="#FFFF"/></string>
|
|
</void>
|
|
</object>
|
|
</java>
|