private static void throwAbstractMethodError(
      Code code,
      Method method,
      Local<String> abstractMethodErrorMessage,
      Local<AbstractMethodError> abstractMethodError) {
    TypeId<AbstractMethodError> abstractMethodErrorClass = TypeId.get(AbstractMethodError.class);

    MethodId<AbstractMethodError, Void> abstractMethodErrorConstructor =
        abstractMethodErrorClass.getConstructor(TypeId.STRING);
    code.loadConstant(abstractMethodErrorMessage, "'" + method + "' cannot be called");
    code.newInstance(
        abstractMethodError, abstractMethodErrorConstructor, abstractMethodErrorMessage);

    code.throwValue(abstractMethodError);
  }
Add

<pre>
    abstractMethodErrorMessage = method + " cannot be called";
    abstractMethodError = new AbstractMethodError(abstractMethodErrorMessage);
    throw abstractMethodError;
</pre>

<p>to the {@code code}.

@param code The code to add to
@param method The method that is abstract
@param abstractMethodErrorMessage The {@link Local} to store the error message
@param abstractMethodError The {@link Local} to store the error object
android/android_framework/dex-maker/src/main/java/com/android/dx/stock/ProxyBuilder.java