Simplifying methodDescriptor bean.

This commit is contained in:
Sergey Evdokimov
2011-08-21 23:16:12 +04:00
parent b993c3238b
commit 68a6163709
2 changed files with 11 additions and 16 deletions
@@ -49,21 +49,21 @@ public class GrDescriptorReturnTypeCalculator extends GrCallExpressionTypeCalcul
GrMethodReturnTypeDescriptor.Param[] params;
if (descriptor.anyParams != null) {
assert descriptor.anyParams.length == 1;
assert descriptor.params == null;
assert pairs.isEmpty();
params = null;
}
else {
if (descriptor.params != null) {
params = descriptor.params;
if (params == null) params = GrMethodReturnTypeDescriptor.Param.EMPTY_ARRAY;
assert params != null;
assert (descriptor.checkParamsType == null || descriptor.checkParamsType);
for (GrMethodReturnTypeDescriptor.Param param : params) {
assert StringUtil.isNotEmpty(param.type);
}
}
else if (descriptor.checkParamsType != null && descriptor.checkParamsType) {
params = GrMethodReturnTypeDescriptor.Param.EMPTY_ARRAY;
}
else {
params = null;
}
assert StringUtil.isNotEmpty(descriptor.returnType);
pairs.add(new Pair<GrMethodReturnTypeDescriptor.Param[], String>(params, descriptor.returnType));
@@ -23,9 +23,8 @@ public class GrMethodReturnTypeDescriptor {
@Attribute("returnType")
public String returnType;
@Property(surroundWithTag = false)
@AbstractCollection(surroundWithTag = false)
public AnyParams[] anyParams;
@Attribute("checkParamsType")
public Boolean checkParamsType;
@Property(surroundWithTag = false)
@AbstractCollection(surroundWithTag = false)
@@ -40,8 +39,4 @@ public class GrMethodReturnTypeDescriptor {
public String type;
}
@Tag("anyParams")
public static class AnyParams {
}
}