我正在尝试运行JPF并遇到以下空指针异常。
java.lang.NullPointerException at gov.nasa.jpf.vm.ThreadInfo$StackTraceElement.createJPFStackTraceElement(ThreadInfo.java:1671)
对应的代码是:
int createJPFStackTraceElement() {
if (ignore) {
return MJIEnv.NULL;
} else {
Heap heap = vm.getHeap();
ClassInfo ci = ClassLoaderInfo.getSystemResolvedClassInfo("java.lang.StackTraceElement");
ElementInfo ei = heap.newObject(ci, ThreadInfo.this);
ei.setReferenceField("clsName", heap.newString(clsName, ThreadInfo.this).getObjectRef());
ei.setReferenceField("mthName", heap.newString(mthName, ThreadInfo.this).getObjectRef());
ei.setReferenceField("fileName", heap.newString(fileName, ThreadInfo.this).getObjectRef()); //line 1671
ei.setIntField("line", line);
return ei.getObjectRef();
}
}
答案 0 :(得分:0)
有两种方式