Issue #2298: Fix DataURIUtil calling setPluginName

Change-Id: Ic0ee254bcd61bad9a76179486b11ff15bff2d271

Former-commit-id: 859fe815193d65c35c1c753153f8d93767abf414
This commit is contained in:
Richard Peter 2013-09-11 16:54:54 -05:00
parent 6b93f9ad06
commit 75d2cd017e

View file

@ -54,7 +54,7 @@ import com.raytheon.uf.common.util.ConvertUtil;
* from PluginDataObject
* May 15, 2013 1869 bsteffen Move uri map creation from RecordFactory.
* May 16, 2013 1869 bsteffen Rewrite dataURI property mappings.
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract and removed setPluginName.
*
* </pre>
*
@ -67,6 +67,9 @@ public class DataURIUtil {
private static final String FIELD_SEPARATOR = ".";
private static final Pattern FIELD_SEPARATOR_PATTERN = Pattern.compile("["
+ FIELD_SEPARATOR + "]");
private static final Pattern SEPARATOR_PATTERN = Pattern
.compile(DataURI.SEPARATOR);
@ -300,14 +303,19 @@ public class DataURIUtil {
accessMap.put(access.getFieldName(), access);
}
for (String dataKey : dataMap.keySet()) {
Object data = dataMap.get(dataKey);
DataURIFieldAccess access = accessMap.get(dataKey);
if (access == null) {
access = new DataURIFieldAccess(Arrays.asList(dataKey.split("["
+ FIELD_SEPARATOR + "]")),
object != null ? object.getClass() : null);
if (!PLUGIN_NAME_KEY.equals(dataKey)) {
Object data = dataMap.get(dataKey);
DataURIFieldAccess access = accessMap.get(dataKey);
if (access == null) {
access = new DataURIFieldAccess(
Arrays.asList(FIELD_SEPARATOR_PATTERN
.split(dataKey)),
object != null ? object.getClass() : null);
}
access.setFieldValue(object, data);
}
access.setFieldValue(object, data);
}
}