From 59cf1003021f32b3e51dfaa27b7f50fb17f2c8ba Mon Sep 17 00:00:00 2001 From: Narendra Pathai Date: Mon, 29 Aug 2016 12:04:24 +0530 Subject: [PATCH] #403, updated javadocs --- promise/src/main/java/com/iluwatar/promise/Promise.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/promise/src/main/java/com/iluwatar/promise/Promise.java b/promise/src/main/java/com/iluwatar/promise/Promise.java index 3165142fa..e7e56837b 100644 --- a/promise/src/main/java/com/iluwatar/promise/Promise.java +++ b/promise/src/main/java/com/iluwatar/promise/Promise.java @@ -139,7 +139,7 @@ public class Promise extends PromiseSupport { } /** - * A consume action provides the action, the value from source promise and fulfills the + * Accesses the value from source promise and calls the consumer, then fulfills the * destination promise. */ private class ConsumeAction implements Runnable { @@ -166,8 +166,8 @@ public class Promise extends PromiseSupport { } /** - * A function action provides transformation function, value from source promise and fulfills the - * destination promise with the transformed value. + * Accesses the value from source promise, then fulfills the destination promise using the + * transformed value. The source value is transformed using the transformation function. */ private class TransformAction implements Runnable { @@ -184,8 +184,7 @@ public class Promise extends PromiseSupport { @Override public void run() { try { - V result = func.apply(src.get()); - dest.fulfill(result); + dest.fulfill(func.apply(src.get())); } catch (Throwable throwable) { dest.fulfillExceptionally((Exception) throwable.getCause()); }