From f246856da250814a15c971396fc0f0caec73eae8 Mon Sep 17 00:00:00 2001 From: Hannes Wellmann Date: Mon, 14 Oct 2024 19:45:38 +0200 Subject: [PATCH] Use RetentionPolicy CLASS in new 'ServiceContextKey' OSGi property type And permit only types as target. --- .../src/org/eclipse/e4/core/contexts/IContextFunction.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/runtime/bundles/org.eclipse.e4.core.contexts/src/org/eclipse/e4/core/contexts/IContextFunction.java b/runtime/bundles/org.eclipse.e4.core.contexts/src/org/eclipse/e4/core/contexts/IContextFunction.java index 721a396c6a7..89e009dcef5 100644 --- a/runtime/bundles/org.eclipse.e4.core.contexts/src/org/eclipse/e4/core/contexts/IContextFunction.java +++ b/runtime/bundles/org.eclipse.e4.core.contexts/src/org/eclipse/e4/core/contexts/IContextFunction.java @@ -15,8 +15,10 @@ package org.eclipse.e4.core.contexts; +import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; import org.osgi.framework.BundleContext; import org.osgi.service.component.annotations.ComponentPropertyType; @@ -74,7 +76,8 @@ public interface IContextFunction { * @see #SERVICE_CONTEXT_KEY */ @ComponentPropertyType - @Retention(RetentionPolicy.SOURCE) + @Retention(RetentionPolicy.CLASS) + @Target(ElementType.TYPE) public @interface ServiceContextKey { Class value(); }