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:
2026-09-30 07:50:01 +00:00
co-authored by Claude Opus 5.5
parent 956443726b
commit 3795316fae
17 changed files with 1330 additions and 1 deletions
+25
View File
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<java version="17" class="java.beans.XMLDecoder">
<object class="java.util.Vector">
<void method="add">
<int>1</int>
</void>
<void method="add">
<object class="java.util.ArrayList">
<void method="add">
<string>nested</string>
</void>
</object>
</void>
</object>
<object class="java.util.HashMap">
<void method="put">
<string>key</string>
<int>7</int>
</void>
<void method="put">
<string>key</string>
<int>8</int>
</void>
</object>
</java>