feat(fls): a writer for the XMLDecoder format, checked by Java
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>
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<java version="17" class="java.beans.XMLDecoder">
|
||||
<array class="java.lang.String" length="3">
|
||||
<void index="0">
|
||||
<string>a</string>
|
||||
</void>
|
||||
<void index="1">
|
||||
<null/>
|
||||
</void>
|
||||
<void index="2">
|
||||
<string>c</string>
|
||||
</void>
|
||||
</array>
|
||||
<array class="int" length="2">
|
||||
<void index="0">
|
||||
<int>0</int>
|
||||
</void>
|
||||
<void index="1">
|
||||
<int>5</int>
|
||||
</void>
|
||||
</array>
|
||||
</java>
|
||||
Reference in New Issue
Block a user