Commit 73190ce0 authored by Marco Cortella's avatar Marco Cortella
Browse files

FIX: Cannot create Calculated Fields using numbers in expression...

FIX: Cannot create Calculated Fields using numbers in expression https://production.eng.it/jira/browse/KNOWAGE-2997
parent 9d476d03
......@@ -28,7 +28,7 @@ import it.eng.knowage.meta.model.business.SimpleBusinessColumn;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
import org.apache.commons.lang.math.NumberUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -137,7 +137,11 @@ public class JpaCalculatedColumn implements IJpaCalculatedColumn {
// retrieve operands from string
StringTokenizer stk = new StringTokenizer(expression, "+-|*/()");
while (stk.hasMoreTokens()) {
String operand = stk.nextToken().trim();
String operand = stk.nextToken().trim();
if (NumberUtils.isNumber(operand)) {
continue;
}
System.out.println("Found Operand " + operand);
operands.add(operand);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment