fix #2249 check collection
This commit is contained in:
parent
bbe3674be5
commit
af6f119d7b
1 changed files with 9 additions and 1 deletions
|
@ -17,6 +17,7 @@ package org.codelibs.fess.crawler.transformer;
|
|||
|
||||
import java.net.URLDecoder;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
@ -114,7 +115,14 @@ public interface FessTransformer {
|
|||
} else if (dataMap.containsKey(key)) {
|
||||
if (getFessConfig().isCrawlerDocumentAppendData()) {
|
||||
final Object oldValue = dataMap.get(key);
|
||||
final Object[] oldValues = oldValue instanceof Object[] ? (Object[]) oldValue : new Object[] { oldValue };
|
||||
final Object[] oldValues;
|
||||
if (oldValue instanceof Object[]) {
|
||||
oldValues = (Object[]) oldValue;
|
||||
} else if (oldValue instanceof Collection<?>) {
|
||||
oldValues = ((Collection<?>) oldValue).toArray();
|
||||
} else {
|
||||
oldValues = new Object[] { oldValue };
|
||||
}
|
||||
if (value.getClass().isArray()) {
|
||||
final Object[] newValues = (Object[]) value;
|
||||
final Object[] values = Arrays.copyOf(oldValues, oldValues.length + newValues.length);
|
||||
|
|
Loading…
Add table
Reference in a new issue