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 1c7125750b
commit 9dd5c928f3
5 changed files with 25 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

@ -151,6 +151,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

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

View File

@ -138,6 +138,11 @@ final class VoidChannelGroupFuture implements ChannelGroupFuture {
return null;
}
/**
* {@inheritDoc}
*
* @param mayInterruptIfRunning this value has no effect in this implementation.
*/
@Override
public boolean cancel(boolean mayInterruptIfRunning) {
return false;