10
10
package org .elasticsearch .entitlement .instrumentation .impl ;
11
11
12
12
import org .elasticsearch .entitlement .instrumentation .CheckMethod ;
13
+ import org .elasticsearch .entitlement .instrumentation .EntitlementInstrumented ;
13
14
import org .elasticsearch .entitlement .instrumentation .Instrumenter ;
14
15
import org .elasticsearch .entitlement .instrumentation .MethodKey ;
15
16
import org .elasticsearch .logging .LogManager ;
@@ -92,7 +93,7 @@ public byte[] instrumentClass(String className, byte[] classfileBuffer) {
92
93
93
94
class EntitlementClassVisitor extends ClassVisitor {
94
95
95
- private static final String ENTITLEMENT_ANNOTATION = " EntitlementInstrumented" ;
96
+ private static final String ENTITLEMENT_ANNOTATION_DESCRIPTOR = Type . getDescriptor ( EntitlementInstrumented . class ) ;
96
97
97
98
private final String className ;
98
99
@@ -111,7 +112,7 @@ public void visit(int version, int access, String name, String signature, String
111
112
112
113
@ Override
113
114
public AnnotationVisitor visitAnnotation (String descriptor , boolean visible ) {
114
- if (visible && descriptor .equals (ENTITLEMENT_ANNOTATION )) {
115
+ if (visible && descriptor .equals (ENTITLEMENT_ANNOTATION_DESCRIPTOR )) {
115
116
isAnnotationPresent = true ;
116
117
annotationNeeded = false ;
117
118
}
@@ -177,7 +178,7 @@ public MethodVisitor visitMethod(int access, String name, String descriptor, Str
177
178
private void addClassAnnotationIfNeeded () {
178
179
if (annotationNeeded ) {
179
180
// logger.debug("Adding {} annotation", ENTITLEMENT_ANNOTATION);
180
- AnnotationVisitor av = cv .visitAnnotation (ENTITLEMENT_ANNOTATION , true );
181
+ AnnotationVisitor av = cv .visitAnnotation (ENTITLEMENT_ANNOTATION_DESCRIPTOR , true );
181
182
if (av != null ) {
182
183
av .visitEnd ();
183
184
}
0 commit comments