fix(fls): Gnutella's peer limit is random in Java, not a default

PeerToPeerAnwendung's constructor rolls its peer limit (3, 4 or 5). The
getter defaults measured it once each run — 4, then 5 — and c48d15d
committed 5 as a default. GetterDefaults now constructs every class 64
times and writes a value that varies as {"random": [...]}; the decoder
answers a reference to it as unresolved, and the topology layer reports
a peer limit the file does not set as null.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-30 06:12:14 +00:00
co-authored by Claude Opus 5.5
parent c48d15def4
commit 8080e7dcb2
6 changed files with 65 additions and 17 deletions
+11
View File
@@ -240,6 +240,17 @@ describe('XMLDecoder rules', () => {
expect(isUnresolved(listItems(holder)[0])).toBe(true);
});
it('does not take a value Java rolls in its constructor as a default', () => {
// Gnutella's peer limit is 3, 4 or 5 at random (measured by constructing it 64 times).
const [, holder] = decodeJavaBeans(
doc(`<object class="filius.software.dateiaustausch.PeerToPeerAnwendung"><void id="Integer0" property="maxTeilnehmerZahl"/></object>
<object class="java.util.ArrayList"><void method="add"><object idref="Integer0"/></void></object>`),
);
const [item] = listItems(holder);
expect(item).toEqual({ kind: 'unresolved', reason: 'PeerToPeerAnwendung#maxTeilnehmerZahl is random in Java' });
});
it('reports an idref to an id that was never defined', () => {
const [value] = decodeJavaBeans(doc('<object idref="Missing0"/>'));