From 7d1164aef321454f56539e27fe5c948a6673674e Mon Sep 17 00:00:00 2001 From: Gilles Duboscq Date: Tue, 13 Feb 2024 13:20:15 +0100 Subject: [PATCH] Compare JVMCI objects with equals insead of == --- .../substitute/AnnotationSubstitutionProcessor.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/substitute/AnnotationSubstitutionProcessor.java b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/substitute/AnnotationSubstitutionProcessor.java index dbbaae0961e2..82ed6d51d2cc 100644 --- a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/substitute/AnnotationSubstitutionProcessor.java +++ b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/substitute/AnnotationSubstitutionProcessor.java @@ -916,13 +916,13 @@ private static boolean isIncluded(TargetElement targetElementAnnotation, Class void register(Map 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); } }