Fix dependency error in some programs that use annotation API

This commit is contained in:
Alexey Andreev 2015-06-23 19:17:32 +04:00
parent 49e6050871
commit c9e9e3654a
3 changed files with 11 additions and 3 deletions

View File

@ -139,5 +139,15 @@ public class AnnotationDependencyListener extends AbstractDependencyListener {
agent.linkClass(className, location);
}
}
if (method.getMethod().hasModifier(ElementModifier.STATIC) &&
method.getMethod().getName().equals("$$__readAnnotations__$$")) {
ClassReader cls = agent.getClassSource().get(method.getReference().getClassName());
if (cls != null) {
for (AnnotationReader annotation : cls.getAnnotations().all()) {
agent.linkClass(annotation.getType(), location);
}
}
}
}
}

View File

@ -24,7 +24,7 @@ import java.lang.annotation.Target;
*
* @author Alexey Andreev
*/
@Retention(RetentionPolicy.RUNTIME)
@Retention(RetentionPolicy.CLASS)
@Target(ElementType.TYPE)
@interface FunctorImpl {
String value();

View File

@ -60,8 +60,6 @@ public class PlatformGenerator implements Generator, Injector, DependencyPlugin
case "getCurrentThread":
method.getResult().propagate(agent.getType("java.lang.Thread"));
break;
case "getAnnotations":
method.getResult();
}
}