move isEmpty() from Expression to Element
This commit is contained in:
@@ -8,6 +8,10 @@ import org.jetbrains.annotations.NotNull;
|
|||||||
public abstract class Element extends Node {
|
public abstract class Element extends Node {
|
||||||
public static final Element EMPTY_ELEMENT = new EmptyElement();
|
public static final Element EMPTY_ELEMENT = new EmptyElement();
|
||||||
|
|
||||||
|
public boolean isEmpty() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author ignatov
|
* @author ignatov
|
||||||
*/
|
*/
|
||||||
@@ -17,5 +21,10 @@ public abstract class Element extends Node {
|
|||||||
public String toKotlin() {
|
public String toKotlin() {
|
||||||
return EMPTY;
|
return EMPTY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isEmpty() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,8 +27,4 @@ public abstract class Expression extends Statement {
|
|||||||
boolean isNullable() {
|
boolean isNullable() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isEmpty() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ public class Field extends Member {
|
|||||||
public String toKotlin() {
|
public String toKotlin() {
|
||||||
String modifier = modifiersToKotlin();
|
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();
|
||||||
|
|
||||||
return modifier + myIdentifier.toKotlin() + SPACE + COLON + SPACE + myType.toKotlin() + SPACE +
|
return modifier + myIdentifier.toKotlin() + SPACE + COLON + SPACE + myType.toKotlin() + SPACE +
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ public class LocalVariable extends Expression {
|
|||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public String toKotlin() {
|
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();
|
||||||
|
|
||||||
return myIdentifier.toKotlin() + SPACE + COLON + SPACE + myType.toKotlin() + SPACE +
|
return myIdentifier.toKotlin() + SPACE + COLON + SPACE + myType.toKotlin() + SPACE +
|
||||||
|
|||||||
Reference in New Issue
Block a user