Rename methods in PsiMethodWrapper
This commit is contained in:
+3
-3
@@ -23,7 +23,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jet.lang.descriptors.*;
|
||||
import org.jetbrains.jet.lang.descriptors.annotations.AnnotationDescriptor;
|
||||
import org.jetbrains.jet.lang.resolve.constants.*;
|
||||
import org.jetbrains.jet.lang.resolve.constants.StringValue;
|
||||
import org.jetbrains.jet.lang.resolve.java.data.ResolverClassData;
|
||||
import org.jetbrains.jet.lang.resolve.java.data.ResolverNamespaceData;
|
||||
import org.jetbrains.jet.lang.resolve.java.data.ResolverScopeData;
|
||||
@@ -78,10 +78,10 @@ public final class DescriptorResolverUtils {
|
||||
public static Modality resolveModality(PsiMemberWrapper memberWrapper, boolean isFinal) {
|
||||
if (memberWrapper instanceof PsiMethodWrapper) {
|
||||
PsiMethodWrapper method = (PsiMethodWrapper) memberWrapper;
|
||||
if (method.getJetMethod().hasForceOpenFlag()) {
|
||||
if (method.getJetMethodAnnotation().hasForceOpenFlag()) {
|
||||
return Modality.OPEN;
|
||||
}
|
||||
if (method.getJetMethod().hasForceFinalFlag()) {
|
||||
if (method.getJetMethodAnnotation().hasForceFinalFlag()) {
|
||||
return Modality.FINAL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -181,7 +181,7 @@ public final class MembersCache {
|
||||
processSetter(method, propertyParseResult);
|
||||
}
|
||||
|
||||
if (!method.getJetMethod().hasPropertyFlag()) {
|
||||
if (!method.getJetMethodAnnotation().hasPropertyFlag()) {
|
||||
NamedMembers namedMembers = getOrCreateEmpty(Name.identifier(method.getName()));
|
||||
namedMembers.addMethod(method);
|
||||
}
|
||||
@@ -192,7 +192,7 @@ public final class MembersCache {
|
||||
String propertyName = propertyParseResult.getPropertyName();
|
||||
NamedMembers members = getOrCreateEmpty(Name.identifier(propertyName));
|
||||
|
||||
if (method.getJetMethod().hasPropertyFlag()) {
|
||||
if (method.getJetMethodAnnotation().hasPropertyFlag()) {
|
||||
if (method.getParameters().size() == 0) {
|
||||
// TODO: report error properly
|
||||
throw new IllegalStateException();
|
||||
@@ -217,7 +217,7 @@ public final class MembersCache {
|
||||
|
||||
PsiParameterWrapper propertyTypeParameter = method.getParameter(i);
|
||||
TypeSource propertyType =
|
||||
new TypeSource(method.getJetMethod().propertyType(), propertyTypeParameter.getPsiParameter().getType(),
|
||||
new TypeSource(method.getJetMethodAnnotation().propertyType(), propertyTypeParameter.getPsiParameter().getType(),
|
||||
propertyTypeParameter.getPsiParameter());
|
||||
|
||||
members.addPropertyAccessor(new PropertyPsiDataElement(method, false, propertyType, receiverType));
|
||||
@@ -229,7 +229,7 @@ public final class MembersCache {
|
||||
NamedMembers members = getOrCreateEmpty(Name.identifier(propertyName));
|
||||
|
||||
// TODO: some java properties too
|
||||
if (method.getJetMethod().hasPropertyFlag()) {
|
||||
if (method.getJetMethodAnnotation().hasPropertyFlag()) {
|
||||
|
||||
int i = 0;
|
||||
|
||||
@@ -258,7 +258,7 @@ public final class MembersCache {
|
||||
// TODO: what if returnType == null?
|
||||
final PsiType returnType = method.getReturnType();
|
||||
assert returnType != null;
|
||||
TypeSource propertyType = new TypeSource(method.getJetMethod().propertyType(), returnType, method.getPsiMethod());
|
||||
TypeSource propertyType = new TypeSource(method.getJetMethodAnnotation().propertyType(), returnType, method.getPsiMethod());
|
||||
|
||||
members.addPropertyAccessor(new PropertyPsiDataElement(method, true, propertyType, receiverType));
|
||||
}
|
||||
|
||||
+2
-2
@@ -169,7 +169,7 @@ public final class JavaConstructorResolver {
|
||||
PsiMethodWrapper constructor = new PsiMethodWrapper(psiConstructor);
|
||||
|
||||
//noinspection deprecation
|
||||
if (constructor.getJetConstructor().hidden()) {
|
||||
if (constructor.getJetConstructorAnnotation().hidden()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -204,7 +204,7 @@ public final class JavaConstructorResolver {
|
||||
|
||||
constructorDescriptor.initialize(classData.getClassDescriptor().getTypeConstructor().getParameters(),
|
||||
valueParameterDescriptors.getDescriptors(),
|
||||
DescriptorResolverUtils.resolveVisibility(psiConstructor, constructor.getJetConstructor()),
|
||||
DescriptorResolverUtils.resolveVisibility(psiConstructor, constructor.getJetConstructorAnnotation()),
|
||||
aStatic);
|
||||
trace.record(BindingContext.CONSTRUCTOR, psiConstructor, constructorDescriptor);
|
||||
return constructorDescriptor;
|
||||
|
||||
+4
-4
@@ -89,7 +89,7 @@ public final class JavaFunctionResolver {
|
||||
}
|
||||
|
||||
// TODO: ugly
|
||||
if (method.getJetMethod().hasPropertyFlag()) {
|
||||
if (method.getJetMethodAnnotation().hasPropertyFlag()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ public final class JavaFunctionResolver {
|
||||
scopeData.getClassOrNamespaceDescriptor(),
|
||||
annotationResolver.resolveAnnotations(psiMethod),
|
||||
Name.identifier(method.getName()),
|
||||
DescriptorKindUtils.flagsToKind(method.getJetMethod().kind())
|
||||
DescriptorKindUtils.flagsToKind(method.getJetMethodAnnotation().kind())
|
||||
);
|
||||
|
||||
String context = "method " + method.getName() + " in class " + psiClass.getQualifiedName();
|
||||
@@ -150,7 +150,7 @@ public final class JavaFunctionResolver {
|
||||
valueParameterDescriptors.getDescriptors(),
|
||||
returnType,
|
||||
DescriptorResolverUtils.resolveModality(method, method.isFinal()),
|
||||
DescriptorResolverUtils.resolveVisibility(psiMethod, method.getJetMethod()),
|
||||
DescriptorResolverUtils.resolveVisibility(psiMethod, method.getJetMethodAnnotation()),
|
||||
/*isInline = */ false
|
||||
);
|
||||
|
||||
@@ -238,7 +238,7 @@ public final class JavaFunctionResolver {
|
||||
@NotNull TypeVariableResolver typeVariableResolver
|
||||
) {
|
||||
|
||||
String returnTypeFromAnnotation = method.getJetMethod().returnType();
|
||||
String returnTypeFromAnnotation = method.getJetMethodAnnotation().returnType();
|
||||
|
||||
JetType transformedType;
|
||||
if (returnTypeFromAnnotation.length() > 0) {
|
||||
|
||||
+2
-2
@@ -131,7 +131,7 @@ public final class JavaPropertyResolver {
|
||||
|
||||
PropertyPsiDataElement getter = members.getGetter();
|
||||
if (getter != null) {
|
||||
JetMethodAnnotation jetMethod = ((PsiMethodWrapper) getter.getMember()).getJetMethod();
|
||||
JetMethodAnnotation jetMethod = ((PsiMethodWrapper) getter.getMember()).getJetMethodAnnotation();
|
||||
visibility = DescriptorResolverUtils.resolveVisibility(members.getCharacteristicPsi(), jetMethod);
|
||||
kind = DescriptorKindUtils.flagsToKind(jetMethod.kind());
|
||||
}
|
||||
@@ -184,7 +184,7 @@ public final class JavaPropertyResolver {
|
||||
setterVisibility = DescriptorResolverUtils.resolveVisibility(
|
||||
setter.getMember().getPsiMember(),
|
||||
((PsiMethodWrapper) setter.getMember())
|
||||
.getJetMethod());
|
||||
.getJetMethodAnnotation());
|
||||
}
|
||||
setterDescriptor = new PropertySetterDescriptor(
|
||||
propertyDescriptor,
|
||||
|
||||
+2
-2
@@ -346,9 +346,9 @@ public final class JavaSignatureResolver {
|
||||
|
||||
List<TypeParameterDescriptorInitialization> typeParametersIntialization;
|
||||
final PsiMethod psiMethod = method.getPsiMethod();
|
||||
if (method.getJetMethod().typeParameters().length() > 0) {
|
||||
if (method.getJetMethodAnnotation().typeParameters().length() > 0) {
|
||||
typeParametersIntialization = resolveMethodTypeParametersFromJetSignature(
|
||||
method.getJetMethod().typeParameters(), psiMethod, functionDescriptor);
|
||||
method.getJetMethodAnnotation().typeParameters(), psiMethod, functionDescriptor);
|
||||
}
|
||||
else {
|
||||
typeParametersIntialization = makeUninitializedTypeParameters(functionDescriptor, psiMethod.getTypeParameters());
|
||||
|
||||
+10
-10
@@ -55,22 +55,22 @@ public class PsiMethodWrapper extends PsiMemberWrapper {
|
||||
return getParameters().get(i);
|
||||
}
|
||||
|
||||
private JetMethodAnnotation jetMethod;
|
||||
private JetMethodAnnotation jetMethodAnnotation;
|
||||
@NotNull
|
||||
public JetMethodAnnotation getJetMethod() {
|
||||
if (jetMethod == null) {
|
||||
jetMethod = JetMethodAnnotation.get(getPsiMethod());
|
||||
public JetMethodAnnotation getJetMethodAnnotation() {
|
||||
if (jetMethodAnnotation == null) {
|
||||
jetMethodAnnotation = JetMethodAnnotation.get(getPsiMethod());
|
||||
}
|
||||
return jetMethod;
|
||||
return jetMethodAnnotation;
|
||||
}
|
||||
|
||||
private JetConstructorAnnotation jetConstructor;
|
||||
private JetConstructorAnnotation jetConstructorAnnotation;
|
||||
@NotNull
|
||||
public JetConstructorAnnotation getJetConstructor() {
|
||||
if (jetConstructor == null) {
|
||||
jetConstructor = JetConstructorAnnotation.get(getPsiMethod());
|
||||
public JetConstructorAnnotation getJetConstructorAnnotation() {
|
||||
if (jetConstructorAnnotation == null) {
|
||||
jetConstructorAnnotation = JetConstructorAnnotation.get(getPsiMethod());
|
||||
}
|
||||
return jetConstructor;
|
||||
return jetConstructorAnnotation;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user