From 28f062ddfc0be095df16c165457cc7d21148ede4 Mon Sep 17 00:00:00 2001 From: "Lu, Jun" Date: Wed, 7 Aug 2024 21:23:22 +0800 Subject: [PATCH] ignore compiler generated annotations during Kotlin live reload instrument live-reload will compare class structure to make sure this class can be "redefine" But the classes generated by Kotlin compiler contains debug annotations, the comparison always fail. Exclude the annotations which generated by Kotlin compiler. --- .../io/quarkus/deployment/dev/ClassComparisonUtil.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/deployment/src/main/java/io/quarkus/deployment/dev/ClassComparisonUtil.java b/core/deployment/src/main/java/io/quarkus/deployment/dev/ClassComparisonUtil.java index a7f18fb788e72..8c87e8f724916 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/dev/ClassComparisonUtil.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/dev/ClassComparisonUtil.java @@ -6,6 +6,7 @@ import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.Set; import java.util.function.Function; import java.util.stream.Collectors; @@ -19,6 +20,10 @@ import org.jboss.jandex.Type; public class ClassComparisonUtil { + private static final Set IGNORED_ANNOTATIONS = Set.of( + DotName.createSimple("kotlin.jvm.internal.SourceDebugExtension"), + DotName.createSimple("kotlin.Metadata")); + static boolean isSameStructure(ClassInfo clazz, ClassInfo old) { if (clazz.flags() != old.flags()) { return false; @@ -161,6 +166,9 @@ private static void methodMap(Collection b, List valuesA = a.values(); List valuesB = b.values(); if (valuesA.size() != valuesB.size()) {