get rid of JdkNames
This commit is contained in:
+7
-5
@@ -64,7 +64,9 @@ import static org.jetbrains.jet.lang.resolve.DescriptorUtils.getClassObjectName;
|
||||
* @author abreslav
|
||||
*/
|
||||
public class JavaDescriptorResolver implements DependencyClassByQualifiedNameResolver {
|
||||
|
||||
|
||||
private static final FqName OBJECT_FQ_NAME = new FqName("java.lang.Object");
|
||||
|
||||
public static final Name JAVA_ROOT = Name.special("<java_root>");
|
||||
|
||||
public static final ModuleDescriptor FAKE_ROOT_MODULE = new ModuleDescriptor(JAVA_ROOT);
|
||||
@@ -305,7 +307,7 @@ public class JavaDescriptorResolver implements DependencyClassByQualifiedNameRes
|
||||
|
||||
@Nullable
|
||||
private ClassDescriptor resolveJavaLangObject() {
|
||||
ClassDescriptor clazz = resolveClass(JdkNames.JL_OBJECT.getFqName(), DescriptorSearchRule.IGNORE_IF_FOUND_IN_KOTLIN);
|
||||
ClassDescriptor clazz = resolveClass(OBJECT_FQ_NAME, DescriptorSearchRule.IGNORE_IF_FOUND_IN_KOTLIN);
|
||||
if (clazz == null) {
|
||||
// TODO: warning
|
||||
}
|
||||
@@ -641,7 +643,7 @@ public class JavaDescriptorResolver implements DependencyClassByQualifiedNameRes
|
||||
static boolean isJavaLangObject(JetType type) {
|
||||
ClassifierDescriptor classifierDescriptor = type.getConstructor().getDeclarationDescriptor();
|
||||
return classifierDescriptor instanceof ClassDescriptor &&
|
||||
DescriptorUtils.getFQName(classifierDescriptor).equalsTo(JdkNames.JL_OBJECT.getFqName());
|
||||
DescriptorUtils.getFQName(classifierDescriptor).equalsTo(OBJECT_FQ_NAME);
|
||||
}
|
||||
|
||||
|
||||
@@ -715,7 +717,7 @@ public class JavaDescriptorResolver implements DependencyClassByQualifiedNameRes
|
||||
|
||||
if (result.isEmpty()) {
|
||||
if (classData.kotlin
|
||||
|| JdkNames.JL_OBJECT.getFqName().equalsTo(psiClass.getQualifiedName())
|
||||
|| OBJECT_FQ_NAME.equalsTo(psiClass.getQualifiedName())
|
||||
// TODO: annotations
|
||||
|| classDescriptor.getKind() == ClassKind.ANNOTATION_CLASS) {
|
||||
result.add(JetStandardClasses.getAnyType());
|
||||
@@ -1498,7 +1500,7 @@ public class JavaDescriptorResolver implements DependencyClassByQualifiedNameRes
|
||||
if (scopeData.kotlin) {
|
||||
// TODO: unless maybe class explicitly extends Object
|
||||
String ownerClassName = method.getPsiMethod().getContainingClass().getQualifiedName();
|
||||
if (JdkNames.JL_OBJECT.getFqName().getFqName().equals(ownerClassName)) {
|
||||
if (OBJECT_FQ_NAME.getFqName().equals(ownerClassName)) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2012 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.jet.lang.resolve.java;
|
||||
|
||||
/**
|
||||
* @author Stepan Koltsov
|
||||
*/
|
||||
public class JdkNames {
|
||||
|
||||
public static final JvmClassName JL_OBJECT = JvmClassName.byInternalName("java/lang/Object");
|
||||
public static final JvmClassName JL_STRING = JvmClassName.byInternalName("java/lang/String");
|
||||
public static final JvmClassName JLA_ANNOTATION = JvmClassName.byInternalName("java/lang/annotation/Annotation");
|
||||
public static final JvmClassName JLA_ENUM = JvmClassName.byInternalName("java/lang/Enum");
|
||||
|
||||
private JdkNames() {
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user