Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/main/java/org/simdjson/ConstructorArgumentsMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ ConstructorArgument get(byte[] buffer, int len) {
int place = findPlace(buffer, len);
for (int i = 0; i < capacity; i++) {
byte[] key = keys[place];
if (key == null) {
return null;
}
if (Arrays.equals(key, 0, key.length, buffer, 0, len)) {
return arguments[place];
}
Expand Down
19 changes: 19 additions & 0 deletions src/test/java/org/simdjson/ObjectSchemaBasedParsingTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,25 @@ public void listsWithoutElementTypeAreNotSupported() {
.hasMessage("Undefined list element type.");
}

@Test
public void issue50() {
// given
SimdJsonParser parser = new SimdJsonParser();
byte[] json = toUtf8("{\"name\": \"John\", \"age\": 30, \"aaa\": 1, \"bbb\": 2, \"ccc\": 3}");

// when
Issue50 object = parser.parse(json, json.length, Issue50.class);

// then
assertThat(object.aaa()).isEqualTo(1);
assertThat(object.bbb()).isEqualTo(2);
assertThat(object.ccc()).isEqualTo(3);
}

private record Issue50(long aaa, long bbb, long ccc) {

}

private record RecordWithExplicitFieldNames(@JsonFieldName("ąćśńźż") long firstField,
@JsonFieldName("\u20A9\u0E3F") long secondField,
@JsonFieldName("αβγ") long thirdField,
Expand Down