Add java-doc for implemented methods of io.netty.util.concurrent.Future#cancel(boolean mayInterruptIfRunning)

Motivation:

The methods implement io.netty.util.concurrent.Future#cancel(boolean mayInterruptIfRunning) which actually ignored the param mayInterruptIfRunning.We need to add comments for the `mayInterruptIfRunning` param.

Modifications:

Add comments for the `mayInterruptIfRunning` param.

Result:

People who call the `cancel` method will be more clear about the effect of `mayInterruptIfRunning` param.
This commit is contained in:
Jason 2018-01-25 11:01:55 +08:00 committed by Norman Maurer
parent f5f7e6f9e5
commit 16239d4ea3
4 changed files with 20 additions and 0 deletions

View File

@ -140,6 +140,11 @@ public abstract class CompleteFuture<V> extends AbstractFuture<V> {
return false;
}
/**
* {@inheritDoc}
*
* @param mayInterruptIfRunning this value has no effect in this implementation.
*/
@Override
public boolean cancel(boolean mayInterruptIfRunning) {
return false;

View File

@ -308,6 +308,11 @@ public class DefaultPromise<V> extends AbstractFuture<V> implements Promise<V> {
return (V) result;
}
/**
* {@inheritDoc}
*
* @param mayInterruptIfRunning this value has no effect in this implementation.
*/
@Override
public boolean cancel(boolean mayInterruptIfRunning) {
if (RESULT_UPDATER.compareAndSet(this, null, CANCELLATION_CAUSE_HOLDER)) {

View File

@ -146,6 +146,11 @@ final class ScheduledFutureTask<V> extends PromiseTask<V> implements ScheduledFu
}
}
/**
* {@inheritDoc}
*
* @param mayInterruptIfRunning this value has no effect in this implementation.
*/
@Override
public boolean cancel(boolean mayInterruptIfRunning) {
boolean canceled = super.cancel(mayInterruptIfRunning);

View File

@ -164,6 +164,11 @@ final class VoidChannelPromise extends AbstractFuture<Void> implements ChannelPr
return false;
}
/**
* {@inheritDoc}
*
* @param mayInterruptIfRunning this value has no effect in this implementation.
*/
@Override
public boolean cancel(boolean mayInterruptIfRunning) {
return false;