From 3e59c3ea5c927d240af6d0ce412b18d0c24a61ff Mon Sep 17 00:00:00 2001 From: Richard Eckart de Castilho Date: Tue, 29 Oct 2024 18:33:16 +0100 Subject: [PATCH] #5106 - Type of lookup feature is display wrong after creation - Fix display of feature type --- .../inception/feature/lookup/LookupFeatureSupport.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/inception/inception-feature-lookup/src/main/java/de/tudarmstadt/ukp/inception/feature/lookup/LookupFeatureSupport.java b/inception/inception-feature-lookup/src/main/java/de/tudarmstadt/ukp/inception/feature/lookup/LookupFeatureSupport.java index 3a8dfe736a3..05cdd4090dc 100644 --- a/inception/inception-feature-lookup/src/main/java/de/tudarmstadt/ukp/inception/feature/lookup/LookupFeatureSupport.java +++ b/inception/inception-feature-lookup/src/main/java/de/tudarmstadt/ukp/inception/feature/lookup/LookupFeatureSupport.java @@ -20,6 +20,7 @@ import static java.util.Arrays.asList; import static org.apache.commons.lang3.StringUtils.isNotBlank; +import java.lang.invoke.MethodHandles; import java.util.Collections; import java.util.List; import java.util.Optional; @@ -61,7 +62,7 @@ public class LookupFeatureSupport public static final String STRING = "string"; public static final String TYPE_STRING_LOOKUP = PREFIX + STRING; - private static final Logger LOG = LoggerFactory.getLogger(LookupFeatureSupport.class); + private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final LookupCache labelCache; private final LookupServiceProperties properties; @@ -94,13 +95,15 @@ public Optional getFeatureType(AnnotationFeature aFeature) } return Optional.of(new FeatureType(aFeature.getType(), - aFeature.getType().substring(PREFIX.length()), featureSupportId)); + "Lookup (" + aFeature.getType().substring(PREFIX.length()) + ")", + featureSupportId)); } @Override public List getSupportedFeatureTypes(AnnotationLayer aAnnotationLayer) { - return asList(new FeatureType(TYPE_STRING_LOOKUP, "Lookup", featureSupportId)); + return asList( + new FeatureType(TYPE_STRING_LOOKUP, "Lookup (" + STRING + ")", featureSupportId)); } @Override