public static VmField resolveField(VmMethod currentMethod,
VmConstFieldRef fieldRef, boolean isStatic) {
if (!fieldRef.getConstClass().isResolved()) {
resolveClass(fieldRef.getConstClass());
}
VmField result;
if (fieldRef.isResolved()) {
result = fieldRef.getResolvedVmField();
} else {
VmType<?> vmClass = fieldRef.getConstClass().getResolvedVmClass();
vmClass.link();
VmField field = vmClass.getField(fieldRef);
if (field == null) {
throw new NoSuchFieldError();
}
fieldRef.setResolvedVmField(field);