Skip to content
Permalink
Browse files

use @findbugs.NonNull annotation from SpotBugs instead of javax (#436)

because of that whole (old) JSR 305 controversy; see e.g.

- findbugsproject/findbugs#88
- spotbugs/spotbugs#130
- spotbugs/spotbugs#180
  • Loading branch information...
vorburger authored and lburgazzoli committed Nov 7, 2018
1 parent b590101 commit 71657020d2c5befc5eb48778e5c234109702651d
@@ -36,15 +36,13 @@

<dependencies>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>annotations</artifactId>
<version>3.0.0</version>
<scope>provided</scope>
<optional>true</optional>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-annotations</artifactId>
<version>3.1.8</version>
<exclusions>
<exclusion>
<artifactId>jcip-annotations</artifactId>
<groupId>net.jcip</groupId>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
</exclusion>
</exclusions>
</dependency>
@@ -16,9 +16,9 @@

package io.etcd.jetcd.launcher;

import edu.umd.cs.findbugs.annotations.NonNull;
import java.net.URI;
import java.util.List;
import javax.annotation.Nonnull;

public interface EtcdCluster extends AutoCloseable {

@@ -27,9 +27,9 @@
@Override
void close();

@Nonnull
@NonNull
List<URI> getClientEndpoints();

@Nonnull
@NonNull
List<URI> getPeerEndpoints();
}
@@ -18,17 +18,17 @@

import static java.util.stream.Collectors.toList;

import edu.umd.cs.findbugs.annotations.NonNull;
import java.net.URI;
import java.util.List;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.stream.IntStream;
import javax.annotation.Nonnull;
import org.testcontainers.containers.Network;

public class EtcdClusterFactory {

public static EtcdCluster buildCluster(@Nonnull String clusterName, int nodes, boolean ssl) {
public static EtcdCluster buildCluster(@NonNull String clusterName, int nodes, boolean ssl) {
final Network network = Network.builder().id(clusterName).build();
final CountDownLatch latch = new CountDownLatch(nodes);
final EtcdContainer.LifecycleListener listener = new EtcdContainer.LifecycleListener() {
@@ -66,13 +66,13 @@ public void close() {
containers.forEach(EtcdContainer::close);
}

@Nonnull
@NonNull
@Override
public List<URI> getClientEndpoints() {
return containers.stream().map(EtcdContainer::clientEndpoint).collect(toList());
}

@Nonnull
@NonNull
@Override
public List<URI> getPeerEndpoints() {
return containers.stream().map(EtcdContainer::peerEndpoint).collect(toList());

0 comments on commit 7165702

Please sign in to comment.
You can’t perform that action at this time.