aboutsummaryrefslogtreecommitdiff
path: root/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java')
-rw-r--r--src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java b/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java
index a972c1fe..5d582aad 100644
--- a/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java
+++ b/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java
@@ -449,6 +449,24 @@ public class EclipseHandlerUtil {
return out;
}
+ public static Annotation[] getTypeUseAnnotations(TypeReference from) {
+ Annotation[][] a;
+ try {
+ a = (Annotation[][]) reflect(TYPE_REFERENCE__ANNOTATIONS, from);
+ } catch (Exception e) {
+ return null;
+ }
+ if (a == null) return null;
+ Annotation[] b = a[a.length - 1];
+ return b.length == 0 ? null : b;
+ }
+
+ public static void removeTypeUseAnnotations(TypeReference from) {
+ try {
+ reflectSet(TYPE_REFERENCE__ANNOTATIONS, from, null);
+ } catch (Exception ignore) {}
+ }
+
public static TypeReference namePlusTypeParamsToTypeReference(char[] typeName, TypeParameter[] params, long p) {
if (params != null && params.length > 0) {
TypeReference[] refs = new TypeReference[params.length];