void (DebugProcessImpl process) { final RequestManagerImpl requestsManager = process.getRequestsManager(); ClassPrepareRequestor requestor = new ClassPrepareRequestor() { @Override public void processClassPrepare(DebugProcess debuggerProcess, ReferenceType referenceType) { try { requestsManager.deleteRequest(this); ((ClassType)referenceType).setValue(referenceType.fieldByName("DEBUG"), process.getVirtualMachineProxy().mirrorOf(true)); } catch (Exception e) { LOG.warn("Error setting agent debug mode", e); } } }; requestsManager.callbackOnPrepareClasses(requestor, CAPTURE_STORAGE_CLASS_NAME); try { ClassType captureClass = (ClassType)process.findClass(null, CAPTURE_STORAGE_CLASS_NAME, null); if (captureClass != null) { requestor.processClassPrepare(process, captureClass); } } catch (Exception e) { LOG.warn("Error setting agent debug mode", e); } }