private static VmResourceId getVmResourceId(Object object) throws CoreException {
if (object instanceof Script) {
Script script = (Script) object;
return VmResourceId.forScript(script);
} else if (object instanceof StackFrame) {
StackFrame jsStackFrame = (StackFrame) object;
return jsStackFrame.getVmResourceId();
} else if (object instanceof Breakpoint) {
Breakpoint breakpoint = (Breakpoint) object;
return breakpoint.getTarget().accept(BREAKPOINT_RESOURCE_VISITOR);
} else if (object instanceof VmResourceId) {
VmResourceId resourceId = (VmResourceId) object;