Removed sonar warnings.
[controller.git] / opendaylight / config / config-persister-file-xml-adapter / src / main / java / org / opendaylight / controller / config / persist / storage / file / xml / model / Config.java
index 68a33be5e67e02cf30f9fa83ca123fd82545ad76..63755f9e62c69d56c37dfa6442c91447bf42b8f7 100644 (file)
@@ -80,7 +80,7 @@ public final class Config {
             xif.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, false);
             xif.setProperty(XMLInputFactory.SUPPORT_DTD, false);
             XMLStreamReader xsr = xif.createXMLStreamReader(new StreamSource(from));
-            return ((Config) um.unmarshal(xsr));
+            return (Config) um.unmarshal(xsr);
         } catch (JAXBException | XMLStreamException e) {
             throw new PersistException("Unable to restore configuration", e);
         }
@@ -104,7 +104,7 @@ public final class Config {
     }
 
     public void addConfigSnapshot(ConfigSnapshot snap, int numberOfStoredBackups) {
-        if(shouldReplaceLast(numberOfStoredBackups) && snapshots.isEmpty() == false) {
+        if (shouldReplaceLast(numberOfStoredBackups) && !snapshots.isEmpty()) {
             snapshots.remove(0);
         }
         snapshots.add(snap);