Fixed FindBugs warnings in sal-clustering-commons and enabled the maven plugin to
run and fail the build on violations.
For some reason, the plugin sometimes creates a local .fbExcludeFilterFile that
is a copy of the one in odlparent. It may be that it doesn't always clean it up
at the end. So I added it to the .gitignore
Change-Id: Id1ad5582f533bd4bfe714e54ae1e79d00a411552
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
.checkstyle
.factorypath
maven-metadata-local.xml
+.fbExcludeFilterFile
<groupId>org.opendaylight.controller</groupId>
<artifactId>config-api</artifactId>
</dependency>
-
</dependencies>
<build>
<propertyExpansion>checkstyle.violationSeverity=error</propertyExpansion>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>findbugs-maven-plugin</artifactId>
+ <configuration>
+ <failOnError>true</failOnError>
+ </configuration>
+ </plugin>
</plugins>
</build>
</project>
import akka.actor.Props;
import akka.actor.UntypedActor;
-import akka.japi.Creator;
import akka.japi.Effect;
import akka.remote.AssociationErrorEvent;
import akka.remote.InvalidAssociation;
}
public static Props props(final Effect callback) {
- return Props.create(new Creator<QuarantinedMonitorActor>() {
- private static final long serialVersionUID = 1L;
-
- @Override
- public QuarantinedMonitorActor create() throws Exception {
- return new QuarantinedMonitorActor(callback);
- }
- });
+ return Props.create(QuarantinedMonitorActor.class, callback);
}
-
}
public void visitNode(int level, String parentPath, NormalizedNode<?, ?> normalizedNode) {
String nodePath = parentPath + "/" + PathUtils.toString(normalizedNode.getIdentifier());
- if (nodePath.toString().equals(path)) {
+ if (nodePath.equals(path)) {
output = normalizedNode;
}
}
package org.opendaylight.controller.cluster.datastore.node.utils.stream;
import com.google.common.base.Preconditions;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.io.DataOutput;
import java.io.IOException;
import java.io.OutputStream;
}
}
+ @SuppressFBWarnings(value = "BC_UNCONFIRMED_CAST",
+ justification = "The casts in the switch clauses are indirectly confirmed via the determination of 'type'.")
@Override
public void writePathArgument(final PathArgument pathArgument) throws IOException {
if (keyValueMap != null && !keyValueMap.isEmpty()) {
output.writeInt(keyValueMap.size());
- for (QName qname : keyValueMap.keySet()) {
- writeQName(qname);
- writeObject(keyValueMap.get(qname));
+ for (Map.Entry<QName, Object> entry : keyValueMap.entrySet()) {
+ writeQName(entry.getKey());
+ writeObject(entry.getValue());
}
} else {
output.writeInt(0);
import com.google.common.util.concurrent.Futures;
import java.io.IOException;
import java.util.Set;
+import javax.annotation.Nonnull;
import org.opendaylight.controller.cluster.schema.provider.RemoteYangTextSourceProvider;
import org.opendaylight.yangtools.yang.model.repo.api.SchemaRepository;
import org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier;
Futures.addCallback(future, new FutureCallback<YangTextSchemaSource>() {
@Override
- public void onSuccess(YangTextSchemaSource result) {
+ public void onSuccess(@Nonnull YangTextSchemaSource result) {
try {
promise.success(new YangTextSchemaSourceSerializationProxy(result));
} catch (IOException e) {