Refactor: add hasBody() to JetDeclarationWithBody interface

Use it where appropriate
This commit is contained in:
Pavel V. Talanov
2014-03-26 17:14:57 +04:00
parent e7fd8c4118
commit 66aae37bc6
15 changed files with 41 additions and 35 deletions
@@ -102,11 +102,11 @@ public final class PropertyTranslator extends AbstractTranslator {
}
private boolean hasCustomGetter() {
return declaration != null && declaration.getGetter() != null && getCustomGetterDeclaration().getBodyExpression() != null;
return declaration != null && declaration.getGetter() != null && getCustomGetterDeclaration().hasBody();
}
private boolean hasCustomSetter() {
return declaration != null && declaration.getSetter() != null && getCustomSetterDeclaration().getBodyExpression() != null;
return declaration != null && declaration.getSetter() != null && getCustomSetterDeclaration().hasBody();
}
@NotNull
@@ -110,8 +110,7 @@ public final class FunctionTranslator extends AbstractTranslator {
}
private void translateBody() {
JetExpression jetBodyExpression = functionDeclaration.getBodyExpression();
if (jetBodyExpression == null) {
if (!functionDeclaration.hasBody()) {
assert descriptor.getModality().equals(Modality.ABSTRACT);
return;
}