beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From k...@apache.org
Subject [4/7] beam git commit: NonNull by default in sdk/transforms/display
Date Sat, 28 Oct 2017 16:18:36 GMT
NonNull by default in sdk/transforms/display


Project: http://git-wip-us.apache.org/repos/asf/beam/repo
Commit: http://git-wip-us.apache.org/repos/asf/beam/commit/e25aba8e
Tree: http://git-wip-us.apache.org/repos/asf/beam/tree/e25aba8e
Diff: http://git-wip-us.apache.org/repos/asf/beam/diff/e25aba8e

Branch: refs/heads/master
Commit: e25aba8e776ee85ecec3ebaa49d6c13240911b12
Parents: f9e73db
Author: Kenneth Knowles <klk@google.com>
Authored: Mon Oct 23 19:32:02 2017 -0700
Committer: Kenneth Knowles <klk@google.com>
Committed: Sat Oct 28 08:42:30 2017 -0700

----------------------------------------------------------------------
 .../apache/beam/sdk/transforms/display/DisplayData.java | 12 ++++++------
 .../beam/sdk/transforms/display/package-info.java       |  4 ++++
 2 files changed, 10 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/beam/blob/e25aba8e/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/display/DisplayData.java
----------------------------------------------------------------------
diff --git a/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/display/DisplayData.java
b/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/display/DisplayData.java
index 917c070..1b4b48f 100644
--- a/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/display/DisplayData.java
+++ b/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/display/DisplayData.java
@@ -710,14 +710,14 @@ public class DisplayData implements Serializable {
      */
     private static final FormattedItemValue NULL_VALUES = new FormattedItemValue(null);
 
-    private final Object shortValue;
-    private final Object longValue;
+    @Nullable private final Object shortValue;
+    @Nullable private final Object longValue;
 
-    private FormattedItemValue(Object longValue) {
+    private FormattedItemValue(@Nullable Object longValue) {
       this(longValue, null);
     }
 
-    private FormattedItemValue(Object longValue, Object shortValue) {
+    private FormattedItemValue(@Nullable Object longValue, @Nullable Object shortValue) {
       this.longValue = longValue;
       this.shortValue = shortValue;
     }
@@ -735,8 +735,8 @@ public class DisplayData implements Serializable {
     private final Set<HasDisplayData> visitedComponents;
     private final Map<Path, HasDisplayData> visitedPathMap;
 
-    private Path latestPath;
-    private Class<?> latestNs;
+    @Nullable private Path latestPath;
+    @Nullable private Class<?> latestNs;
 
     private InternalBuilder() {
       this.entries = Maps.newHashMap();

http://git-wip-us.apache.org/repos/asf/beam/blob/e25aba8e/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/display/package-info.java
----------------------------------------------------------------------
diff --git a/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/display/package-info.java
b/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/display/package-info.java
index 4af3327..e4fff40 100644
--- a/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/display/package-info.java
+++ b/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/display/package-info.java
@@ -23,4 +23,8 @@
  *
  * @see org.apache.beam.sdk.transforms.display.HasDisplayData
  */
+@DefaultAnnotation(NonNull.class)
 package org.apache.beam.sdk.transforms.display;
+
+import edu.umd.cs.findbugs.annotations.DefaultAnnotation;
+import edu.umd.cs.findbugs.annotations.NonNull;


Mime
View raw message