private void instrumentConstructor(MutableClass mutableClass, MethodNode method) {
    """
	Constructors are instrumented as follows:
	# Code other than a call to the superclass constructor is moved to a new method named
	`__constructor__` with the same signature.
	# The constructor is modified to call {@link ClassHandler#initializing(Object)} (or
	{@link ClassHandler#getShadowCreator(Class)} for `invokedynamic` JVMs).
	# The constructor is modified to then call
	{@link ClassHandler#methodInvoked(String, boolean, Class)} (or
	{@link ClassHandler#findShadowMethodHandle(Class, String, MethodType, boolean)} for
	`invokedynamic` JVMs) with the method name `__constructor__` and the same parameter types.
	
	Note that most code in the constructor will not be executed unless the {@link ClassHandler}
	arranges for it to happen.
	
	Given a constructor like this:
	```java
	public ThisClass(String name, int size) {
	super(name, someStaticMethod());
	this.size = size;
	}
	```
	
	... generates code like this:
	```java
	private $$robo$$__constructor__(String name, int size) {
	this.size = size;
	}
	
	private __constructor__(String name, int size) {
	Plan plan = RobolectricInternals.methodInvoked(
	"pkg/ThisClass/__constructor__(Ljava/lang/String;I)V", true, ThisClass.class);
	if (plan != null) {
	try {
	plan.run(this, new Object[] {name, size});
	} catch (Throwable t) {
	throw RobolectricInternals.cleanStackTrace(t);
	}
	} else {
	$$robo$$__constructor__(name, size);
	}
	}
	
	public ThisClass(String name, int size) {
	super(name, someStaticMethod());
	$$robo$init();
	}
	```
	
	@param method the constructor to instrument
    """
    makeMethodPrivate(method);

    if (mutableClass.containsStubs) {
      // method.instructions just throws a `stub!` exception, replace it with something anodyne...
      method.instructions.clear();

      RobolectricGeneratorAdapter generator = new RobolectricGeneratorAdapter(method);
      generator.loadThis();
      generator.visitMethodInsn(Opcodes.INVOKESPECIAL, mutableClass.classNode.superName, "<init>", "()V", false);
      generator.returnValue();
      generator.endMethod();
    }

    InsnList callSuper = extractCallToSuperConstructor(mutableClass, method);
    method.name = directMethodName(mutableClass, ShadowConstants.CONSTRUCTOR_METHOD_NAME);
    mutableClass.addMethod(redirectorMethod(mutableClass, method, ShadowConstants.CONSTRUCTOR_METHOD_NAME));

    String[] exceptions = exceptionArray(method);
    MethodNode initMethodNode = new MethodNode(method.access, "<init>", method.desc, method.signature, exceptions);
    makeMethodPublic(initMethodNode);
    RobolectricGeneratorAdapter generator = new RobolectricGeneratorAdapter(initMethodNode);

    initMethodNode.instructions = callSuper;

    generator.loadThis();
    generator.invokeVirtual(mutableClass.classType, new Method(ROBO_INIT_METHOD_NAME, "()V"));
    generateClassHandlerCall(mutableClass, method, ShadowConstants.CONSTRUCTOR_METHOD_NAME, generator);

    generator.endMethod();
    mutableClass.addMethod(initMethodNode);
  }
private void instrumentConstructor(MutableClass mutableClass, MethodNode method) {
    makeMethodPrivate(method);

    if (mutableClass.containsStubs) {
      // method.instructions just throws a `stub!` exception, replace it with something anodyne...
      method.instructions.clear();

      RobolectricGeneratorAdapter generator = new RobolectricGeneratorAdapter(method);
      generator.loadThis();
      generator.visitMethodInsn(Opcodes.INVOKESPECIAL, mutableClass.classNode.superName, "<init>", "()V", false);
      generator.returnValue();
      generator.endMethod();
    }

    InsnList callSuper = extractCallToSuperConstructor(mutableClass, method);
    method.name = directMethodName(mutableClass, ShadowConstants.CONSTRUCTOR_METHOD_NAME);
    mutableClass.addMethod(redirectorMethod(mutableClass, method, ShadowConstants.CONSTRUCTOR_METHOD_NAME));

    String[] exceptions = exceptionArray(method);
    MethodNode initMethodNode = new MethodNode(method.access, "<init>", method.desc, method.signature, exceptions);
    makeMethodPublic(initMethodNode);
    RobolectricGeneratorAdapter generator = new RobolectricGeneratorAdapter(initMethodNode);

    initMethodNode.instructions = callSuper;

    generator.loadThis();
    generator.invokeVirtual(mutableClass.classType, new Method(ROBO_INIT_METHOD_NAME, "()V"));
    generateClassHandlerCall(mutableClass, method, ShadowConstants.CONSTRUCTOR_METHOD_NAME, generator);

    generator.endMethod();
    mutableClass.addMethod(initMethodNode);
  }
private void instrumentConstructor ( MutableClass mutableClass , MethodNode method ) { makeMethodPrivate ( method ) ; if ( mutableClass . containsStubs ) { // method.instructions just throws a `stub!` exception, replace it with something anodyne... method . instructions . clear ( ) ; RobolectricGeneratorAdapter generator = new RobolectricGeneratorAdapter ( method ) ; generator . loadThis ( ) ; generator . visitMethodInsn ( Opcodes . INVOKESPECIAL , mutableClass . classNode . superName , "<init>" , "()V" , false ) ; generator . returnValue ( ) ; generator . endMethod ( ) ; } InsnList callSuper = extractCallToSuperConstructor ( mutableClass , method ) ; method . name = directMethodName ( mutableClass , ShadowConstants . CONSTRUCTOR_METHOD_NAME ) ; mutableClass . addMethod ( redirectorMethod ( mutableClass , method , ShadowConstants . CONSTRUCTOR_METHOD_NAME ) ) ; String [ ] exceptions = exceptionArray ( method ) ; MethodNode initMethodNode = new MethodNode ( method . access , "<init>" , method . desc , method . signature , exceptions ) ; makeMethodPublic ( initMethodNode ) ; RobolectricGeneratorAdapter generator = new RobolectricGeneratorAdapter ( initMethodNode ) ; initMethodNode . instructions = callSuper ; generator . loadThis ( ) ; generator . invokeVirtual ( mutableClass . classType , new Method ( ROBO_INIT_METHOD_NAME , "()V" ) ) ; generateClassHandlerCall ( mutableClass , method , ShadowConstants . CONSTRUCTOR_METHOD_NAME , generator ) ; generator . endMethod ( ) ; mutableClass . addMethod ( initMethodNode ) ; }
Constructors are instrumented as follows:
# Code other than a call to the superclass constructor is moved to a new method named
`__constructor__` with the same signature.
# The constructor is modified to call {@link ClassHandler#initializing(Object)} (or
{@link ClassHandler#getShadowCreator(Class)} for `invokedynamic` JVMs).
# The constructor is modified to then call
{@link ClassHandler#methodInvoked(String, boolean, Class)} (or
{@link ClassHandler#findShadowMethodHandle(Class, String, MethodType, boolean)} for
`invokedynamic` JVMs) with the method name `__constructor__` and the same parameter types.

Note that most code in the constructor will not be executed unless the {@link ClassHandler}
arranges for it to happen.

Given a constructor like this:
```java
public ThisClass(String name, int size) {
super(name, someStaticMethod());
this.size = size;
}
```

... generates code like this:
```java
private $$robo$$__constructor__(String name, int size) {
this.size = size;
}

private __constructor__(String name, int size) {
Plan plan = RobolectricInternals.methodInvoked(
"pkg/ThisClass/__constructor__(Ljava/lang/String;I)V", true, ThisClass.class);
if (plan != null) {
try {
plan.run(this, new Object[] {name, size});
} catch (Throwable t) {
throw RobolectricInternals.cleanStackTrace(t);
}
} else {
$$robo$$__constructor__(name, size);
}
}

public ThisClass(String name, int size) {
super(name, someStaticMethod());
$$robo$init();
}
```

@param method the constructor to instrument
Constructors are instrumented as follows : # Code other than a call to the superclass constructor is moved to a new method named __constructor__ with the same signature . # The constructor is modified to call { @link ClassHandler#initializing ( Object ) } ( or { @link ClassHandler#getShadowCreator ( Class ) } for invokedynamic JVMs ) . # The constructor is modified to then call { @link ClassHandler#methodInvoked ( String boolean Class ) } ( or { @link ClassHandler#findShadowMethodHandle ( Class String MethodType boolean ) } for invokedynamic JVMs ) with the method name __constructor__ and the same parameter types .