Skip to content

Commit

Permalink
Compare JVMCI objects with equals insead of ==
Browse files Browse the repository at this point in the history
  • Loading branch information
gilles-duboscq committed Aug 30, 2024
1 parent 9df286d commit 7d1164a
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 7d1164a

Please sign in to comment.