From fc0f67f5b0bbcf18d8bbb93c34c8d726145a7702 Mon Sep 17 00:00:00 2001 From: Richard Peter Date: Wed, 11 Sep 2013 16:54:54 -0500 Subject: [PATCH] Issue #2298: Fix DataURIUtil calling setPluginName Change-Id: Ic0ee254bcd61bad9a76179486b11ff15bff2d271 Former-commit-id: d03a94ddef23b06a2d0852b146151ef20e0e4899 [formerly dcab61ba26ae3e46d761b4626b4891af372bf4cc] [formerly d03a94ddef23b06a2d0852b146151ef20e0e4899 [formerly dcab61ba26ae3e46d761b4626b4891af372bf4cc] [formerly 6657880572e41b760cc337831aada6b60c8ffb81 [formerly 2e7494fad8b1ae47c93b7d37a84f38f674d46aa9]]] Former-commit-id: 6657880572e41b760cc337831aada6b60c8ffb81 Former-commit-id: 47d9647144161c9d991a03259ed48e503e157c5f [formerly 8599940deeda3d375c9016af1f8177953f073bb8] Former-commit-id: bc4627a22dcc09b18aef156618d2a960adc8d1e2 --- .../dataplugin/annotations/DataURIUtil.java | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin/src/com/raytheon/uf/common/dataplugin/annotations/DataURIUtil.java b/edexOsgi/com.raytheon.uf.common.dataplugin/src/com/raytheon/uf/common/dataplugin/annotations/DataURIUtil.java index 4878fba7dc..7bd40cbdcf 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin/src/com/raytheon/uf/common/dataplugin/annotations/DataURIUtil.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin/src/com/raytheon/uf/common/dataplugin/annotations/DataURIUtil.java @@ -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. * * * @@ -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); } }