beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From k...@apache.org
Subject [1/2] incubator-beam git commit: Avoid losing the encoded defaultValue.
Date Tue, 04 Oct 2016 19:28:01 GMT
Repository: incubator-beam
Updated Branches:
  refs/heads/master 8462acbcb -> 087dcef1e


Avoid losing the encoded defaultValue.


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

Branch: refs/heads/master
Commit: 0bd97efc0d764af17cdd8abdf43bff33bb21be2b
Parents: 8462acb
Author: Sela <ansela@paypal.com>
Authored: Tue Oct 4 18:12:38 2016 +0300
Committer: Sela <ansela@paypal.com>
Committed: Tue Oct 4 18:12:38 2016 +0300

----------------------------------------------------------------------
 .../src/main/java/org/apache/beam/sdk/util/PCollectionViews.java  | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/0bd97efc/sdks/java/core/src/main/java/org/apache/beam/sdk/util/PCollectionViews.java
----------------------------------------------------------------------
diff --git a/sdks/java/core/src/main/java/org/apache/beam/sdk/util/PCollectionViews.java b/sdks/java/core/src/main/java/org/apache/beam/sdk/util/PCollectionViews.java
index 14ae5c8..3b1fde9 100644
--- a/sdks/java/core/src/main/java/org/apache/beam/sdk/util/PCollectionViews.java
+++ b/sdks/java/core/src/main/java/org/apache/beam/sdk/util/PCollectionViews.java
@@ -261,10 +261,9 @@ public class PCollectionViews {
       }
       // Lazily decode the default value once
       synchronized (this) {
-        if (encodedDefaultValue != null) {
+        if (encodedDefaultValue != null && defaultValue == null) {
           try {
             defaultValue = CoderUtils.decodeFromByteArray(valueCoder, encodedDefaultValue);
-            encodedDefaultValue = null;
           } catch (IOException e) {
             throw new RuntimeException("Unexpected IOException: ", e);
           }


Mime
View raw message