X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=opendaylight%2Fconfig%2Fconfig-persister-feature-adapter%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fconfigpusherfeature%2Finternal%2FFeatureConfigSnapshotHolder.java;h=135211727add6ad076fd56f7dcb66f3bee9c6b29;hb=a110503f173ba4fbeb07a61d3c7ebf1688dfc9d6;hp=518716cfa75b2043b189970719fd80fc8442701a;hpb=81b58527159d1ae07e7042372ca78b7dc769a7c7;p=controller.git diff --git a/opendaylight/config/config-persister-feature-adapter/src/main/java/org/opendaylight/controller/configpusherfeature/internal/FeatureConfigSnapshotHolder.java b/opendaylight/config/config-persister-feature-adapter/src/main/java/org/opendaylight/controller/configpusherfeature/internal/FeatureConfigSnapshotHolder.java index 518716cfa7..135211727a 100644 --- a/opendaylight/config/config-persister-feature-adapter/src/main/java/org/opendaylight/controller/configpusherfeature/internal/FeatureConfigSnapshotHolder.java +++ b/opendaylight/config/config-persister-feature-adapter/src/main/java/org/opendaylight/controller/configpusherfeature/internal/FeatureConfigSnapshotHolder.java @@ -40,13 +40,13 @@ import org.opendaylight.controller.config.persist.storage.file.xml.model.ConfigS public class FeatureConfigSnapshotHolder implements ConfigSnapshotHolder { private ConfigSnapshot unmarshalled = null; private ConfigFileInfo fileInfo = null; - private List featureChain = new ArrayList(); + private List featureChain = new ArrayList<>(); /* * @param holder - FeatureConfigSnapshotHolder that we * @param feature - new */ - public FeatureConfigSnapshotHolder(final FeatureConfigSnapshotHolder holder, final Feature feature) throws JAXBException { + public FeatureConfigSnapshotHolder(final FeatureConfigSnapshotHolder holder, final Feature feature) throws JAXBException, XMLStreamException { this(holder.fileInfo,holder.getFeature()); this.featureChain.add(feature); } @@ -57,7 +57,7 @@ public class FeatureConfigSnapshotHolder implements ConfigSnapshotHolder { * @param fileInfo - ConfigFileInfo to read into the ConfigSnapshot * @param feature - Feature the ConfigFileInfo was attached to */ - public FeatureConfigSnapshotHolder(final ConfigFileInfo fileInfo, final Feature feature) throws JAXBException { + public FeatureConfigSnapshotHolder(final ConfigFileInfo fileInfo, final Feature feature) throws JAXBException, XMLStreamException { Preconditions.checkNotNull(fileInfo); Preconditions.checkNotNull(fileInfo.getFinalname()); Preconditions.checkNotNull(feature); @@ -69,12 +69,9 @@ public class FeatureConfigSnapshotHolder implements ConfigSnapshotHolder { XMLInputFactory xif = XMLInputFactory.newFactory(); xif.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, false); xif.setProperty(XMLInputFactory.SUPPORT_DTD, false); - try { - XMLStreamReader xsr = xif.createXMLStreamReader(new StreamSource(new File(fileInfo.getFinalname()))); - unmarshalled = ((ConfigSnapshot) um.unmarshal(xsr)); - } catch (final XMLStreamException e) { - throw new JAXBException(e); - } + + XMLStreamReader xsr = xif.createXMLStreamReader(new StreamSource(new File(fileInfo.getFinalname()))); + unmarshalled = ((ConfigSnapshot) um.unmarshal(xsr)); } /* * (non-Javadoc)