Skip to content
Merged
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
12 changes: 11 additions & 1 deletion src/test/java/com/datadog/api/World.java
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,17 @@ public static Object lookup(Object data, String path)
}
if (part.contains("]")) {
int index = Integer.parseInt(part.replaceAll("]", ""));
result = List.class.cast(result).get(index);
// Unwrap oneOf wrapper before indexing into array
try {
result = List.class.cast(result).get(index);
} catch (ClassCastException e) {
try {
Object unwrapped = result.getClass().getMethod("getActualInstance").invoke(result);
result = List.class.cast(unwrapped).get(index);
} catch (Exception ex) {
throw e;
}
}
} else {
try {
result = HashMap.class.cast(result).get(part);
Expand Down
Loading