removed JetStandardLibraryNames
This commit is contained in:
@@ -99,6 +99,7 @@ public class JetStandardLibrary {
|
||||
private ClassDescriptor comparableClass;
|
||||
private ClassDescriptor throwableClass;
|
||||
private ClassDescriptor enumClass;
|
||||
private ClassDescriptor volatileClass;
|
||||
|
||||
private JetType stringType;
|
||||
|
||||
@@ -169,6 +170,7 @@ public class JetStandardLibrary {
|
||||
this.arrayClass = (ClassDescriptor) libraryScope.getClassifier(Name.identifier("Array"));
|
||||
this.throwableClass = (ClassDescriptor) libraryScope.getClassifier(Name.identifier("Throwable"));
|
||||
this.enumClass = (ClassDescriptor) libraryScope.getClassifier(Name.identifier("Enum"));
|
||||
this.volatileClass = (ClassDescriptor) libraryScope.getClassifier(Name.identifier("volatile"));
|
||||
|
||||
this.iterableClass = (ClassDescriptor) libraryScope.getClassifier(Name.identifier("Iterable"));
|
||||
this.iteratorClass = (ClassDescriptor) libraryScope.getClassifier(Name.identifier("Iterator"));
|
||||
@@ -458,11 +460,11 @@ public class JetStandardLibrary {
|
||||
return primitiveJetTypeToJetArrayType.get(jetType);
|
||||
}
|
||||
|
||||
public static boolean isVolatile(PropertyDescriptor descriptor) {
|
||||
public boolean isVolatile(@NotNull PropertyDescriptor descriptor) {
|
||||
List<AnnotationDescriptor> annotations = descriptor.getOriginal().getAnnotations();
|
||||
if (annotations != null) {
|
||||
for(AnnotationDescriptor d: annotations) {
|
||||
if (JetStandardLibraryNames.VOLATILE.is(d.getType())) {
|
||||
for(AnnotationDescriptor annotation: annotations) {
|
||||
if (volatileClass.equals(annotation.getType().getConstructor().getDeclarationDescriptor())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -470,6 +472,10 @@ public class JetStandardLibrary {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isArray(@NotNull JetType type) {
|
||||
return getArray().equals(type.getConstructor().getDeclarationDescriptor());
|
||||
}
|
||||
|
||||
public JetType getTuple0Type() {
|
||||
return tuple0Type;
|
||||
}
|
||||
|
||||
@@ -1,41 +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.types.lang;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jet.lang.resolve.name.Name;
|
||||
import org.jetbrains.jet.lang.types.ref.ClassName;
|
||||
|
||||
/**
|
||||
* @author Stepan Koltsov
|
||||
*/
|
||||
public class JetStandardLibraryNames {
|
||||
|
||||
private JetStandardLibraryNames() {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static ClassName classIn(@NotNull String name, int typeParameterCount) {
|
||||
return new ClassName(
|
||||
JetStandardClasses.STANDARD_CLASSES_FQNAME.child(Name.identifier(name)),
|
||||
typeParameterCount);
|
||||
}
|
||||
|
||||
public static final ClassName ARRAY = classIn("Array", 1);
|
||||
public static final ClassName VOLATILE = classIn("volatile", 0);
|
||||
public static final ClassName INT = PrimitiveType.INT.getClassName();
|
||||
}
|
||||
Reference in New Issue
Block a user