fix #2009 check if old value is array

This commit is contained in:
Shinsuke Sugaya 2019-02-07 06:54:25 +09:00
parent 625226a9c1
commit 5b0176a2ff

View file

@ -114,7 +114,7 @@ public interface FessTransformer {
} else if (dataMap.containsKey(key)) {
if (getFessConfig().isCrawlerDocumentAppendData()) {
final Object oldValue = dataMap.get(key);
final Object[] oldValues = (Object[]) oldValue;
final Object[] oldValues = oldValue instanceof Object[] ? (Object[]) oldValue : new Object[] { oldValue };
if (value.getClass().isArray()) {
final Object[] newValues = (Object[]) value;
final Object[] values = Arrays.copyOf(oldValues, oldValues.length + newValues.length);