PsiFile (ClsClassImpl psiClass) { String sourceFileName = psiClass.getSourceFileName(); String packageName = ((PsiClassOwner)psiClass.getContainingFile()).getPackageName(); String relativePath = packageName.isEmpty() ? sourceFileName : packageName.replace('.', '/') + '/' + sourceFileName; Sdk alternativeJre = myDebugProcess.getSession().getAlternativeJre(); if (alternativeJre != null) { for (VirtualFile file : AlternativeJreClassFinder.getSourceRoots(alternativeJre)) { VirtualFile source = file.findFileByRelativePath(relativePath); if (source != null && source.isValid()) { PsiFile psiSource = psiClass.getManager().findFile(source); if (psiSource instanceof PsiClassOwner) { return psiSource; } } } } return null; }