From 06e379d7a5f70f1ead9bb3eed49e245a7f717982 Mon Sep 17 00:00:00 2001 From: Andrew Gaul Date: Sat, 12 Dec 2015 08:07:34 +0800 Subject: [PATCH] Remove @Nullable from methods returning primitives Found via error-prone. --- .../java/org/jclouds/cloudwatch/domain/StatisticValues.java | 6 ------ project/pom.xml | 1 + .../jclouds/googlecomputeengine/domain/BackendService.java | 4 ++-- .../org/jclouds/googlecomputeengine/domain/Instance.java | 2 +- .../src/main/java/org/jclouds/softlayer/domain/Address.java | 3 --- .../java/org/jclouds/softlayer/domain/VirtualGuest.java | 1 - 6 files changed, 4 insertions(+), 13 deletions(-) diff --git a/apis/cloudwatch/src/main/java/org/jclouds/cloudwatch/domain/StatisticValues.java b/apis/cloudwatch/src/main/java/org/jclouds/cloudwatch/domain/StatisticValues.java index ee23b5231f..80bb0c442e 100644 --- a/apis/cloudwatch/src/main/java/org/jclouds/cloudwatch/domain/StatisticValues.java +++ b/apis/cloudwatch/src/main/java/org/jclouds/cloudwatch/domain/StatisticValues.java @@ -16,8 +16,6 @@ */ package org.jclouds.cloudwatch.domain; -import org.jclouds.javax.annotation.Nullable; - /** * @see */ @@ -38,7 +36,6 @@ public class StatisticValues { /** * return the maximum value of the sample set */ - @Nullable public double getMaximum() { return maximum; } @@ -46,7 +43,6 @@ public class StatisticValues { /** * return the minimum value of the sample set */ - @Nullable public double getMinimum() { return minimum; } @@ -54,7 +50,6 @@ public class StatisticValues { /** * return the number of samples used for the statistic set */ - @Nullable public double getSampleCount() { return sampleCount; } @@ -62,7 +57,6 @@ public class StatisticValues { /** * return the sum of values for the sample set */ - @Nullable public double getSum() { return sum; } diff --git a/project/pom.xml b/project/pom.xml index 77d40830c2..013ebfc3a3 100644 --- a/project/pom.xml +++ b/project/pom.xml @@ -749,6 +749,7 @@ -Xep:GuiceAssistedInjectScoping:OFF -Xep:LongLiteralLowerCaseSuffix:OFF -Xep:NonAtomicVolatileUpdate:OFF + -Xep:NullablePrimitive:ERROR -Xep:StringEquality:ERROR -Xep:TypeParameterUnusedInFormals:OFF diff --git a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/BackendService.java b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/BackendService.java index f4b15c218a..f6e5c7fda3 100644 --- a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/BackendService.java +++ b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/BackendService.java @@ -72,8 +72,8 @@ public abstract class BackendService { @Nullable public abstract String description(); @Nullable public abstract List backends(); @Nullable public abstract List healthChecks(); - @Nullable public abstract int timeoutSec(); - @Nullable public abstract int port(); + public abstract int timeoutSec(); + public abstract int port(); @Nullable public abstract String protocol(); @Nullable public abstract String fingerprint(); @Nullable public abstract String portName(); diff --git a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Instance.java b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Instance.java index 5ae8f538eb..957f5dcfd0 100644 --- a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Instance.java +++ b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Instance.java @@ -46,7 +46,7 @@ public abstract class Instance { } /** A zero-based index to assign to this disk, where 0 is reserved for the boot disk. */ - @Nullable public abstract int index(); + public abstract int index(); public abstract Type type(); diff --git a/providers/softlayer/src/main/java/org/jclouds/softlayer/domain/Address.java b/providers/softlayer/src/main/java/org/jclouds/softlayer/domain/Address.java index b3effea8ad..57471b9130 100644 --- a/providers/softlayer/src/main/java/org/jclouds/softlayer/domain/Address.java +++ b/providers/softlayer/src/main/java/org/jclouds/softlayer/domain/Address.java @@ -238,7 +238,6 @@ public class Address { /** * @return The id of the account. */ - @Nullable public int getAccountId() { return accountId; } @@ -270,7 +269,6 @@ public class Address { /** * @return The name of the contact. */ - @Nullable public int isActive() { return isActive; } @@ -278,7 +276,6 @@ public class Address { /** * @return The id of the location. */ - @Nullable public int getLocationId() { return locationId; } diff --git a/providers/softlayer/src/main/java/org/jclouds/softlayer/domain/VirtualGuest.java b/providers/softlayer/src/main/java/org/jclouds/softlayer/domain/VirtualGuest.java index 9b2e59676f..66f99a63d9 100644 --- a/providers/softlayer/src/main/java/org/jclouds/softlayer/domain/VirtualGuest.java +++ b/providers/softlayer/src/main/java/org/jclouds/softlayer/domain/VirtualGuest.java @@ -789,7 +789,6 @@ public class VirtualGuest { return this.powerState; } - @Nullable public int getActiveTransactionCount() { return activeTransactionCount; }