This patch addresses violations and flips the switch.
Change-Id: I9a0a715b26d42cff395f6448323be1b6e52b162d
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>
-</project>
\ No newline at end of file
+</project>
<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>
public void remove(final @NonNull DOMDataTreeIdentifier prefix) {
final DOMDataTreePrefixTableEntry<V> t = roots.get(prefix.getDatastoreType());
if (t == null) {
- LOG.warn("Shard registration {} points to non-existent table", t);
+ LOG.warn("Shard registration {} points to non-existent table", prefix);
return;
}
import static java.util.Objects.requireNonNull;
import com.google.common.annotations.Beta;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collection;
public final class DefaultDOMRpcResult implements DOMRpcResult, Immutable, Serializable {
private static final long serialVersionUID = 1L;
+ @SuppressFBWarnings(value = "SE_BAD_FIELD", justification = "Interfaces do not specify Serializable")
private final @Nullable NormalizedNode<?, ?> result;
private final Collection<? extends RpcError> errors;
import com.google.common.base.MoreObjects;
import com.google.common.base.MoreObjects.ToStringHelper;
import com.google.common.collect.ImmutableList;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.util.Collection;
import java.util.Optional;
import javax.annotation.concurrent.ThreadSafe;
this.output = output;
}
+ @SuppressFBWarnings("NP_NULL_PARAM_DEREF_NONVIRTUAL")
public SimpleDOMActionResult(final Collection<RpcError> errors) {
this(errors, null);
}
if (size != 0) {
// Note: it is okay to leak changes, we must never leak mutable subtrees.
listener.onDataTreeChanged(changes, ImmutableMap.copyOf(subtrees));
- LOG.trace("Listener {} processed {} changes in {}", listener, clock);
+ LOG.trace("Listener {} processed {} changes in {}", listener, size, clock);
}
}
}
private Map<DOMDataTreeIdentifier, NormalizedNode<?, ?>> subtrees = ImmutableMap.of();
@Override
- protected void append(final State state) {
+ protected synchronized void append(final State state) {
if (state instanceof Changes) {
final Changes changesState = (Changes) state;
this.changes.addAll(changesState.changes);
@Override
protected void notifyListener(final Iterator<State> iterator) {
if (failed) {
- iterator.forEachRemaining(state -> LOG.debug("Listener {} failed, ignoring state {}", state));
+ iterator.forEachRemaining(state -> LOG.debug("Listener {} failed, ignoring state {}", listener, state));
return;
}
import com.google.common.annotations.Beta;
import com.google.common.base.MoreObjects;
import com.google.common.base.MoreObjects.ToStringHelper;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable;
this(identifier, false);
}
+ @SuppressFBWarnings("NP_STORE_INTO_NONNULL_FIELD")
protected AbstractDOMStoreTransaction(final T identifier, final boolean debug) {
this.identifier = requireNonNull(identifier, "Identifier must not be null.");
this.debugContext = debug ? new Throwable().fillInStackTrace() : null;