当前位置: 首页>>代码示例>>Java>>正文


Java InvocationException.exception方法代码示例

本文整理汇总了Java中com.sun.jdi.InvocationException.exception方法的典型用法代码示例。如果您正苦于以下问题:Java InvocationException.exception方法的具体用法?Java InvocationException.exception怎么用?Java InvocationException.exception使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.sun.jdi.InvocationException的用法示例。


在下文中一共展示了InvocationException.exception方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setValueToFinalField

import com.sun.jdi.InvocationException; //导入方法依赖的package包/类
private static void setValueToFinalField(ObjectReference obj, String name, ClassType clazz, Value fv, VirtualMachine vm, ThreadReference thread) throws InternalExceptionWrapper, VMDisconnectedExceptionWrapper, ClassNotPreparedExceptionWrapper, ClassNotLoadedException, ObjectCollectedExceptionWrapper, IncompatibleThreadStateException, UnsupportedOperationExceptionWrapper, InvalidTypeException, InvalidObjectException {
    ObjectReference fieldRef = getDeclaredOrInheritedField(clazz, name, vm, thread);
    if (fieldRef == null) {
        InvalidObjectException ioex = new InvalidObjectException("No field "+name+" of class "+clazz);
        throw ioex;
    }
    // field.setAccessible(true);
    ClassType fieldClassType = (ClassType) ValueWrapper.type(fieldRef);
    com.sun.jdi.Method setAccessibleMethod = ClassTypeWrapper.concreteMethodByName(
            fieldClassType, "setAccessible", "(Z)V");
    try {
        ObjectReferenceWrapper.invokeMethod(fieldRef, thread, setAccessibleMethod,
                                            Collections.singletonList(vm.mirrorOf(true)),
                                            ClassType.INVOKE_SINGLE_THREADED);
        // field.set(newInstance, fv);
        com.sun.jdi.Method setMethod = ClassTypeWrapper.concreteMethodByName(
                fieldClassType, "set", "(Ljava/lang/Object;Ljava/lang/Object;)V");
        if (fv instanceof PrimitiveValue) {
            PrimitiveType pt = (PrimitiveType) ValueWrapper.type(fv);
            ReferenceType fieldBoxingClass = EvaluatorVisitor.adjustBoxingType(clazz, pt, null);
            fv = EvaluatorVisitor.box((PrimitiveValue) fv, fieldBoxingClass, thread, null);
        }
        List<Value> args = Arrays.asList(new Value[] { obj, fv });
        ObjectReferenceWrapper.invokeMethod(fieldRef, thread, setMethod,
                                            args,
                                            ClassType.INVOKE_SINGLE_THREADED);
    } catch (InvocationException iex) {
        throw new InvalidObjectException(
                "Problem setting value "+fv+" to field "+name+" of class "+clazz+
                " : "+iex.exception());
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:33,代码来源:VariableMirrorTranslator.java

示例2: EvaluateException

import com.sun.jdi.InvocationException; //导入方法依赖的package包/类
public EvaluateException(String msg, Throwable th) {
  super(msg, th);
  if (th instanceof EvaluateException) {
    myTargetException = ((EvaluateException)th).getExceptionFromTargetVM();
  }
  else if(th instanceof InvocationException){
    InvocationException invocationException = (InvocationException) th;
    myTargetException = invocationException.exception();
  }
  if (LOG.isDebugEnabled()) {
    LOG.debug(msg);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:EvaluateException.java

示例3: InvocationExceptionTranslated

import com.sun.jdi.InvocationException; //导入方法依赖的package包/类
public InvocationExceptionTranslated(InvocationException iex, JPDADebuggerImpl debugger) {
    this(iex.getMessage(), iex.exception(), debugger);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:4,代码来源:InvocationExceptionTranslated.java


注:本文中的com.sun.jdi.InvocationException.exception方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。