SourcePosition (@NotNull NodeDescriptor descriptor, @NotNull Project project, @NotNull DebuggerContextImpl context, boolean nearest) { StackFrameProxyImpl frame = context.getFrameProxy(); if (frame == null) { return null; } if (descriptor instanceof FieldDescriptor) { return getSourcePositionForField((FieldDescriptor)descriptor, project, context, nearest); } else if (descriptor instanceof LocalVariableDescriptor) { return getSourcePositionForLocalVariable(descriptor.getName(), project, context, nearest); } else if (descriptor instanceof ArgumentValueDescriptorImpl) { Collection<String> names = ((ArgumentValueDescriptorImpl)descriptor).getVariable().getMatchedNames(); if (!names.isEmpty()) { return getSourcePositionForLocalVariable(names.iterator().next(), project, context, nearest); } } else if (descriptor instanceof MethodReturnValueDescriptorImpl) { DebugProcessImpl debugProcess = context.getDebugProcess(); if (debugProcess != null) { return debugProcess.getPositionManager().getSourcePosition(((MethodReturnValueDescriptorImpl)descriptor).getMethod().location()); } } return null; }