String (DebugProcessImpl debugProcess, @Nullable SourcePosition position) { if (position == null) { return null; } Pair<String, Boolean> res = ReadAction.compute(() -> { final PsiFile positionFile = position.getFile(); if (positionFile instanceof JspFile) { return Pair.create(positionFile.getName(), false); } final PsiClass psiClass = getClassAt(position); if (psiClass != null) { final String qName = psiClass.getQualifiedName(); if (qName != null) { return Pair.create(qName, false); } } if (psiClass == null) { if (positionFile instanceof PsiClassOwner) { return Pair.create(positionFile.getName(), true); } return Pair.create(JavaDebuggerBundle.message("string.file.line.position", positionFile.getName(), position.getLine()), true); } return Pair.create(calcClassDisplayName(psiClass), true); }); if (res.second && debugProcess != null && debugProcess.isAttached()) { List<ReferenceType> allClasses = debugProcess.getPositionManager().getAllClasses(position); if (!allClasses.isEmpty()) { return allClasses.get(0).name(); } } return res.first; }