static MethodHandle linkMethodHandleConstant(Class<?> callerClass,int refKind,Class<?> defc,String name,Object type){
  try {
    Lookup lookup=IMPL_LOOKUP.in(callerClass);
    assert (refKindIsValid(refKind));
    return lookup.linkMethodHandleConstant((byte)refKind,defc,name,type);
  }
 catch (  IllegalAccessException ex) {
    Throwable cause=ex.getCause();
    if (cause instanceof AbstractMethodError) {
      throw (AbstractMethodError)cause;
    }
 else {
      Error err=new IllegalAccessError(ex.getMessage());
      throw initCauseFrom(err,ex);
    }
  }
catch (  NoSuchMethodException ex) {
    Error err=new NoSuchMethodError(ex.getMessage());
    throw initCauseFrom(err,ex);
  }
catch (  NoSuchFieldException ex) {
    Error err=new NoSuchFieldError(ex.getMessage());
    throw initCauseFrom(err,ex);
  }
catch (  ReflectiveOperationException ex) {
    Error err=new IncompatibleClassChangeError();
    throw initCauseFrom(err,ex);
  }
}

static MethodHandle linkMethodHandleConstant ( Class < ? > callerClass , int refKind , Class < ? > defc , String name , Object type ) { try { Lookup lookup = IMPL_LOOKUP . in ( callerClass ) ; assert ( refKindIsValid ( refKind ) ) ; return lookup . linkMethodHandleConstant ( ( byte ) refKind , defc , name , type ) ; } catch ( IllegalAccessException ex ) { Throwable cause = ex . getCause ( ) ; if ( cause instanceof AbstractMethodError ) { throw ( AbstractMethodError ) cause ; } else { Error err = new IllegalAccessError ( ex . getMessage ( ) ) ; throw initCauseFrom ( err , ex ) ; } } catch ( NoSuchMethodException ex ) { Error err = new NoSuchMethodError ( ex . getMessage ( ) ) ; throw initCauseFrom ( err , ex ) ; } catch ( NoSuchFieldException ex ) { Error err = new NoSuchFieldError ( ex . getMessage ( ) ) ; throw initCauseFrom ( err , ex ) ; } catch ( ReflectiveOperationException ex ) { Error err = new IncompatibleClassChangeError ( ) ; throw initCauseFrom ( err , ex ) ; } }
the jvm is resolving a constant_methodhandle cp entry . and it wants our help . it will make an up - call to this method . ( do not change the name or signature . ) the type argument is a class for field requests and a methodtype for non - fields . < p > recent versions of the jvm may also pass a resolved membername for the type . in that case , the name is ignored and may be null .
