ReferenceType (ReferenceType fromClass, final GroovyPsiElement toFind, SourcePosition classPosition) { final VirtualMachineProxy vmProxy = myDebugProcess.getVirtualMachineProxy(); if (fromClass.isPrepared()) { final List<ReferenceType> nestedTypes = vmProxy.nestedTypes(fromClass); for (ReferenceType nested : nestedTypes) { final ReferenceType found = findNested(nested, toFind, classPosition); if (found != null) { return found; } } try { final int lineNumber = classPosition.getLine() + 1; if (!DebuggerUtilsAsync.locationsOfLineSync(fromClass, lineNumber).isEmpty()) { return fromClass; } //noinspection LoopStatementThatDoesntLoop for (Location location : fromClass.allLineLocations()) { final SourcePosition candidateFirstPosition = SourcePosition.createFromLine( toFind.getContainingFile(), location.lineNumber() - 1 ); if (toFind.equals(findReferenceTypeSourceImage(candidateFirstPosition))) { return fromClass; } break; // isApplicable only the first location } } catch (AbsentInformationException ignored) { } } return null; }