GIRAPH-1245
closes #137
diff --git a/giraph-core/pom.xml b/giraph-core/pom.xml
index 9a5d890..71d4a85 100644
--- a/giraph-core/pom.xml
+++ b/giraph-core/pom.xml
@@ -141,7 +141,6 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
- <version>3.0.0</version>
<configuration>
<xmlOutput>true</xmlOutput>
<findbugsXmlOutput>false</findbugsXmlOutput>
diff --git a/giraph-core/src/main/java/org/apache/giraph/comm/netty/NettyClient.java b/giraph-core/src/main/java/org/apache/giraph/comm/netty/NettyClient.java
index 103a8ec..229ac1d 100644
--- a/giraph-core/src/main/java/org/apache/giraph/comm/netty/NettyClient.java
+++ b/giraph-core/src/main/java/org/apache/giraph/comm/netty/NettyClient.java
@@ -646,11 +646,13 @@
public void authenticate() {
LOG.info("authenticate: NettyClient starting authentication with " +
"servers.");
- for (InetSocketAddress address: addressChannelMap.keySet()) {
+ for (Map.Entry<InetSocketAddress, ChannelRotater> entry :
+ addressChannelMap.entrySet()) {
if (LOG.isDebugEnabled()) {
- LOG.debug("authenticate: Authenticating with address:" + address);
+ LOG.debug("authenticate: Authenticating with address:" +
+ entry.getKey());
}
- ChannelRotater channelRotater = addressChannelMap.get(address);
+ ChannelRotater channelRotater = entry.getValue();
for (Channel channel: channelRotater.getChannels()) {
if (LOG.isDebugEnabled()) {
LOG.debug("authenticate: Authenticating with server on channel: " +
diff --git a/giraph-core/src/main/java/org/apache/giraph/mapping/LongByteMappingStore.java b/giraph-core/src/main/java/org/apache/giraph/mapping/LongByteMappingStore.java
index ab35cdc..3a62759 100644
--- a/giraph-core/src/main/java/org/apache/giraph/mapping/LongByteMappingStore.java
+++ b/giraph-core/src/main/java/org/apache/giraph/mapping/LongByteMappingStore.java
@@ -21,6 +21,7 @@
import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap;
import java.util.Arrays;
+import java.util.Map;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.atomic.AtomicLong;
@@ -131,8 +132,8 @@
@Override
public void postFilling() {
// not thread-safe
- for (Long id : concurrentIdToBytes.keySet()) {
- idToBytes.put(id, concurrentIdToBytes.get(id));
+ for (Map.Entry<Long, byte[]> entry : concurrentIdToBytes.entrySet()) {
+ idToBytes.put(entry.getKey(), entry.getValue());
}
concurrentIdToBytes.clear();
concurrentIdToBytes = null;
diff --git a/giraph-core/src/main/java/org/apache/giraph/ooc/persistence/LocalDiskDataAccessor.java b/giraph-core/src/main/java/org/apache/giraph/ooc/persistence/LocalDiskDataAccessor.java
index f189def..3b62146 100644
--- a/giraph-core/src/main/java/org/apache/giraph/ooc/persistence/LocalDiskDataAccessor.java
+++ b/giraph-core/src/main/java/org/apache/giraph/ooc/persistence/LocalDiskDataAccessor.java
@@ -109,6 +109,8 @@
public void initialize() { }
@Override
+ @edu.umd.cs.findbugs.annotations.SuppressWarnings(
+ "NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE")
public void shutdown() {
for (String path : basePaths) {
File file = new File(path);
diff --git a/giraph-core/src/main/java/org/apache/giraph/utils/AnnotationUtils.java b/giraph-core/src/main/java/org/apache/giraph/utils/AnnotationUtils.java
index 79bb1c6..06a421b 100644
--- a/giraph-core/src/main/java/org/apache/giraph/utils/AnnotationUtils.java
+++ b/giraph-core/src/main/java/org/apache/giraph/utils/AnnotationUtils.java
@@ -207,6 +207,8 @@
* @param directory Directory from which we are adding files
* @param files List we add files to
*/
+ @edu.umd.cs.findbugs.annotations.SuppressWarnings(
+ "NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE")
private void addAllClassFiles(File directory, List<File> files) {
for (File file : directory.listFiles()) {
if (file.isDirectory()) {
diff --git a/giraph-core/src/main/java/org/apache/giraph/utils/UnsafeArrayReads.java b/giraph-core/src/main/java/org/apache/giraph/utils/UnsafeArrayReads.java
index 2b91502..84cbdeb 100644
--- a/giraph-core/src/main/java/org/apache/giraph/utils/UnsafeArrayReads.java
+++ b/giraph-core/src/main/java/org/apache/giraph/utils/UnsafeArrayReads.java
@@ -34,6 +34,8 @@
* Byte array input stream that uses Unsafe methods to deserialize
* much faster
*/
+@edu.umd.cs.findbugs.annotations.SuppressWarnings(
+ "RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT")
public class UnsafeArrayReads extends UnsafeReads {
/** Access to the unsafe class */
private static final sun.misc.Unsafe UNSAFE;
diff --git a/giraph-core/src/main/java/org/apache/giraph/utils/UnsafeReads.java b/giraph-core/src/main/java/org/apache/giraph/utils/UnsafeReads.java
index 16068fa..50244dd 100644
--- a/giraph-core/src/main/java/org/apache/giraph/utils/UnsafeReads.java
+++ b/giraph-core/src/main/java/org/apache/giraph/utils/UnsafeReads.java
@@ -27,6 +27,8 @@
* Byte array input stream that uses Unsafe methods to deserialize
* much faster
*/
+@edu.umd.cs.findbugs.annotations.SuppressWarnings(
+ "RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT")
public abstract class UnsafeReads extends Input implements ExtendedDataInput {
/**