Added JetMethod.flags() to replace kind(), with adding extra functionality (modality and visibility marking).
This commit is contained in:
+1
-1
@@ -1597,7 +1597,7 @@ public class JavaDescriptorResolver implements DependencyClassByQualifiedNameRes
|
||||
}
|
||||
|
||||
// TODO: ugly
|
||||
if (method.getJetMethod().kind() == JvmStdlibNames.JET_METHOD_KIND_PROPERTY) {
|
||||
if ((method.getJetMethod().flags() & JvmStdlibNames.JET_METHOD_FLAG_PROPERTY) != 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -125,7 +125,7 @@ class JavaDescriptorResolverHelper {
|
||||
NamedMembers members = getNamedMembers(Name.identifier(propertyName));
|
||||
|
||||
// TODO: some java properties too
|
||||
if (method.getJetMethod().kind() == JvmStdlibNames.JET_METHOD_KIND_PROPERTY) {
|
||||
if ((method.getJetMethod().flags() & JvmStdlibNames.JET_METHOD_FLAG_PROPERTY) != 0) {
|
||||
|
||||
int i = 0;
|
||||
|
||||
@@ -167,7 +167,7 @@ class JavaDescriptorResolverHelper {
|
||||
String propertyName = propertyParseResult.getPropertyName();
|
||||
NamedMembers members = getNamedMembers(Name.identifier(propertyName));
|
||||
|
||||
if (method.getJetMethod().kind() == JvmStdlibNames.JET_METHOD_KIND_PROPERTY) {
|
||||
if ((method.getJetMethod().flags() & JvmStdlibNames.JET_METHOD_FLAG_PROPERTY) != 0) {
|
||||
if (method.getParameters().size() == 0) {
|
||||
// TODO: report error properly
|
||||
throw new IllegalStateException();
|
||||
@@ -204,7 +204,7 @@ class JavaDescriptorResolverHelper {
|
||||
}
|
||||
}
|
||||
|
||||
if (method.getJetMethod().kind() != JvmStdlibNames.JET_METHOD_KIND_PROPERTY) {
|
||||
if ((method.getJetMethod().flags() & JvmStdlibNames.JET_METHOD_FLAG_PROPERTY) == 0) {
|
||||
NamedMembers namedMembers = getNamedMembers(Name.identifier(method.getName()));
|
||||
namedMembers.addMethod(method);
|
||||
}
|
||||
|
||||
@@ -40,15 +40,16 @@ public class JvmStdlibNames {
|
||||
|
||||
public static final JvmClassName JET_METHOD = JvmClassName.byFqNameWithoutInnerClasses("jet.runtime.typeinfo.JetMethod");
|
||||
|
||||
@Deprecated
|
||||
public static final String JET_METHOD_KIND_FIELD = "kind";
|
||||
public static final String JET_METHOD_FLAGS_FIELD = "flags";
|
||||
public static final String JET_METHOD_NULLABLE_RETURN_TYPE_FIELD = "nullableReturnType";
|
||||
public static final String JET_METHOD_RETURN_TYPE_FIELD = "returnType";
|
||||
public static final String JET_METHOD_TYPE_PARAMETERS_FIELD = "typeParameters";
|
||||
public static final String JET_METHOD_PROPERTY_TYPE_FIELD = "propertyType";
|
||||
|
||||
public static final int JET_METHOD_KIND_REGULAR = 0;
|
||||
public static final int JET_METHOD_KIND_PROPERTY = 1;
|
||||
public static final int JET_METHOD_KIND_DEFAULT = JET_METHOD_KIND_REGULAR;
|
||||
|
||||
public static final int JET_METHOD_FLAGS_DEFAULT = 0;
|
||||
public static final int JET_METHOD_FLAG_PROPERTY = 1;
|
||||
|
||||
public static final JvmClassName JET_CONSTRUCTOR = JvmClassName.byFqNameWithoutInnerClasses("jet.runtime.typeinfo.JetConstructor");
|
||||
|
||||
|
||||
+11
-7
@@ -31,14 +31,18 @@ public class JetMethodAnnotation extends PsiAnnotationWrapper {
|
||||
super(psiAnnotation);
|
||||
}
|
||||
|
||||
private int kind;
|
||||
private boolean kindInitialized;
|
||||
public int kind() {
|
||||
if (!kindInitialized) {
|
||||
kind = getIntAttribute(JvmStdlibNames.JET_METHOD_KIND_FIELD, JvmStdlibNames.JET_METHOD_KIND_DEFAULT);
|
||||
kindInitialized = true;
|
||||
private int flags;
|
||||
private boolean flagsInitialized;
|
||||
public int flags() {
|
||||
if (!flagsInitialized) {
|
||||
flags = getIntAttribute(JvmStdlibNames.JET_METHOD_FLAGS_FIELD, -1);
|
||||
if (flags == -1) {
|
||||
// for compatibility
|
||||
flags = getIntAttribute(JvmStdlibNames.JET_METHOD_KIND_FIELD, JvmStdlibNames.JET_METHOD_FLAGS_DEFAULT);
|
||||
}
|
||||
flagsInitialized = true;
|
||||
}
|
||||
return kind;
|
||||
return flags;
|
||||
}
|
||||
|
||||
private String typeParameters;
|
||||
|
||||
Reference in New Issue
Block a user