mirror of
https://github.com/apache/zeppelin
synced 2026-05-24 09:38:26 +00:00
[ZEPPELIN-1999] fix logic of replace
This commit is contained in:
parent
93c759d754
commit
fa1500aabc
1 changed files with 5 additions and 4 deletions
|
|
@ -320,13 +320,14 @@ public abstract class Interpreter {
|
|||
Class clazz = field.getType();
|
||||
if (!skipFields.contains(field.getName()) && (typesToProcess.contains(clazz)
|
||||
|| clazz.isPrimitive())) {
|
||||
Object value = null;
|
||||
try {
|
||||
Object value = FieldUtils.readField(field, interpreterContext, true);
|
||||
p = p.replaceAll(String.format(markerTemplate, field.getName()),
|
||||
value != null ? value.toString() : StringUtils.EMPTY);
|
||||
value = FieldUtils.readField(field, interpreterContext, true);
|
||||
} catch (Exception e) {
|
||||
logger.error("Cannot replace context parameter", e);
|
||||
logger.error("Cannot read value of field {0}", field.getName());
|
||||
}
|
||||
p = p.replaceAll(String.format(markerTemplate, field.getName()),
|
||||
value != null ? value.toString() : StringUtils.EMPTY);
|
||||
}
|
||||
}
|
||||
p = p.replaceAll(String.format(markerTemplate, "user"),
|
||||
|
|
|
|||
Loading…
Reference in a new issue