本文整理汇总了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());
}
}
示例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);
}
}
示例3: InvocationExceptionTranslated
import com.sun.jdi.InvocationException; //导入方法依赖的package包/类
public InvocationExceptionTranslated(InvocationException iex, JPDADebuggerImpl debugger) {
this(iex.getMessage(), iex.exception(), debugger);
}