mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Cleanup (arrangement)
This commit is contained in:
+5
-6
@@ -34,7 +34,6 @@ import com.intellij.psi.util.TypeConversionUtil;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import com.intellij.util.containers.HashMap;
|
||||
import org.jetbrains.annotations.Contract;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -331,11 +330,6 @@ public class ClsJavaCodeReferenceElementImpl extends ClsElementImpl implements P
|
||||
}
|
||||
}
|
||||
|
||||
@NonNls
|
||||
public String toString() {
|
||||
return "PsiJavaCodeReferenceElement:" + getText();
|
||||
}
|
||||
|
||||
@Override
|
||||
public TextRange getRangeInElement() {
|
||||
return new TextRange(0, getTextLength());
|
||||
@@ -361,4 +355,9 @@ public class ClsJavaCodeReferenceElementImpl extends ClsElementImpl implements P
|
||||
public PsiElement getQualifier() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "PsiJavaCodeReferenceElement:" + getText();
|
||||
}
|
||||
}
|
||||
@@ -51,15 +51,26 @@ public class ClsStubBuilderTest extends LightIdeaTestCase {
|
||||
doTest(clsFile, getTestName(false) + ".txt");
|
||||
}
|
||||
|
||||
private void doTest() {
|
||||
String clsFilePath = JavaTestUtil.getJavaTestDataPath() + "/psi/cls/stubBuilder/" + getTestName(false) + ".class";
|
||||
VirtualFile clsFile = LocalFileSystem.getInstance().findFileByPath(clsFilePath);
|
||||
private void doTest(String className) {
|
||||
VirtualFile clsFile = findFile(className);
|
||||
assertNotNull(clsFile);
|
||||
doTest(clsFile, getTestName(false) + ".txt");
|
||||
}
|
||||
|
||||
private void doTest(String className) {
|
||||
VirtualFile clsFile = findFile(className);
|
||||
private VirtualFile findFile(final String className) {
|
||||
final VirtualFile[] roots = getProjectJDK().getRootProvider().getFiles(OrderRootType.CLASSES);
|
||||
for (VirtualFile root : roots) {
|
||||
VirtualFile vFile = root.findFileByRelativePath(className);
|
||||
if (vFile != null) return vFile;
|
||||
}
|
||||
|
||||
fail("Cannot file class file for: " + className);
|
||||
return null;
|
||||
}
|
||||
|
||||
private void doTest() {
|
||||
String clsFilePath = JavaTestUtil.getJavaTestDataPath() + "/psi/cls/stubBuilder/" + getTestName(false) + ".class";
|
||||
VirtualFile clsFile = LocalFileSystem.getInstance().findFileByPath(clsFilePath);
|
||||
assertNotNull(clsFile);
|
||||
doTest(clsFile, getTestName(false) + ".txt");
|
||||
}
|
||||
@@ -85,15 +96,4 @@ public class ClsStubBuilderTest extends LightIdeaTestCase {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private VirtualFile findFile(final String className) {
|
||||
final VirtualFile[] roots = getProjectJDK().getRootProvider().getFiles(OrderRootType.CLASSES);
|
||||
for (VirtualFile root : roots) {
|
||||
VirtualFile vFile = root.findFileByRelativePath(className);
|
||||
if (vFile != null) return vFile;
|
||||
}
|
||||
|
||||
fail("Cannot file class file for: " + className);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user