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:
@@ -85,6 +85,16 @@ wird leer, der Eintrag bleibt trotzdem; Typen außer A/MX/NS (auch `a`,
|
||||
`CNAME`, eine Kommentarzeile) gelten als gültig; eine TTL, die kein `int`
|
||||
ist, wird still 3600.
|
||||
|
||||
## Was Java aus unserem XML macht
|
||||
|
||||
`BeansDump` liest jede `*.xml` unter `packages/fls/test/beans/` mit
|
||||
`XMLDecoder` und beschreibt, was dabei herauskommt (Beans über ihre
|
||||
Eigenschaften mit Lese- und Schreibmethode, Listen, Maps, Arrays,
|
||||
`Rectangle`, `Color`; ein zweites Mal gesehenes Objekt als Verweis) —
|
||||
`beans.java.json`. Fehler, die der Decoder sonst nur ins Log schreibt,
|
||||
sammelt ein `ExceptionListener`. Zeichenketten stehen als ASCII mit
|
||||
`\uXXXX`, weil ein einsames Surrogat in UTF-8 sonst zu „?“ würde.
|
||||
|
||||
## E-Mail-Kontodateien
|
||||
|
||||
`EmailFileCases server|client` legt für jede Zeile von
|
||||
|
||||
Reference in New Issue
Block a user