Commit 06a4f83
Remove reflection from ensureClassInitialized, fix <clinit> ordering
Replace the reflective initialize() fallback in ensureClassInitialized()
with a pure Class.forName() approach. The recursive <clinit> issue in
CosmosItemSerializer is fixed by moving 'static { initialize(); }' before
the DEFAULT_SERIALIZER field, so the accessor is registered before
DefaultCosmosItemSerializer's <clinit> needs it.
ensureClassInitialized() is now a clean 3-line method with no reflection.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 5e11ce7 commit 06a4f83
File tree
2 files changed
+4
-16
lines changed- sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos
- implementation
2 files changed
+4
-16
lines changedLines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
33 | 36 | | |
34 | 37 | | |
35 | 38 | | |
| |||
163 | 166 | | |
164 | 167 | | |
165 | 168 | | |
166 | | - | |
167 | | - | |
168 | 169 | | |
Lines changed: 1 addition & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
| 126 | + | |
136 | 127 | | |
137 | 128 | | |
138 | 129 | | |
139 | 130 | | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | 131 | | |
145 | 132 | | |
146 | 133 | | |
| |||
0 commit comments