Skip to content

Commit

Permalink
DGS-9067 Ensure keys for schema cache are not mutated
Browse files Browse the repository at this point in the history
  • Loading branch information
rayokota committed Nov 14, 2023
1 parent a651c9c commit b19aea8
Showing 1 changed file with 10 additions and 1 deletion.
Expand Up @@ -1089,7 +1089,7 @@ public ParsedSchema parseSchema(
boolean isNew,
boolean normalize) throws InvalidSchemaException {
try {
return schemaCache.get(new RawSchema(schema, isNew, normalize));
return schemaCache.get(new RawSchema(schema.copy(), isNew, normalize));
} catch (ExecutionException e) {
Throwable cause = e.getCause();
if (cause instanceof InvalidSchemaException) {
Expand Down Expand Up @@ -1961,6 +1961,15 @@ public boolean equals(Object o) {
public int hashCode() {
return Objects.hash(schema, isNew, normalize);
}

@Override
public String toString() {
return "RawSchema{"
+ "schema=" + schema
+ ", isNew=" + isNew
+ ", normalize=" + normalize
+ '}';
}
}

public static class SchemeAndPort {
Expand Down

0 comments on commit b19aea8

Please sign in to comment.