提交 29ba134e 编写于 作者: C chegar

8021417: Fix doclint issues in java.util.concurrent

Reviewed-by: chegar, lancea
Contributed-by: NDoug Lea <dl@cs.oswego.edu>
上级 a1227484
...@@ -76,6 +76,7 @@ public abstract class AbstractExecutorService implements ExecutorService { ...@@ -76,6 +76,7 @@ public abstract class AbstractExecutorService implements ExecutorService {
* *
* @param runnable the runnable task being wrapped * @param runnable the runnable task being wrapped
* @param value the default value for the returned future * @param value the default value for the returned future
* @param <T> the type of the given value
* @return a {@code RunnableFuture} which, when run, will run the * @return a {@code RunnableFuture} which, when run, will run the
* underlying runnable and which, as a {@code Future}, will yield * underlying runnable and which, as a {@code Future}, will yield
* the given value as its result and provide for cancellation of * the given value as its result and provide for cancellation of
...@@ -90,6 +91,7 @@ public abstract class AbstractExecutorService implements ExecutorService { ...@@ -90,6 +91,7 @@ public abstract class AbstractExecutorService implements ExecutorService {
* Returns a {@code RunnableFuture} for the given callable task. * Returns a {@code RunnableFuture} for the given callable task.
* *
* @param callable the callable task being wrapped * @param callable the callable task being wrapped
* @param <T> the type of the callable's result
* @return a {@code RunnableFuture} which, when run, will call the * @return a {@code RunnableFuture} which, when run, will call the
* underlying callable and which, as a {@code Future}, will yield * underlying callable and which, as a {@code Future}, will yield
* the callable's result as its result and provide for * the callable's result as its result and provide for
......
...@@ -227,6 +227,7 @@ public interface ExecutorService extends Executor { ...@@ -227,6 +227,7 @@ public interface ExecutorService extends Executor {
* {@link Callable} form so they can be submitted. * {@link Callable} form so they can be submitted.
* *
* @param task the task to submit * @param task the task to submit
* @param <T> the type of the task's result
* @return a Future representing pending completion of the task * @return a Future representing pending completion of the task
* @throws RejectedExecutionException if the task cannot be * @throws RejectedExecutionException if the task cannot be
* scheduled for execution * scheduled for execution
...@@ -241,6 +242,7 @@ public interface ExecutorService extends Executor { ...@@ -241,6 +242,7 @@ public interface ExecutorService extends Executor {
* *
* @param task the task to submit * @param task the task to submit
* @param result the result to return * @param result the result to return
* @param <T> the type of the result
* @return a Future representing pending completion of the task * @return a Future representing pending completion of the task
* @throws RejectedExecutionException if the task cannot be * @throws RejectedExecutionException if the task cannot be
* scheduled for execution * scheduled for execution
...@@ -272,6 +274,7 @@ public interface ExecutorService extends Executor { ...@@ -272,6 +274,7 @@ public interface ExecutorService extends Executor {
* collection is modified while this operation is in progress. * collection is modified while this operation is in progress.
* *
* @param tasks the collection of tasks * @param tasks the collection of tasks
* @param <T> the type of the values returned from the tasks
* @return a list of Futures representing the tasks, in the same * @return a list of Futures representing the tasks, in the same
* sequential order as produced by the iterator for the * sequential order as produced by the iterator for the
* given task list, each of which has completed * given task list, each of which has completed
...@@ -299,6 +302,7 @@ public interface ExecutorService extends Executor { ...@@ -299,6 +302,7 @@ public interface ExecutorService extends Executor {
* @param tasks the collection of tasks * @param tasks the collection of tasks
* @param timeout the maximum time to wait * @param timeout the maximum time to wait
* @param unit the time unit of the timeout argument * @param unit the time unit of the timeout argument
* @param <T> the type of the values returned from the tasks
* @return a list of Futures representing the tasks, in the same * @return a list of Futures representing the tasks, in the same
* sequential order as produced by the iterator for the * sequential order as produced by the iterator for the
* given task list. If the operation did not time out, * given task list. If the operation did not time out,
...@@ -324,6 +328,7 @@ public interface ExecutorService extends Executor { ...@@ -324,6 +328,7 @@ public interface ExecutorService extends Executor {
* collection is modified while this operation is in progress. * collection is modified while this operation is in progress.
* *
* @param tasks the collection of tasks * @param tasks the collection of tasks
* @param <T> the type of the values returned from the tasks
* @return the result returned by one of the tasks * @return the result returned by one of the tasks
* @throws InterruptedException if interrupted while waiting * @throws InterruptedException if interrupted while waiting
* @throws NullPointerException if tasks or any element task * @throws NullPointerException if tasks or any element task
...@@ -348,6 +353,7 @@ public interface ExecutorService extends Executor { ...@@ -348,6 +353,7 @@ public interface ExecutorService extends Executor {
* @param tasks the collection of tasks * @param tasks the collection of tasks
* @param timeout the maximum time to wait * @param timeout the maximum time to wait
* @param unit the time unit of the timeout argument * @param unit the time unit of the timeout argument
* @param <T> the type of the values returned from the tasks
* @return the result returned by one of the tasks * @return the result returned by one of the tasks
* @throws InterruptedException if interrupted while waiting * @throws InterruptedException if interrupted while waiting
* @throws NullPointerException if tasks, or unit, or any element * @throws NullPointerException if tasks, or unit, or any element
......
...@@ -397,6 +397,7 @@ public class Executors { ...@@ -397,6 +397,7 @@ public class Executors {
* {@code Callable} to an otherwise resultless action. * {@code Callable} to an otherwise resultless action.
* @param task the task to run * @param task the task to run
* @param result the result to return * @param result the result to return
* @param <T> the type of the result
* @return a callable object * @return a callable object
* @throws NullPointerException if task null * @throws NullPointerException if task null
*/ */
...@@ -458,6 +459,7 @@ public class Executors { ...@@ -458,6 +459,7 @@ public class Executors {
* action; or if not possible, throw an associated {@link * action; or if not possible, throw an associated {@link
* AccessControlException}. * AccessControlException}.
* @param callable the underlying task * @param callable the underlying task
* @param <T> the type of the callable's result
* @return a callable object * @return a callable object
* @throws NullPointerException if callable null * @throws NullPointerException if callable null
*/ */
...@@ -480,6 +482,7 @@ public class Executors { ...@@ -480,6 +482,7 @@ public class Executors {
* AccessControlException}. * AccessControlException}.
* *
* @param callable the underlying task * @param callable the underlying task
* @param <T> the type of the callable's result
* @return a callable object * @return a callable object
* @throws NullPointerException if callable null * @throws NullPointerException if callable null
* @throws AccessControlException if the current access control * @throws AccessControlException if the current access control
......
...@@ -561,8 +561,8 @@ public class ForkJoinPool extends AbstractExecutorService { ...@@ -561,8 +561,8 @@ public class ForkJoinPool extends AbstractExecutorService {
* Returns a new worker thread operating in the given pool. * Returns a new worker thread operating in the given pool.
* *
* @param pool the pool this thread works in * @param pool the pool this thread works in
* @throws NullPointerException if the pool is null
* @return the new worker thread * @return the new worker thread
* @throws NullPointerException if the pool is null
*/ */
public ForkJoinWorkerThread newThread(ForkJoinPool pool); public ForkJoinWorkerThread newThread(ForkJoinPool pool);
} }
...@@ -2497,6 +2497,7 @@ public class ForkJoinPool extends AbstractExecutorService { ...@@ -2497,6 +2497,7 @@ public class ForkJoinPool extends AbstractExecutorService {
* minimally only the latter. * minimally only the latter.
* *
* @param task the task * @param task the task
* @param <T> the type of the task's result
* @return the task's result * @return the task's result
* @throws NullPointerException if the task is null * @throws NullPointerException if the task is null
* @throws RejectedExecutionException if the task cannot be * @throws RejectedExecutionException if the task cannot be
...@@ -2545,6 +2546,7 @@ public class ForkJoinPool extends AbstractExecutorService { ...@@ -2545,6 +2546,7 @@ public class ForkJoinPool extends AbstractExecutorService {
* Submits a ForkJoinTask for execution. * Submits a ForkJoinTask for execution.
* *
* @param task the task to submit * @param task the task to submit
* @param <T> the type of the task's result
* @return the task * @return the task
* @throws NullPointerException if the task is null * @throws NullPointerException if the task is null
* @throws RejectedExecutionException if the task cannot be * @throws RejectedExecutionException if the task cannot be
......
...@@ -810,6 +810,7 @@ public abstract class ForkJoinTask<V> implements Future<V>, Serializable { ...@@ -810,6 +810,7 @@ public abstract class ForkJoinTask<V> implements Future<V>, Serializable {
* unprocessed. * unprocessed.
* *
* @param tasks the collection of tasks * @param tasks the collection of tasks
* @param <T> the type of the values returned from the tasks
* @return the tasks argument, to simplify usage * @return the tasks argument, to simplify usage
* @throws NullPointerException if tasks or any element are null * @throws NullPointerException if tasks or any element are null
*/ */
...@@ -1472,6 +1473,7 @@ public abstract class ForkJoinTask<V> implements Future<V>, Serializable { ...@@ -1472,6 +1473,7 @@ public abstract class ForkJoinTask<V> implements Future<V>, Serializable {
* *
* @param runnable the runnable action * @param runnable the runnable action
* @param result the result upon completion * @param result the result upon completion
* @param <T> the type of the result
* @return the task * @return the task
*/ */
public static <T> ForkJoinTask<T> adapt(Runnable runnable, T result) { public static <T> ForkJoinTask<T> adapt(Runnable runnable, T result) {
...@@ -1485,6 +1487,7 @@ public abstract class ForkJoinTask<V> implements Future<V>, Serializable { ...@@ -1485,6 +1487,7 @@ public abstract class ForkJoinTask<V> implements Future<V>, Serializable {
* encountered into {@code RuntimeException}. * encountered into {@code RuntimeException}.
* *
* @param callable the callable action * @param callable the callable action
* @param <T> the type of the callable's result
* @return the task * @return the task
*/ */
public static <T> ForkJoinTask<T> adapt(Callable<? extends T> callable) { public static <T> ForkJoinTask<T> adapt(Callable<? extends T> callable) {
...@@ -1498,6 +1501,8 @@ public abstract class ForkJoinTask<V> implements Future<V>, Serializable { ...@@ -1498,6 +1501,8 @@ public abstract class ForkJoinTask<V> implements Future<V>, Serializable {
/** /**
* Saves this task to a stream (that is, serializes it). * Saves this task to a stream (that is, serializes it).
* *
* @param s the stream
* @throws java.io.IOException if an I/O error occurs
* @serialData the current run status and the exception thrown * @serialData the current run status and the exception thrown
* during execution, or {@code null} if none * during execution, or {@code null} if none
*/ */
...@@ -1509,6 +1514,10 @@ public abstract class ForkJoinTask<V> implements Future<V>, Serializable { ...@@ -1509,6 +1514,10 @@ public abstract class ForkJoinTask<V> implements Future<V>, Serializable {
/** /**
* Reconstitutes this task from a stream (that is, deserializes it). * Reconstitutes this task from a stream (that is, deserializes it).
* @param s the stream
* @throws ClassNotFoundException if the class of a serialized object
* could not be found
* @throws java.io.IOException if an I/O error occurs
*/ */
private void readObject(java.io.ObjectInputStream s) private void readObject(java.io.ObjectInputStream s)
throws java.io.IOException, ClassNotFoundException { throws java.io.IOException, ClassNotFoundException {
......
...@@ -117,6 +117,7 @@ public interface ScheduledExecutorService extends ExecutorService { ...@@ -117,6 +117,7 @@ public interface ScheduledExecutorService extends ExecutorService {
* @param callable the function to execute * @param callable the function to execute
* @param delay the time from now to delay execution * @param delay the time from now to delay execution
* @param unit the time unit of the delay parameter * @param unit the time unit of the delay parameter
* @param <V> the type of the callable's result
* @return a ScheduledFuture that can be used to extract result or cancel * @return a ScheduledFuture that can be used to extract result or cancel
* @throws RejectedExecutionException if the task cannot be * @throws RejectedExecutionException if the task cannot be
* scheduled for execution * scheduled for execution
......
...@@ -392,6 +392,7 @@ public class ScheduledThreadPoolExecutor ...@@ -392,6 +392,7 @@ public class ScheduledThreadPoolExecutor
* *
* @param runnable the submitted Runnable * @param runnable the submitted Runnable
* @param task the task created to execute the runnable * @param task the task created to execute the runnable
* @param <V> the type of the task's result
* @return a task that can execute the runnable * @return a task that can execute the runnable
* @since 1.6 * @since 1.6
*/ */
...@@ -408,6 +409,7 @@ public class ScheduledThreadPoolExecutor ...@@ -408,6 +409,7 @@ public class ScheduledThreadPoolExecutor
* *
* @param callable the submitted Callable * @param callable the submitted Callable
* @param task the task created to execute the callable * @param task the task created to execute the callable
* @param <V> the type of the task's result
* @return a task that can execute the callable * @return a task that can execute the callable
* @since 1.6 * @since 1.6
*/ */
......
...@@ -69,6 +69,9 @@ package java.util.concurrent; ...@@ -69,6 +69,9 @@ package java.util.concurrent;
* @author Doug Lea * @author Doug Lea
*/ */
public enum TimeUnit { public enum TimeUnit {
/**
* Time unit representing one thousandth of a microsecond
*/
NANOSECONDS { NANOSECONDS {
public long toNanos(long d) { return d; } public long toNanos(long d) { return d; }
public long toMicros(long d) { return d/(C1/C0); } public long toMicros(long d) { return d/(C1/C0); }
...@@ -80,6 +83,10 @@ public enum TimeUnit { ...@@ -80,6 +83,10 @@ public enum TimeUnit {
public long convert(long d, TimeUnit u) { return u.toNanos(d); } public long convert(long d, TimeUnit u) { return u.toNanos(d); }
int excessNanos(long d, long m) { return (int)(d - (m*C2)); } int excessNanos(long d, long m) { return (int)(d - (m*C2)); }
}, },
/**
* Time unit representing one thousandth of a millisecond
*/
MICROSECONDS { MICROSECONDS {
public long toNanos(long d) { return x(d, C1/C0, MAX/(C1/C0)); } public long toNanos(long d) { return x(d, C1/C0, MAX/(C1/C0)); }
public long toMicros(long d) { return d; } public long toMicros(long d) { return d; }
...@@ -91,6 +98,10 @@ public enum TimeUnit { ...@@ -91,6 +98,10 @@ public enum TimeUnit {
public long convert(long d, TimeUnit u) { return u.toMicros(d); } public long convert(long d, TimeUnit u) { return u.toMicros(d); }
int excessNanos(long d, long m) { return (int)((d*C1) - (m*C2)); } int excessNanos(long d, long m) { return (int)((d*C1) - (m*C2)); }
}, },
/**
* Time unit representing one thousandth of a second
*/
MILLISECONDS { MILLISECONDS {
public long toNanos(long d) { return x(d, C2/C0, MAX/(C2/C0)); } public long toNanos(long d) { return x(d, C2/C0, MAX/(C2/C0)); }
public long toMicros(long d) { return x(d, C2/C1, MAX/(C2/C1)); } public long toMicros(long d) { return x(d, C2/C1, MAX/(C2/C1)); }
...@@ -102,6 +113,10 @@ public enum TimeUnit { ...@@ -102,6 +113,10 @@ public enum TimeUnit {
public long convert(long d, TimeUnit u) { return u.toMillis(d); } public long convert(long d, TimeUnit u) { return u.toMillis(d); }
int excessNanos(long d, long m) { return 0; } int excessNanos(long d, long m) { return 0; }
}, },
/**
* Time unit representing one second
*/
SECONDS { SECONDS {
public long toNanos(long d) { return x(d, C3/C0, MAX/(C3/C0)); } public long toNanos(long d) { return x(d, C3/C0, MAX/(C3/C0)); }
public long toMicros(long d) { return x(d, C3/C1, MAX/(C3/C1)); } public long toMicros(long d) { return x(d, C3/C1, MAX/(C3/C1)); }
...@@ -113,6 +128,10 @@ public enum TimeUnit { ...@@ -113,6 +128,10 @@ public enum TimeUnit {
public long convert(long d, TimeUnit u) { return u.toSeconds(d); } public long convert(long d, TimeUnit u) { return u.toSeconds(d); }
int excessNanos(long d, long m) { return 0; } int excessNanos(long d, long m) { return 0; }
}, },
/**
* Time unit representing sixty seconds
*/
MINUTES { MINUTES {
public long toNanos(long d) { return x(d, C4/C0, MAX/(C4/C0)); } public long toNanos(long d) { return x(d, C4/C0, MAX/(C4/C0)); }
public long toMicros(long d) { return x(d, C4/C1, MAX/(C4/C1)); } public long toMicros(long d) { return x(d, C4/C1, MAX/(C4/C1)); }
...@@ -124,6 +143,10 @@ public enum TimeUnit { ...@@ -124,6 +143,10 @@ public enum TimeUnit {
public long convert(long d, TimeUnit u) { return u.toMinutes(d); } public long convert(long d, TimeUnit u) { return u.toMinutes(d); }
int excessNanos(long d, long m) { return 0; } int excessNanos(long d, long m) { return 0; }
}, },
/**
* Time unit representing sixty minutes
*/
HOURS { HOURS {
public long toNanos(long d) { return x(d, C5/C0, MAX/(C5/C0)); } public long toNanos(long d) { return x(d, C5/C0, MAX/(C5/C0)); }
public long toMicros(long d) { return x(d, C5/C1, MAX/(C5/C1)); } public long toMicros(long d) { return x(d, C5/C1, MAX/(C5/C1)); }
...@@ -135,6 +158,10 @@ public enum TimeUnit { ...@@ -135,6 +158,10 @@ public enum TimeUnit {
public long convert(long d, TimeUnit u) { return u.toHours(d); } public long convert(long d, TimeUnit u) { return u.toHours(d); }
int excessNanos(long d, long m) { return 0; } int excessNanos(long d, long m) { return 0; }
}, },
/**
* Time unit representing twenty four hours
*/
DAYS { DAYS {
public long toNanos(long d) { return x(d, C6/C0, MAX/(C6/C0)); } public long toNanos(long d) { return x(d, C6/C0, MAX/(C6/C0)); }
public long toMicros(long d) { return x(d, C6/C1, MAX/(C6/C1)); } public long toMicros(long d) { return x(d, C6/C1, MAX/(C6/C1)); }
......
...@@ -71,6 +71,7 @@ public abstract class AtomicIntegerFieldUpdater<T> { ...@@ -71,6 +71,7 @@ public abstract class AtomicIntegerFieldUpdater<T> {
* *
* @param tclass the class of the objects holding the field * @param tclass the class of the objects holding the field
* @param fieldName the name of the field to be updated * @param fieldName the name of the field to be updated
* @param <U> the type of instances of tclass
* @return the updater * @return the updater
* @throws IllegalArgumentException if the field is not a * @throws IllegalArgumentException if the field is not a
* volatile integer type * volatile integer type
......
...@@ -71,6 +71,7 @@ public abstract class AtomicLongFieldUpdater<T> { ...@@ -71,6 +71,7 @@ public abstract class AtomicLongFieldUpdater<T> {
* *
* @param tclass the class of the objects holding the field * @param tclass the class of the objects holding the field
* @param fieldName the name of the field to be updated * @param fieldName the name of the field to be updated
* @param <U> the type of instances of tclass
* @return the updater * @return the updater
* @throws IllegalArgumentException if the field is not a * @throws IllegalArgumentException if the field is not a
* volatile long type * volatile long type
......
...@@ -91,6 +91,8 @@ public abstract class AtomicReferenceFieldUpdater<T,V> { ...@@ -91,6 +91,8 @@ public abstract class AtomicReferenceFieldUpdater<T,V> {
* @param tclass the class of the objects holding the field * @param tclass the class of the objects holding the field
* @param vclass the class of the field * @param vclass the class of the field
* @param fieldName the name of the field to be updated * @param fieldName the name of the field to be updated
* @param <U> the type of instances of tclass
* @param <W> the type of instances of vclass
* @return the updater * @return the updater
* @throws ClassCastException if the field is of the wrong type * @throws ClassCastException if the field is of the wrong type
* @throws IllegalArgumentException if the field is not volatile * @throws IllegalArgumentException if the field is not volatile
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册