Repository navigation
Commit cbfb149
feat(module): report unattributable types from ReflectionUtil, throttled
The three ReflectionUtil sites were left alone in the previous commit because a null module is a documented, usually-legitimate outcome there — every non-module class loaded by the app classloader takes that branch, so reporting each one would drown the log in a path that runs per type, per serialization.
But a module class that fails attribution lands in exactly the same branch and silently loses its module qualifier, which is the failure this whole effort started from. Saying nothing is the wrong trade too.
So: report, throttled. ModuleAttribution.reportUnattributedOnce names at most 20 distinct classes, says so when it stops, and resets after 60s of quiet. Same shape as the discarded-write throttle in WorldProviderCoreImpl.
The throttle is documented as temporary scaffolding rather than furniture — it exists to make an invisible problem visible without making it unbearable, and should go once the underlying failures are fixed. Its state is static, which is a real wart: a long test run building many engines could have one engine's reports suppressed by another's. The 60s reset bounds that.
A single audit at environment switch would be better than all of this — walk the indexed classes once and report the whole set as it becomes true, instead of scattered surprises later, with no throttle needed by construction. Proposed rather than built, since it is a design change rather than a review follow-up.
Verified no reports fire during a healthy engine startup (ExampleTest), so this is a fault signal rather than background noise.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019pXw6g6JWNGP6eAyDJ1Cf8
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent 8fa2e03 commit cbfb149
2 files changed
Lines changed: 68 additions & 0 deletions
File tree
- engine/src/main/java/org/terasology/engine
- core/module
- utilities
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
11 | 15 | | |
12 | 16 | | |
13 | 17 | | |
14 | 18 | | |
15 | 19 | | |
16 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
17 | 36 | | |
18 | 37 | | |
19 | 38 | | |
20 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
21 | 78 | | |
22 | 79 | | |
23 | 80 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
10 | 12 | | |
| 13 | + | |
11 | 14 | | |
12 | 15 | | |
13 | 16 | | |
| |||
35 | 38 | | |
36 | 39 | | |
37 | 40 | | |
| 41 | + | |
| 42 | + | |
38 | 43 | | |
39 | 44 | | |
40 | 45 | | |
| |||
653 | 658 | | |
654 | 659 | | |
655 | 660 | | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
656 | 665 | | |
657 | 666 | | |
658 | 667 | | |
| |||
674 | 683 | | |
675 | 684 | | |
676 | 685 | | |
| 686 | + | |
677 | 687 | | |
678 | 688 | | |
679 | 689 | | |
| |||
695 | 705 | | |
696 | 706 | | |
697 | 707 | | |
| 708 | + | |
698 | 709 | | |
699 | 710 | | |
700 | 711 | | |
| |||
0 commit comments