#403, updated javadocs

This commit is contained in:
Narendra Pathai 2016-08-29 12:04:24 +05:30
parent ad11ea46b1
commit 59cf100302

View File

@ -139,7 +139,7 @@ public class Promise<T> extends PromiseSupport<T> {
} }
/** /**
* 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. * destination promise.
*/ */
private class ConsumeAction implements Runnable { private class ConsumeAction implements Runnable {
@ -166,8 +166,8 @@ public class Promise<T> extends PromiseSupport<T> {
} }
/** /**
* A function action provides transformation function, value from source promise and fulfills the * Accesses the value from source promise, then fulfills the destination promise using the
* destination promise with the transformed value. * transformed value. The source value is transformed using the transformation function.
*/ */
private class TransformAction<V> implements Runnable { private class TransformAction<V> implements Runnable {
@ -184,8 +184,7 @@ public class Promise<T> extends PromiseSupport<T> {
@Override @Override
public void run() { public void run() {
try { try {
V result = func.apply(src.get()); dest.fulfill(func.apply(src.get()));
dest.fulfill(result);
} catch (Throwable throwable) { } catch (Throwable throwable) {
dest.fulfillExceptionally((Exception) throwable.getCause()); dest.fulfillExceptionally((Exception) throwable.getCause());
} }