mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-26 19:06:24 +07:00
"java.lang.Object" ->CommonClassNames.JAVA_LANG_OBJECT
This commit is contained in:
@@ -405,7 +405,7 @@ public class ClsRepositoryUseTest extends PsiTestCase{
|
||||
LOG.assertTrue(type instanceof PsiArrayType);
|
||||
PsiType componentType = ((PsiArrayType) type).getComponentType();
|
||||
|
||||
assertTrue(componentType.equalsToText("java.lang.Object"));
|
||||
assertTrue(componentType.equalsToText(CommonClassNames.JAVA_LANG_OBJECT));
|
||||
assertEquals("Object", componentType.getPresentableText());
|
||||
assertFalse(componentType instanceof PsiPrimitiveType);
|
||||
assertFalse(componentType instanceof PsiArrayType);
|
||||
@@ -424,7 +424,7 @@ public class ClsRepositoryUseTest extends PsiTestCase{
|
||||
PsiType type2 = ((PsiArrayType) field2.getType()).getComponentType();
|
||||
assertTrue(type2 instanceof PsiClassType);
|
||||
|
||||
assertTrue(type2.equalsToText("java.lang.Object"));
|
||||
assertTrue(type2.equalsToText(CommonClassNames.JAVA_LANG_OBJECT));
|
||||
assertEquals("Object", type2.getPresentableText());
|
||||
}
|
||||
|
||||
@@ -436,7 +436,7 @@ public class ClsRepositoryUseTest extends PsiTestCase{
|
||||
PsiType type1 = aClass.getFields()[1].getType();
|
||||
PsiElement target1 = PsiUtil.resolveClassInType(type1);
|
||||
assertNotNull(target1);
|
||||
PsiClass objectClass = myJavaFacade.findClasses("java.lang.Object", RESOLVE_SCOPE)[1];
|
||||
PsiClass objectClass = myJavaFacade.findClasses(CommonClassNames.JAVA_LANG_OBJECT, RESOLVE_SCOPE)[1];
|
||||
assertEquals(objectClass, target1);
|
||||
}
|
||||
|
||||
@@ -518,12 +518,12 @@ public class ClsRepositoryUseTest extends PsiTestCase{
|
||||
|
||||
PsiType type2 = parameters[1].getType();
|
||||
assertEquals("Object", type2.getPresentableText());
|
||||
assertTrue(type2.equalsToText("java.lang.Object"));
|
||||
assertTrue(type2.equalsToText(CommonClassNames.JAVA_LANG_OBJECT));
|
||||
assertFalse(type2 instanceof PsiArrayType);
|
||||
assertFalse(type2 instanceof PsiPrimitiveType);
|
||||
PsiClass target2 = PsiUtil.resolveClassInType(type2);
|
||||
assertNotNull(target2);
|
||||
PsiClass objectClass = myJavaFacade.findClasses("java.lang.Object", RESOLVE_SCOPE)[1];
|
||||
PsiClass objectClass = myJavaFacade.findClasses(CommonClassNames.JAVA_LANG_OBJECT, RESOLVE_SCOPE)[1];
|
||||
assertEquals(objectClass, target2);
|
||||
|
||||
parameters[0].getModifierList();
|
||||
|
||||
@@ -88,7 +88,7 @@ public class SrcRepositoryUseTest extends PsiTestCase{
|
||||
assertEquals(params[1].getName(), "B");
|
||||
|
||||
assertEquals("java.lang.String", params[0].getSupers()[0].getQualifiedName());
|
||||
assertEquals("java.lang.Object", params[1].getSupers()[0].getQualifiedName());
|
||||
assertEquals(CommonClassNames.JAVA_LANG_OBJECT, params[1].getSupers()[0].getQualifiedName());
|
||||
|
||||
teardownLoadingFilter();
|
||||
}
|
||||
@@ -381,7 +381,7 @@ public class SrcRepositoryUseTest extends PsiTestCase{
|
||||
LOG.assertTrue(type instanceof PsiArrayType);
|
||||
PsiType componentType = ((PsiArrayType) type).getComponentType();
|
||||
|
||||
assertTrue(componentType.equalsToText("java.lang.Object"));
|
||||
assertTrue(componentType.equalsToText(CommonClassNames.JAVA_LANG_OBJECT));
|
||||
assertFalse(componentType instanceof PsiPrimitiveType);
|
||||
assertFalse(componentType instanceof PsiArrayType);
|
||||
|
||||
@@ -403,7 +403,7 @@ public class SrcRepositoryUseTest extends PsiTestCase{
|
||||
|
||||
PsiField field3 = aClass.getFields()[2];
|
||||
PsiType type3 = ((PsiArrayType) field3.getType()).getComponentType();
|
||||
assertTrue(type3.equalsToText("java.lang.Object"));
|
||||
assertTrue(type3.equalsToText(CommonClassNames.JAVA_LANG_OBJECT));
|
||||
|
||||
teardownLoadingFilter();
|
||||
}
|
||||
@@ -443,7 +443,7 @@ public class SrcRepositoryUseTest extends PsiTestCase{
|
||||
PsiType type1 = aClass.getFields()[1].getType();
|
||||
PsiElement target1 = PsiUtil.resolveClassInType(type1);
|
||||
assertNotNull(target1);
|
||||
PsiClass objectClass = myJavaFacade.findClass("java.lang.Object", GlobalSearchScope.allScope(myProject));
|
||||
PsiClass objectClass = myJavaFacade.findClass(CommonClassNames.JAVA_LANG_OBJECT, GlobalSearchScope.allScope(myProject));
|
||||
assertEquals(objectClass, target1);
|
||||
|
||||
PsiType type2 = aClass.getFields()[1].getType();
|
||||
@@ -525,7 +525,7 @@ public class SrcRepositoryUseTest extends PsiTestCase{
|
||||
assertFalse(type2 instanceof PsiPrimitiveType);
|
||||
PsiClass target2 = PsiUtil.resolveClassInType(type2);
|
||||
assertNotNull(target2);
|
||||
PsiClass objectClass = myJavaFacade.findClass("java.lang.Object", GlobalSearchScope.allScope(myProject));
|
||||
PsiClass objectClass = myJavaFacade.findClass(CommonClassNames.JAVA_LANG_OBJECT, GlobalSearchScope.allScope(myProject));
|
||||
assertEquals(objectClass, target2);
|
||||
|
||||
checkPackAAA(parms[2].getType());
|
||||
|
||||
@@ -30,7 +30,7 @@ public class ResolveMethod15Test extends Resolve15TestCase {
|
||||
assertNotNull(element);
|
||||
assertThat(element, instanceOf(PsiMethod.class));
|
||||
final PsiMethod method = (PsiMethod)element;
|
||||
assertEquals("java.lang.Object", method.getContainingClass().getQualifiedName());
|
||||
assertEquals(CommonClassNames.JAVA_LANG_OBJECT, method.getContainingClass().getQualifiedName());
|
||||
}
|
||||
|
||||
public void testStaticImportDirect() throws Exception {
|
||||
|
||||
@@ -180,7 +180,7 @@ public class ResolveMethodTest extends ResolveTestCase {
|
||||
assertTrue(target instanceof PsiMethod);
|
||||
final PsiMethod method = (PsiMethod)target;
|
||||
assertEquals("clone", method.getName());
|
||||
assertEquals("java.lang.Object", method.getContainingClass().getQualifiedName());
|
||||
assertEquals(CommonClassNames.JAVA_LANG_OBJECT, method.getContainingClass().getQualifiedName());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ public class TypeInferenceTest extends Resolve15TestCase {
|
||||
assertTrue(type instanceof PsiClassType);
|
||||
PsiType[] paramTypes = ((PsiClassType)type).getParameters();
|
||||
assertEquals(1, paramTypes.length);
|
||||
assertEquals( "java.lang.Object", paramTypes[0].getCanonicalText());
|
||||
assertEquals(CommonClassNames.JAVA_LANG_OBJECT, paramTypes[0].getCanonicalText());
|
||||
}
|
||||
|
||||
public void testInferInAssign1 () throws Exception {
|
||||
@@ -31,7 +31,7 @@ public class TypeInferenceTest extends Resolve15TestCase {
|
||||
assertTrue(type instanceof PsiClassType);
|
||||
PsiType[] paramTypes = ((PsiClassType)type).getParameters();
|
||||
assertEquals(1, paramTypes.length);
|
||||
assertEquals( "java.lang.Object", paramTypes[0].getCanonicalText());
|
||||
assertEquals(CommonClassNames.JAVA_LANG_OBJECT, paramTypes[0].getCanonicalText());
|
||||
}
|
||||
|
||||
public void testInferInCast () throws Exception {
|
||||
@@ -40,7 +40,7 @@ public class TypeInferenceTest extends Resolve15TestCase {
|
||||
assertTrue(type instanceof PsiClassType);
|
||||
PsiType[] paramTypes = ((PsiClassType)type).getParameters();
|
||||
assertEquals(1, paramTypes.length);
|
||||
assertEquals( "java.lang.Object", paramTypes[0].getCanonicalText());
|
||||
assertEquals(CommonClassNames.JAVA_LANG_OBJECT, paramTypes[0].getCanonicalText());
|
||||
}
|
||||
|
||||
public void testInferWithBounds () throws Exception {
|
||||
@@ -65,7 +65,7 @@ public class TypeInferenceTest extends Resolve15TestCase {
|
||||
}
|
||||
|
||||
public void testInferRawType () throws Exception {
|
||||
checkResolvesTo("java.lang.Object");
|
||||
checkResolvesTo(CommonClassNames.JAVA_LANG_OBJECT);
|
||||
}
|
||||
|
||||
private void checkResolvesTo(@NonNls String typeName) throws Exception {
|
||||
@@ -144,7 +144,7 @@ public class TypeInferenceTest extends Resolve15TestCase {
|
||||
}
|
||||
|
||||
public void testInferUnchecked () throws Exception {
|
||||
checkResolvesTo("java.lang.Object");
|
||||
checkResolvesTo(CommonClassNames.JAVA_LANG_OBJECT);
|
||||
}
|
||||
|
||||
public void testInferNotNull () throws Exception {
|
||||
|
||||
@@ -97,7 +97,7 @@ public class UpdateCacheTest extends PsiTestCase{
|
||||
file = (PsiFile)root.add(file);
|
||||
assertNotNull(file);
|
||||
|
||||
PsiClass objectClass = myJavaFacade.findClass("java.lang.Object", GlobalSearchScope.allScope(getProject()));
|
||||
PsiClass objectClass = myJavaFacade.findClass(CommonClassNames.JAVA_LANG_OBJECT, GlobalSearchScope.allScope(getProject()));
|
||||
assertNotNull(objectClass);
|
||||
checkUsages(objectClass, new String[]{"New.java"});
|
||||
}
|
||||
@@ -111,7 +111,7 @@ public class UpdateCacheTest extends PsiTestCase{
|
||||
assertNotNull(file);
|
||||
PsiDocumentManager.getInstance(myProject).commitAllDocuments();
|
||||
|
||||
PsiClass objectClass = myJavaFacade.findClass("java.lang.Object", GlobalSearchScope.allScope(getProject()));
|
||||
PsiClass objectClass = myJavaFacade.findClass(CommonClassNames.JAVA_LANG_OBJECT, GlobalSearchScope.allScope(getProject()));
|
||||
assertNotNull(objectClass);
|
||||
checkUsages(objectClass, new String[]{"New.java"});
|
||||
}
|
||||
@@ -136,7 +136,7 @@ public class UpdateCacheTest extends PsiTestCase{
|
||||
VfsUtil.saveText(file, "class A{ Object o;}");
|
||||
PsiDocumentManager.getInstance(myProject).commitAllDocuments();
|
||||
|
||||
PsiClass objectClass = myJavaFacade.findClass("java.lang.Object", GlobalSearchScope.allScope(getProject()));
|
||||
PsiClass objectClass = myJavaFacade.findClass(CommonClassNames.JAVA_LANG_OBJECT, GlobalSearchScope.allScope(getProject()));
|
||||
assertNotNull(objectClass);
|
||||
checkUsages(objectClass, new String[]{"1.java"});
|
||||
}
|
||||
@@ -149,7 +149,7 @@ public class UpdateCacheTest extends PsiTestCase{
|
||||
public void testExternalFileModificationWhileProjectClosed() throws Exception {
|
||||
VirtualFile root = ProjectRootManager.getInstance(myProject).getContentRoots()[0];
|
||||
|
||||
PsiClass objectClass = myJavaFacade.findClass("java.lang.Object", GlobalSearchScope.allScope(getProject()));
|
||||
PsiClass objectClass = myJavaFacade.findClass(CommonClassNames.JAVA_LANG_OBJECT, GlobalSearchScope.allScope(getProject()));
|
||||
assertNotNull(objectClass);
|
||||
checkUsages(objectClass, new String[]{});
|
||||
FileBasedIndex.getInstance().getContainingFiles(TodoIndex.NAME, new TodoIndexEntry("todo", true), GlobalSearchScope.allScope(getProject()));
|
||||
@@ -183,7 +183,7 @@ public class UpdateCacheTest extends PsiTestCase{
|
||||
myPsiManager = (PsiManagerImpl) PsiManager.getInstance(myProject);
|
||||
myJavaFacade = (JavaPsiFacadeImpl) JavaPsiFacade.getInstance(myProject);
|
||||
|
||||
objectClass = myJavaFacade.findClass("java.lang.Object", GlobalSearchScope.allScope(getProject()));
|
||||
objectClass = myJavaFacade.findClass(CommonClassNames.JAVA_LANG_OBJECT, GlobalSearchScope.allScope(getProject()));
|
||||
assertNotNull(objectClass);
|
||||
checkUsages(objectClass, new String[]{"1.java"});
|
||||
}
|
||||
@@ -198,7 +198,7 @@ public class UpdateCacheTest extends PsiTestCase{
|
||||
assertNotNull(file);
|
||||
PsiDocumentManager.getInstance(myProject).commitAllDocuments();
|
||||
|
||||
PsiClass objectClass = myJavaFacade.findClass("java.lang.Object", GlobalSearchScope.allScope(getProject()));
|
||||
PsiClass objectClass = myJavaFacade.findClass(CommonClassNames.JAVA_LANG_OBJECT, GlobalSearchScope.allScope(getProject()));
|
||||
assertNotNull(objectClass);
|
||||
checkUsages(objectClass, new String[]{"New.java"});
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ public class IntroduceConstantTest extends LightCodeInsightTestCase {
|
||||
}
|
||||
|
||||
public void testResultedType() throws Exception {
|
||||
checkDefaultType("java.lang.Object");
|
||||
checkDefaultType(CommonClassNames.JAVA_LANG_OBJECT);
|
||||
}
|
||||
|
||||
public void testResultedTypeWhenNonLocal() throws Exception {
|
||||
|
||||
@@ -42,7 +42,7 @@ public class IntroduceVariableTest extends LightCodeInsightTestCase {
|
||||
}
|
||||
|
||||
public void testIDEADEV3678() throws Exception {
|
||||
doTest(new MockIntroduceVariableHandler("component", true, true, true, "java.lang.Object"));
|
||||
doTest(new MockIntroduceVariableHandler("component", true, true, true, CommonClassNames.JAVA_LANG_OBJECT));
|
||||
}
|
||||
|
||||
public void testIDEADEV13369() throws Exception {
|
||||
@@ -66,7 +66,7 @@ public class IntroduceVariableTest extends LightCodeInsightTestCase {
|
||||
}
|
||||
|
||||
public void testMethodCall() throws Exception {
|
||||
doTest(new MockIntroduceVariableHandler("temp", true, true, true, "java.lang.Object"));
|
||||
doTest(new MockIntroduceVariableHandler("temp", true, true, true, CommonClassNames.JAVA_LANG_OBJECT));
|
||||
}
|
||||
|
||||
public void testMethodCallInSwitch() throws Exception {
|
||||
@@ -114,7 +114,7 @@ public class IntroduceVariableTest extends LightCodeInsightTestCase {
|
||||
}
|
||||
|
||||
public void testSCR22718() throws Exception {
|
||||
doTest(new MockIntroduceVariableHandler("object", true, true, false, "java.lang.Object"));
|
||||
doTest(new MockIntroduceVariableHandler("object", true, true, false, CommonClassNames.JAVA_LANG_OBJECT));
|
||||
}
|
||||
|
||||
public void testSCR26075() throws Exception {
|
||||
@@ -315,7 +315,7 @@ public class IntroduceVariableTest extends LightCodeInsightTestCase {
|
||||
}
|
||||
|
||||
public void testBeforeVoidStatement() throws Exception {
|
||||
doTest(new MockIntroduceVariableHandler("c", false, false, false, "java.lang.Object"));
|
||||
doTest(new MockIntroduceVariableHandler("c", false, false, false, CommonClassNames.JAVA_LANG_OBJECT));
|
||||
}
|
||||
|
||||
private void doTest(IntroduceVariableBase testMe) throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user