在kettle中的kettle-core.jar中存在一个bug,导致kjb在spoon中执行同在kitchen执行和调用api的时候执行结果不一样,体现在变量替换中如果要替换的变量不存在的时候,在spoon中替换为空,在kitchen中则不替换。
具体bug所在位置为:org.pentaho.di.core.util.StringUtil中的53行。
原来为
int i = rest.indexOf(open);
while (i > -1)
{
int j = rest.indexOf(close, i + open.length());
if (j > -1)
{
String varName = rest.substring(i + open.length(), j);
Object value = variablesValues.get(varName);
if (value == null)
{
value = open + varName + close;
}
else
{
int another = ((String)value).indexOf(open);
if (another > -1)
{
if (recursion > 50)
{
throw new RuntimeException("Endless loop detected for substitution of variable: " + (String)value);
}
recursion++; value = substit
具体bug所在位置为:org.pentaho.di.core.util.StringUtil中的53行。
原来为
int i = rest.indexOf(open);
while (i > -1)
{
int j = rest.indexOf(close, i + open.length());
if (j > -1)
{
String varName = rest.substring(i + open.length(), j);
Object value = variablesValues.get(varName);
if (value == null)
{
value = open + varName + close;
}
else
{
int another = ((String)value).indexOf(open);
if (another > -1)
{
if (recursion > 50)
{
throw new RuntimeException("Endless loop detected for substitution of variable: " + (String)value);
}
recursion++; value = substit