Issue #45 Unicode character cannot save

Code formatting
This commit is contained in:
Jindra Pet��k
2013-03-30 16:43:26 +01:00
parent d3bd9b641d
commit be106cc34b
772 changed files with 84378 additions and 84353 deletions
@@ -25,129 +25,129 @@ import java.util.List;
public class DirectValueTreeItem extends TreeItem {
public Object value;
public List<String> constants;
public GraphTargetItem computedRegValue;
public Object value;
public List<String> constants;
public GraphTargetItem computedRegValue;
public DirectValueTreeItem(GraphSourceItem instruction, int instructionPos, Object value, List<String> constants) {
super(instruction, PRECEDENCE_PRIMARY);
this.constants = constants;
this.value = value;
this.pos = instructionPos;
}
public DirectValueTreeItem(GraphSourceItem instruction, int instructionPos, Object value, List<String> constants) {
super(instruction, PRECEDENCE_PRIMARY);
this.constants = constants;
this.value = value;
this.pos = instructionPos;
}
@Override
public boolean isVariableComputed() {
if (computedRegValue != null) {
return true;
}
return false;
}
@Override
public boolean isVariableComputed() {
if (computedRegValue != null) {
return true;
}
return false;
}
@Override
public double toNumber() {
if (computedRegValue != null) {
return computedRegValue.toNumber();
}
if (value instanceof Double) {
return (Double) value;
}
if (value instanceof Float) {
return (Float) value;
}
if (value instanceof Long) {
return (Long) value;
}
if (value instanceof Boolean) {
return ((Boolean) value) ? 1 : 0;
}
return super.toNumber();
}
@Override
public double toNumber() {
if (computedRegValue != null) {
return computedRegValue.toNumber();
}
if (value instanceof Double) {
return (Double) value;
}
if (value instanceof Float) {
return (Float) value;
}
if (value instanceof Long) {
return (Long) value;
}
if (value instanceof Boolean) {
return ((Boolean) value) ? 1 : 0;
}
return super.toNumber();
}
@Override
public boolean toBoolean() {
if (computedRegValue != null) {
return computedRegValue.toBoolean();
}
if (value instanceof Boolean) {
return (Boolean) value;
}
if (value instanceof Double) {
return Double.compare((Double) value, 0.0) != 0;
}
if (value instanceof Float) {
return Float.compare((Float) value, 0.0f) != 0;
}
if (value instanceof Long) {
return ((Long) value) != 0;
}
return false;
}
@Override
public boolean toBoolean() {
if (computedRegValue != null) {
return computedRegValue.toBoolean();
}
if (value instanceof Boolean) {
return (Boolean) value;
}
if (value instanceof Double) {
return Double.compare((Double) value, 0.0) != 0;
}
if (value instanceof Float) {
return Float.compare((Float) value, 0.0f) != 0;
}
if (value instanceof Long) {
return ((Long) value) != 0;
}
return false;
}
@Override
public String toStringNoQuotes(List localData) {
if (value instanceof Double) {
if (Double.compare((double) (Double) value, 0) == 0) {
return hilight("0");
}
}
if (value instanceof Float) {
if (Float.compare((float) (Float) value, 0) == 0) {
return hilight("0");
}
}
if (value instanceof String) {
return hilight((String) value);
}
if (value instanceof ConstantIndex) {
return hilight(this.constants.get(((ConstantIndex) value).index));
}
return hilight(value.toString());
}
@Override
public String toStringNoQuotes(List localData) {
if (value instanceof Double) {
if (Double.compare((double) (Double) value, 0) == 0) {
return hilight("0");
}
}
if (value instanceof Float) {
if (Float.compare((float) (Float) value, 0) == 0) {
return hilight("0");
}
}
if (value instanceof String) {
return hilight((String) value);
}
if (value instanceof ConstantIndex) {
return hilight(this.constants.get(((ConstantIndex) value).index));
}
return hilight(value.toString());
}
public String toStringNoH(ConstantPool constants) {
if (value instanceof Double) {
if (Double.compare((double) (Double) value, 0) == 0) {
return ("0");
}
}
if (value instanceof Float) {
if (Float.compare((float) (Float) value, 0) == 0) {
return ("0");
}
}
if (value instanceof String) {
return (String) value;
}
if (value instanceof ConstantIndex) {
return (this.constants.get(((ConstantIndex) value).index));
}
return value.toString();
}
public String toStringNoH(ConstantPool constants) {
if (value instanceof Double) {
if (Double.compare((double) (Double) value, 0) == 0) {
return ("0");
}
}
if (value instanceof Float) {
if (Float.compare((float) (Float) value, 0) == 0) {
return ("0");
}
}
if (value instanceof String) {
return (String) value;
}
if (value instanceof ConstantIndex) {
return (this.constants.get(((ConstantIndex) value).index));
}
return value.toString();
}
@Override
public String toString(ConstantPool constants) {
if (value instanceof Double) {
if (Double.compare((double) (Double) value, 0) == 0) {
return hilight("0");
}
}
if (value instanceof Float) {
if (Float.compare((float) (Float) value, 0) == 0) {
return hilight("0");
}
}
if (value instanceof String) {
return hilight("\"" + Helper.escapeString((String) value) + "\"");
}
if (value instanceof ConstantIndex) {
return hilight("\"" + Helper.escapeString(this.constants.get(((ConstantIndex) value).index)) + "\"");
}
return hilight(value.toString());
}
@Override
public String toString(ConstantPool constants) {
if (value instanceof Double) {
if (Double.compare((double) (Double) value, 0) == 0) {
return hilight("0");
}
}
if (value instanceof Float) {
if (Float.compare((float) (Float) value, 0) == 0) {
return hilight("0");
}
}
if (value instanceof String) {
return hilight("\"" + Helper.escapeString((String) value) + "\"");
}
if (value instanceof ConstantIndex) {
return hilight("\"" + Helper.escapeString(this.constants.get(((ConstantIndex) value).index)) + "\"");
}
return hilight(value.toString());
}
@Override
public boolean isCompileTime() {
return (value instanceof Double) || (value instanceof Float) || (value instanceof Boolean) || (value instanceof Long) || (value instanceof Null) || (computedRegValue != null && computedRegValue.isCompileTime());
}
@Override
public boolean isCompileTime() {
return (value instanceof Double) || (value instanceof Float) || (value instanceof Boolean) || (value instanceof Long) || (value instanceof Null) || (computedRegValue != null && computedRegValue.isCompileTime());
}
}