Skip to content

Commit fbdacb5

Browse files
Fix for Array index out of bounds
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent 404ded9 commit fbdacb5

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

core/src/test/java/com/datastax/dse/driver/internal/core/graph/GraphTestUtils.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,10 @@ public static GraphBinaryModule createGraphBinaryModule(DefaultDriverContext con
171171

172172
public static void assertThatContainsProperties(
173173
Map<Object, Object> properties, Object... propsToMatch) {
174+
if ((propsToMatch.length % 2) != 0) {
175+
throw new IllegalArgumentException(
176+
"propsToMatch must contain an even number of elements (key/value pairs)");
177+
}
174178
for (int i = 0; i < propsToMatch.length; i += 2) {
175179
assertThat(properties).containsEntry(propsToMatch[i], propsToMatch[i + 1]);
176180
}

0 commit comments

Comments
 (0)