final StringBuffer buff = new StringBuffer(tabString(tab));
buff.append("if (");//$NON-NLS-1$
buff.append(condition.toStringExpression()).append(") ");//$NON-NLS-1$
- buff.append(statement.toString(tab + 1));
+ if (statement != null) {
+ buff.append(statement.toString(tab + 1));
+ }
for (int i = 0; i < elseifs.length; i++) {
buff.append(elseifs[i].toString(tab + 1));
buff.append("\n");//$NON-NLS-1$
public List getOutsideVariable() {
final ArrayList list = new ArrayList();
list.addAll(condition.getOutsideVariable()); // todo: check if unuseful
- list.addAll(statement.getOutsideVariable());
+ if (statement != null) {
+ list.addAll(statement.getOutsideVariable());
+ }
for (int i = 0; i < elseifs.length; i++) {
list.addAll(elseifs[i].getOutsideVariable());
}
public List getModifiedVariable() {
final ArrayList list = new ArrayList();
list.addAll(condition.getModifiedVariable());
- list.addAll(statement.getModifiedVariable());
+ if (statement != null) {
+ list.addAll(statement.getModifiedVariable());
+ }
for (int i = 0; i < elseifs.length; i++) {
list.addAll(elseifs[i].getModifiedVariable());
}
public List getUsedVariable() {
final ArrayList list = new ArrayList();
list.addAll(condition.getUsedVariable());
- list.addAll(statement.getUsedVariable());
+ if (statement != null) {
+ list.addAll(statement.getUsedVariable());
+ }
for (int i = 0; i < elseifs.length; i++) {
list.addAll(elseifs[i].getUsedVariable());
}