@AutoService(value=ClassInstrumentor.Decorator.class) @Priority(value=-2147483648) public class ShadowDecorator extends Object implements ClassInstrumentor.Decorator
Decorator which adds Robolectric’s shadowing behavior to a class.
Constructor and Description |
---|
ShadowDecorator() |
Modifier and Type | Method and Description |
---|---|
void |
decorate(MutableClass mutableClass) |
void |
decorateMethodPreClassHandler(MutableClass mutableClass,
org.objectweb.asm.tree.MethodNode originalMethod,
String originalMethodName,
RobolectricGeneratorAdapter generator)
For non-invokedynamic JVMs, generates this code:
|
public void decorate(MutableClass mutableClass)
decorate
in interface ClassInstrumentor.Decorator
public void decorateMethodPreClassHandler(MutableClass mutableClass, org.objectweb.asm.tree.MethodNode originalMethod, String originalMethodName, RobolectricGeneratorAdapter generator)
For non-invokedynamic JVMs, generates this code:
if (__robo_data__ instanceof ThisClass) {
try {
return __robo_data__.$$robo$$originalMethod(params);
} (Throwable t) {
throw RobolectricInternals.cleanStackTrace(t);
}
}
Note that this method is only called by OldClassInstrumentor
.
decorateMethodPreClassHandler
in interface ClassInstrumentor.Decorator