Commit 4f46470
fix(metadata): close the DATE-array storage gap left by #275
Two root defects in the JSON array-write storage path, deliberately left
unfixed by the #275 batch as out-of-scope scope-creep triggers:
- MetaField.setObject(Object,Object) converted via the field's SCALAR
getDataType() instead of the array-aware getEffectiveDataType(), so an
isArray field's List value was corrupted (comma-joined / bracketed
toString()) before setObjectAttribute's own instanceof check rejected it.
Broke setBoolean/setInt/setLong/setDouble/setStringArray, and every
MetaObjectDeserializer array-read branch that routes through it.
- DataConverter had no DATE_ARRAY case (the commented-out
`//toDateArray(val)` fragment), so no entry point could store a
List<Date> on an isArray field.date/field.timestamp field.
Fix: getEffectiveDataType() in MetaField.setObject (a strict no-op for
every non-array field); a new DataConverter.toDateArray mirroring the
sibling toLongArray/toBooleanArray shape, wired into case DATE_ARRAY.
BYTE_ARRAY/SHORT_ARRAY stay on the unsupported arm (field.byte/field.short
are non-functional stubs).
Also closes the deferred findings this unblocked: MetaObjectSerializer's
DATE-array element loop now converts via DataConverter.toDate(o) instead
of a hard cast; field.timestamp (incl. @localTime) array coverage; a
full-Gson-pipeline round trip for the previously-untestable DATE-array
read path in MetaObjectDeserializer; null-array-itself pins extended to
every touched type; and a stale MetaObjectDeserializer comment describing
the DATE-array branch as blocked, now rewritten to match reality.
Blast-radius checked: every MetaField.setObject caller either passes a
scalar value (no-op under the fix) or already routed around the array bug
via setObjectArray/setValue; no caller depended on the corrupting
conversion succeeding.
Refs #275
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015TqsuDye2SfXGf43vuoD3n1 parent ce90dab commit 4f46470
7 files changed
Lines changed: 302 additions & 76 deletions
File tree
- server/java/metadata/src
- main/java/com/metaobjects
- field
- io/object/gson
- util
- test
- java/com/metaobjects
- io/object/gson
- util
- resources/com/metaobjects/io/object/gson
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1089 | 1089 | | |
1090 | 1090 | | |
1091 | 1091 | | |
1092 | | - | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
1093 | 1097 | | |
1094 | 1098 | | |
1095 | 1099 | | |
| |||
Lines changed: 6 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
137 | 135 | | |
138 | 136 | | |
139 | 137 | | |
| |||
Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
94 | 95 | | |
95 | 96 | | |
96 | 97 | | |
97 | | - | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
98 | 105 | | |
99 | 106 | | |
100 | 107 | | |
| |||
Lines changed: 28 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
51 | 50 | | |
52 | 51 | | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| |||
755 | 755 | | |
756 | 756 | | |
757 | 757 | | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
758 | 785 | | |
759 | 786 | | |
760 | 787 | | |
| |||
0 commit comments