move isEmpty() from Expression to Element

This commit is contained in:
Sergey Ignatov
2011-11-15 16:51:29 +04:00
parent 9782fc700f
commit d45e69b538
4 changed files with 11 additions and 6 deletions
@@ -8,6 +8,10 @@ import org.jetbrains.annotations.NotNull;
public abstract class Element extends Node {
public static final Element EMPTY_ELEMENT = new EmptyElement();
public boolean isEmpty() {
return false;
}
/**
* @author ignatov
*/
@@ -17,5 +21,10 @@ public abstract class Element extends Node {
public String toKotlin() {
return EMPTY;
}
@Override
public boolean isEmpty() {
return true;
}
}
}
@@ -27,8 +27,4 @@ public abstract class Expression extends Statement {
boolean isNullable() {
return false;
}
public boolean isEmpty() {
return false;
}
}
+1 -1
View File
@@ -64,7 +64,7 @@ public class Field extends Member {
public String toKotlin() {
String modifier = modifiersToKotlin();
if (myInitializer.toKotlin().isEmpty()) // TODO: remove
if (myInitializer.isEmpty())
return modifier + myIdentifier.toKotlin() + SPACE + COLON + SPACE + myType.toKotlin();
return modifier + myIdentifier.toKotlin() + SPACE + COLON + SPACE + myType.toKotlin() + SPACE +
@@ -27,7 +27,7 @@ public class LocalVariable extends Expression {
@NotNull
@Override
public String toKotlin() {
if (myInitializer.toKotlin().isEmpty()) // TODO: remove
if (myInitializer.isEmpty())
return myIdentifier.toKotlin() + SPACE + COLON + SPACE + myType.toKotlin();
return myIdentifier.toKotlin() + SPACE + COLON + SPACE + myType.toKotlin() + SPACE +