This fixes up the issues reported and flips enforcement to on.
Change-Id: Ifd8201eb6ad60c133559bc29b40fda487f4d2c5e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
<propertyExpansion>checkstyle.violationSeverity=error</propertyExpansion>
</configuration>
</plugin>
+ <plugin>
+ <groupId>com.github.spotbugs</groupId>
+ <artifactId>spotbugs-maven-plugin</artifactId>
+ <configuration>
+ <failOnError>true</failOnError>
+ </configuration>
+ </plugin>
</plugins>
</build>
<scm>
import org.opendaylight.mdsal.eos.common.api.EntityOwnershipState;
import org.opendaylight.mdsal.eos.dom.api.DOMEntity;
import org.opendaylight.mdsal.eos.dom.api.DOMEntityOwnershipService;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
/**
* Adapter that bridges between the binding and DOM EntityOwnershipService interfaces.
* @author Thomas Pantelis
*/
public class BindingDOMEntityOwnershipServiceAdapter implements EntityOwnershipService, AutoCloseable {
- static final Logger LOG = LoggerFactory.getLogger(BindingDOMEntityOwnershipServiceAdapter.class);
-
private final @NonNull DOMEntityOwnershipService domService;
private final @NonNull BindingNormalizedNodeSerializer conversionCodec;
package org.opendaylight.mdsal.eos.binding.dom.adapter;
import com.google.common.base.Preconditions;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeSerializer;
import org.opendaylight.mdsal.eos.binding.api.Entity;
import org.opendaylight.mdsal.eos.binding.api.EntityOwnershipChange;
import org.opendaylight.mdsal.eos.binding.api.EntityOwnershipListener;
import org.opendaylight.mdsal.eos.dom.api.DOMEntityOwnershipChange;
import org.opendaylight.mdsal.eos.dom.api.DOMEntityOwnershipListener;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* Adapter that bridges between the binding and DOM EntityOwnershipListener interfaces.
* @author Thomas Pantelis
*/
class DOMEntityOwnershipListenerAdapter implements DOMEntityOwnershipListener {
+ private static final Logger LOG = LoggerFactory.getLogger(DOMEntityOwnershipListenerAdapter.class);
+
private final BindingNormalizedNodeSerializer conversionCodec;
private final EntityOwnershipListener bindingListener;
this.conversionCodec = Preconditions.checkNotNull(conversionCodec);
}
- @SuppressWarnings("checkstyle:IllegalCatch")
@Override
+ @SuppressWarnings("checkstyle:IllegalCatch")
+ @SuppressFBWarnings("BC_UNCONFIRMED_CAST_OF_RETURN_VALUE")
public void ownershipChanged(final DOMEntityOwnershipChange ownershipChange) {
try {
final Entity entity = new Entity(ownershipChange.getEntity().getType(),
bindingListener.ownershipChanged(new EntityOwnershipChange(entity, ownershipChange.getState(),
ownershipChange.inJeopardy()));
} catch (final Exception e) {
- BindingDOMEntityOwnershipServiceAdapter.LOG.error(
- "Error converting DOM entity ID {} to binding InstanceIdentifier",
+ LOG.error("Error converting DOM entity ID {} to binding InstanceIdentifier",
ownershipChange.getEntity().getIdentifier(), e);
}
}
<propertyExpansion>checkstyle.violationSeverity=error</propertyExpansion>
</configuration>
</plugin>
+ <plugin>
+ <groupId>com.github.spotbugs</groupId>
+ <artifactId>spotbugs-maven-plugin</artifactId>
+ <configuration>
+ <failOnError>true</failOnError>
+ </configuration>
+ </plugin>
</plugins>
</build>
<scm>
<propertyExpansion>checkstyle.violationSeverity=error</propertyExpansion>
</configuration>
</plugin>
+ <plugin>
+ <groupId>com.github.spotbugs</groupId>
+ <artifactId>spotbugs-maven-plugin</artifactId>
+ <configuration>
+ <failOnError>true</failOnError>
+ </configuration>
+ </plugin>
</plugins>
</build>
<scm>
@Override
public boolean equals(final Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof Key)) {
+ return false;
+ }
final Key other = (Key) obj;
return hasOwner == other.hasOwner && isOwner == other.isOwner && wasOwner == other.wasOwner;
}
<propertyExpansion>checkstyle.violationSeverity=error</propertyExpansion>
</configuration>
</plugin>
+ <plugin>
+ <groupId>com.github.spotbugs</groupId>
+ <artifactId>spotbugs-maven-plugin</artifactId>
+ <configuration>
+ <failOnError>true</failOnError>
+ </configuration>
+ </plugin>
</plugins>
</build>
<scm>
<propertyExpansion>checkstyle.violationSeverity=error</propertyExpansion>
</configuration>
</plugin>
+ <plugin>
+ <groupId>com.github.spotbugs</groupId>
+ <artifactId>spotbugs-maven-plugin</artifactId>
+ <configuration>
+ <failOnError>true</failOnError>
+ </configuration>
+ </plugin>
</plugins>
</build>
<scm>
<artifactId>metainf-services</artifactId>
<optional>true</optional>
</dependency>
-
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-core</artifactId>
- </dependency>
</dependencies>
<build>
<propertyExpansion>checkstyle.violationSeverity=error</propertyExpansion>
</configuration>
</plugin>
+ <plugin>
+ <groupId>com.github.spotbugs</groupId>
+ <artifactId>spotbugs-maven-plugin</artifactId>
+ <configuration>
+ <failOnError>true</failOnError>
+ </configuration>
+ </plugin>
</plugins>
</build>