Rename class
This commit is contained in:
@@ -22,7 +22,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jet.codegen.RangeCodegenUtil;
|
||||
import org.jetbrains.jet.lang.descriptors.CallableMemberDescriptor;
|
||||
import org.jetbrains.jet.lang.descriptors.SimpleFunctionDescriptor;
|
||||
import org.jetbrains.jet.lang.resolve.AnnotationUtils;
|
||||
import org.jetbrains.jet.lang.resolve.CompileTimeConstantUtils;
|
||||
import org.jetbrains.jet.lang.resolve.java.JvmPrimitiveType;
|
||||
import org.jetbrains.jet.lang.resolve.name.FqName;
|
||||
import org.jetbrains.jet.lang.resolve.name.FqNameUnsafe;
|
||||
@@ -227,7 +227,7 @@ public class IntrinsicMethods {
|
||||
}
|
||||
}
|
||||
|
||||
String value = AnnotationUtils.getIntrinsicAnnotationArgument(descriptor);
|
||||
String value = CompileTimeConstantUtils.getIntrinsicAnnotationArgument(descriptor);
|
||||
if (value == null) return null;
|
||||
|
||||
return namedMethods.get(value);
|
||||
|
||||
+3
-2
@@ -25,7 +25,7 @@ import org.jetbrains.jet.lang.descriptors.ClassDescriptor;
|
||||
import org.jetbrains.jet.lang.descriptors.ConstructorDescriptor;
|
||||
import org.jetbrains.jet.lang.descriptors.PropertyDescriptor;
|
||||
import org.jetbrains.jet.lang.descriptors.SimpleFunctionDescriptor;
|
||||
import org.jetbrains.jet.lang.resolve.AnnotationUtils;
|
||||
import org.jetbrains.jet.lang.resolve.CompileTimeConstantUtils;
|
||||
import org.jetbrains.jet.lang.resolve.BindingContextUtils;
|
||||
import org.jetbrains.jet.lang.resolve.BindingTrace;
|
||||
import org.jetbrains.jet.lang.resolve.constants.CompileTimeConstant;
|
||||
@@ -95,7 +95,8 @@ public class TraceBasedJavaResolverCache implements JavaResolverCache {
|
||||
Object evaluatedExpression = JavaConstantExpressionEvaluator.computeConstantExpression(initializer, false);
|
||||
if (evaluatedExpression != null) {
|
||||
CompileTimeConstant<?> constant = JavaAnnotationArgumentResolver.
|
||||
resolveCompileTimeConstantValue(evaluatedExpression, AnnotationUtils.isPropertyCompileTimeConstant(descriptor), descriptor.getType());
|
||||
resolveCompileTimeConstantValue(evaluatedExpression, CompileTimeConstantUtils
|
||||
.isPropertyCompileTimeConstant(descriptor), descriptor.getType());
|
||||
if (constant != null) {
|
||||
trace.record(COMPILE_TIME_INITIALIZER, descriptor, constant);
|
||||
}
|
||||
|
||||
+3
-3
@@ -297,7 +297,7 @@ public class ConstantExpressionEvaluator private (val trace: BindingTrace) : Jet
|
||||
else
|
||||
compileTimeConstant.getValue()
|
||||
return createCompileTimeConstant(value, expectedType, isPure = false,
|
||||
canBeUsedInAnnotation = AnnotationUtils.isPropertyCompileTimeConstant(callableDescriptor))
|
||||
canBeUsedInAnnotation = CompileTimeConstantUtils.isPropertyCompileTimeConstant(callableDescriptor))
|
||||
}
|
||||
}
|
||||
return null
|
||||
@@ -332,7 +332,7 @@ public class ConstantExpressionEvaluator private (val trace: BindingTrace) : Jet
|
||||
if (resultingDescriptor == null) return null
|
||||
|
||||
// array()
|
||||
if (AnnotationUtils.isArrayMethodCall(call)) {
|
||||
if (CompileTimeConstantUtils.isArrayMethodCall(call)) {
|
||||
val varargType = resultingDescriptor.getValueParameters().first?.getVarargElementType()!!
|
||||
|
||||
val arguments = call.getValueArguments().values().flatMap { resolveArguments(it.getArguments(), varargType) }
|
||||
@@ -351,7 +351,7 @@ public class ConstantExpressionEvaluator private (val trace: BindingTrace) : Jet
|
||||
}
|
||||
|
||||
// javaClass()
|
||||
if (AnnotationUtils.isJavaClassMethodCall(call)) {
|
||||
if (CompileTimeConstantUtils.isJavaClassMethodCall(call)) {
|
||||
return JavaClassValue(resultingDescriptor.getReturnType()!!)
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,6 @@ import org.jetbrains.jet.lang.types.lang.KotlinBuiltIns;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -268,7 +267,7 @@ public class AnnotationResolver {
|
||||
if (descriptor != null && DescriptorUtils.isEnumClass(descriptor)) {
|
||||
trace.report(Errors.ANNOTATION_PARAMETER_MUST_BE_ENUM_CONST.on(argumentExpression));
|
||||
}
|
||||
else if (descriptor instanceof ClassDescriptor && AnnotationUtils.isJavaLangClass((ClassDescriptor) descriptor)) {
|
||||
else if (descriptor instanceof ClassDescriptor && CompileTimeConstantUtils.isJavaLangClass((ClassDescriptor) descriptor)) {
|
||||
trace.report(Errors.ANNOTATION_PARAMETER_MUST_BE_CLASS_LITERAL.on(argumentExpression));
|
||||
}
|
||||
else {
|
||||
@@ -282,7 +281,7 @@ public class AnnotationResolver {
|
||||
@NotNull BindingTrace trace
|
||||
) {
|
||||
ResolvedCall<?> resolvedCall = trace.get(BindingContext.RESOLVED_CALL, (expression).getCalleeExpression());
|
||||
if (resolvedCall == null || !AnnotationUtils.isArrayMethodCall(resolvedCall)) {
|
||||
if (resolvedCall == null || !CompileTimeConstantUtils.isArrayMethodCall(resolvedCall)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -41,7 +41,7 @@ import static org.jetbrains.jet.lang.diagnostics.Errors.NULLABLE_TYPE_OF_ANNOTAT
|
||||
import static org.jetbrains.jet.lang.resolve.BindingContext.VALUE_PARAMETER;
|
||||
import static org.jetbrains.jet.lang.resolve.DescriptorUtils.*;
|
||||
|
||||
public class AnnotationUtils {
|
||||
public class CompileTimeConstantUtils {
|
||||
|
||||
public static void checkConstructorParametersType(@NotNull List<JetParameter> parameters, @NotNull BindingTrace trace) {
|
||||
for (JetParameter parameter : parameters) {
|
||||
@@ -130,6 +130,6 @@ public class AnnotationUtils {
|
||||
return "java.lang.Class".equals(DescriptorUtils.getFqName(descriptor).asString());
|
||||
}
|
||||
|
||||
private AnnotationUtils() {
|
||||
private CompileTimeConstantUtils() {
|
||||
}
|
||||
}
|
||||
@@ -1169,7 +1169,7 @@ public class DescriptorResolver {
|
||||
resolveVisibilityFromModifiers(modifierList, getDefaultConstructorVisibility(classDescriptor)),
|
||||
DescriptorUtils.isConstructorOfStaticNestedClass(constructorDescriptor));
|
||||
if (isAnnotationClass(classDescriptor)) {
|
||||
AnnotationUtils.checkConstructorParametersType(valueParameters, trace);
|
||||
CompileTimeConstantUtils.checkConstructorParametersType(valueParameters, trace);
|
||||
}
|
||||
return constructor;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user