Skip to content

Commit

Permalink
[GR-57800] Compare JVMCI objects with equals insead of ==.
Browse files Browse the repository at this point in the history
PullRequest: graal/18708
  • Loading branch information
gilles-duboscq committed Aug 30, 2024
2 parents 54b5f72 + 7d1164a commit c06c8de
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -916,13 +916,13 @@ private static boolean isIncluded(TargetElement targetElementAnnotation, Class<?

private static <T> void register(Map<T, T> substitutions, T annotated, T original, T target) {
if (annotated != null) {
guarantee(!substitutions.containsKey(annotated) || substitutions.get(annotated) == original || substitutions.get(annotated) == target,
"Substition: %s conflicts with previously registered: %s", annotated, substitutions.get(annotated));
guarantee(!substitutions.containsKey(annotated) || substitutions.get(annotated).equals(original) || substitutions.get(annotated).equals(target),
"Substition: %s -> %s conflicts with previously registered: %s", annotated, target, substitutions.get(annotated));
substitutions.put(annotated, target);
}
if (original != null) {
guarantee(!substitutions.containsKey(original) || substitutions.get(original) == original || substitutions.get(original) == target,
"Substition: %s conflicts with previously registered: %s", original, substitutions.get(original));
guarantee(!substitutions.containsKey(original) || substitutions.get(original).equals(original) || substitutions.get(original).equals(target),
"Substition: %s -> %s conflicts with previously registered: %s", original, target, substitutions.get(original));
substitutions.put(original, target);
}
}
Expand Down

0 comments on commit c06c8de

Please sign in to comment.