From 23696f8621db074ace5746375ae8d16fac7f526d Mon Sep 17 00:00:00 2001 From: hitesh sharma Date: Fri, 24 Apr 2020 17:04:13 -0700 Subject: [PATCH] Fix 19 build-time warnings (#236) --- .../com/linkedin/parseq/EventsArrival.java | 3 +-- .../restli/client/ParSeqRestClient.java | 5 +++-- .../linkedin/parseq/zk/client/ZKClient.java | 2 +- .../main/java/com/linkedin/parseq/Engine.java | 22 +++++++++---------- .../main/java/com/linkedin/parseq/Task.java | 2 +- .../com/linkedin/parseq/internal/Clock.java | 2 +- .../internal/PlanDeactivationListener.java | 3 +-- .../parseq/internal/PlatformClock.java | 4 ++-- .../parseq/internal/SystemHiddenTask.java | 5 +++-- 9 files changed, 24 insertions(+), 24 deletions(-) diff --git a/subprojects/parseq-benchmark/src/main/java/com/linkedin/parseq/EventsArrival.java b/subprojects/parseq-benchmark/src/main/java/com/linkedin/parseq/EventsArrival.java index c4c37c2a..f2868140 100644 --- a/subprojects/parseq-benchmark/src/main/java/com/linkedin/parseq/EventsArrival.java +++ b/subprojects/parseq-benchmark/src/main/java/com/linkedin/parseq/EventsArrival.java @@ -11,8 +11,7 @@ public interface EventsArrival { /** - * Returns number of nanoseconds until next arrival. - * @return + * @return The number of nanoseconds until next arrival. */ long nanosToNextEvent(); diff --git a/subprojects/parseq-restli-client/src/main/java/com/linkedin/restli/client/ParSeqRestClient.java b/subprojects/parseq-restli-client/src/main/java/com/linkedin/restli/client/ParSeqRestClient.java index 7054096c..b7c8034f 100644 --- a/subprojects/parseq-restli-client/src/main/java/com/linkedin/restli/client/ParSeqRestClient.java +++ b/subprojects/parseq-restli-client/src/main/java/com/linkedin/restli/client/ParSeqRestClient.java @@ -44,8 +44,9 @@ /** * A ParSeq client that creates a ParSeq task from a rest.li {@link Request} by sending the request to underlying rest.li * {@link Client}. ParSeqRestClient delegates task execution to Rest.li Client {@link Client#sendRequest(Request, Callback)} - * method that takes a {@link PromiseCallbackAdapter}. ParSeq task created from {@link ParSeqRestClient} may fail when - * {@link PromiseCallbackAdapter} receives the following error conditions: + * method that takes a {@link com.linkedin.restli.client.ParSeqRestClient.PromiseCallbackAdapter}. ParSeq task created + * from {@link ParSeqRestClient} may fail when + * {@link com.linkedin.restli.client.ParSeqRestClient.PromiseCallbackAdapter} receives the following error conditions: *

* 1. @{link RestLiResponseExcepion}: Request has reached Rest.li server and rest.li server throws RestLiServiceException. * 2. @{link RemoteInvocationException}: Request failed before reaching rest.li server, for example, RestException thrown diff --git a/subprojects/parseq-zk-client/src/main/java/com/linkedin/parseq/zk/client/ZKClient.java b/subprojects/parseq-zk-client/src/main/java/com/linkedin/parseq/zk/client/ZKClient.java index d948270b..cc25da7b 100644 --- a/subprojects/parseq-zk-client/src/main/java/com/linkedin/parseq/zk/client/ZKClient.java +++ b/subprojects/parseq-zk-client/src/main/java/com/linkedin/parseq/zk/client/ZKClient.java @@ -102,7 +102,7 @@ public interface ZKClient { Task> multi(List ops, Executor executor); /** - * Returns task that will wait for the given {@link Watcher.Event.KeeperState} to fulfill. + * Returns task that will wait for the given {@link org.apache.zookeeper.Watcher.Event.KeeperState} to fulfill. * The task will be failed if the underlying zookeeper session expires. * * @param state keeper state to wait for. diff --git a/subprojects/parseq/src/main/java/com/linkedin/parseq/Engine.java b/subprojects/parseq/src/main/java/com/linkedin/parseq/Engine.java index 75222281..8279c2a9 100644 --- a/subprojects/parseq/src/main/java/com/linkedin/parseq/Engine.java +++ b/subprojects/parseq/src/main/java/com/linkedin/parseq/Engine.java @@ -58,7 +58,7 @@ public class Engine { private static final int DEFUALT_MAX_RELATIONSHIPS_PER_TRACE = 65536; public static final String MAX_CONCURRENT_PLANS = "_MaxConcurrentPlans_"; - private static final int DEFUALT_MAX_CONCURRENT_PLANS = Integer.MAX_VALUE; + private static final int DEFAULT_MAX_CONCURRENT_PLANS = Integer.MAX_VALUE; public static final String DRAIN_SERIAL_EXECUTOR_QUEUE = "_DrainSerialExecutorQueue_"; private static final boolean DEFAULT_DRAIN_SERIAL_EXECUTOR_QUEUE = true; @@ -158,7 +158,7 @@ private static enum StateName { if (_properties.containsKey(MAX_CONCURRENT_PLANS)) { _maxConcurrentPlans = (Integer) getProperty(MAX_CONCURRENT_PLANS); } else { - _maxConcurrentPlans = DEFUALT_MAX_CONCURRENT_PLANS; + _maxConcurrentPlans = DEFAULT_MAX_CONCURRENT_PLANS; } _concurrentPlans = new Semaphore(_maxConcurrentPlans); @@ -289,8 +289,8 @@ private final String defaultPlanClass(final Task task) { * This method throws {@code IllegalStateException} if Engine does not have capacity to run the task. * Engine's capacity is specified by a {@value #MAX_CONCURRENT_PLANS} configuration property. Use * {@link EngineBuilder#setEngineProperty(String, Object)} to set this property. - * For the sake of backwards compatibility default value for a {@value #MAX_CONCURRENT_PLANS} is - * {@value #DEFUALT_MAX_CONCURRENT_PLANS} which essentially means "unbounded capacity". + * For the sake of backwards compatibility default value for a {@link #MAX_CONCURRENT_PLANS} is + * {@link #DEFAULT_MAX_CONCURRENT_PLANS} which essentially means "unbounded capacity". * * @param task the task to run * @throws IllegalStateException @@ -307,7 +307,7 @@ public void run(final Task task) { * Engine's capacity is specified by a {@value #MAX_CONCURRENT_PLANS} configuration property. Use * {@link EngineBuilder#setEngineProperty(String, Object)} to set this property. * For the sake of backwards compatibility default value for a {@value #MAX_CONCURRENT_PLANS} is - * {@value #DEFUALT_MAX_CONCURRENT_PLANS} which essentially means "unbounded capacity". + * {@link #DEFAULT_MAX_CONCURRENT_PLANS} which essentially means "unbounded capacity". * * @param task the task to run * @param planClass string that identifies a "class" of the Plan. Plan class ends up in a ParSeq @@ -328,7 +328,7 @@ public void run(final Task task, final String planClass) { * specified by a {@value #MAX_CONCURRENT_PLANS} configuration property. Use * {@link EngineBuilder#setEngineProperty(String, Object)} to set this property. * For the sake of backwards compatibility default value for a {@value #MAX_CONCURRENT_PLANS} is - * {@value #DEFUALT_MAX_CONCURRENT_PLANS} which essentially means "unbounded capacity". + * {@link #DEFAULT_MAX_CONCURRENT_PLANS} which essentially means "unbounded capacity". * * @param task the task to run */ @@ -344,7 +344,7 @@ public void blockingRun(final Task task) { * specified by a {@value #MAX_CONCURRENT_PLANS} configuration property. Use * {@link EngineBuilder#setEngineProperty(String, Object)} to set this property. * For the sake of backwards compatibility default value for a {@value #MAX_CONCURRENT_PLANS} is - * {@value #DEFUALT_MAX_CONCURRENT_PLANS} which essentially means "unbounded capacity". + * {@link #DEFAULT_MAX_CONCURRENT_PLANS} which essentially means "unbounded capacity". * * @param task the task to run * @param planClass string that identifies a "class" of the Plan. Plan class ends up in a ParSeq @@ -363,7 +363,7 @@ public void blockingRun(final Task task, final String planClass) { * Runs the given task if Engine has a capacity to start new plan as specified by * {@value #MAX_CONCURRENT_PLANS} configuration parameter. * For the sake of backwards compatibility default value for a {@value #MAX_CONCURRENT_PLANS} is - * {@value #DEFUALT_MAX_CONCURRENT_PLANS} which essentially means "unbounded capacity". + * {@link #DEFAULT_MAX_CONCURRENT_PLANS} which essentially means "unbounded capacity". * Task passed in as a parameter becomes a root on a new Plan. * All tasks created and started as a consequence of a root task will belong to that plan and will share a Trace. * This method returns immediately and does not block. It returns {@code true} if Plan was successfully started. @@ -378,7 +378,7 @@ public boolean tryRun(final Task task) { * Runs the given task if Engine has a capacity to start new plan as specified by * {@value #MAX_CONCURRENT_PLANS} configuration parameter. * For the sake of backwards compatibility default value for a {@value #MAX_CONCURRENT_PLANS} is - * {@value #DEFUALT_MAX_CONCURRENT_PLANS} which essentially means "unbounded capacity". + * {@link #DEFAULT_MAX_CONCURRENT_PLANS} which essentially means "unbounded capacity". * Task passed in as a parameter becomes a root on a new Plan. * All tasks created and started as a consequence of a root task will belong to that plan and will share a Trace. * This method returns immediately and does not block. It returns {@code true} if Plan was successfully started. @@ -399,7 +399,7 @@ public boolean tryRun(final Task task, final String planClass) { * Runs the given task if Engine has a capacity to start new plan as specified by * {@value #MAX_CONCURRENT_PLANS} configuration parameter within specified amount of time. * For the sake of backwards compatibility default value for a {@value #MAX_CONCURRENT_PLANS} is - * {@value #DEFUALT_MAX_CONCURRENT_PLANS} which essentially means "unbounded capacity". + * {@link #DEFAULT_MAX_CONCURRENT_PLANS} which essentially means "unbounded capacity". * Task passed in as a parameter becomes a root on a new Plan. * All tasks created and started as a consequence of a root task will belong to that plan and will share a Trace. * If Engine does not have capacity to start the task, this method will block up to specified amount of @@ -419,7 +419,7 @@ public boolean tryRun(final Task task, final long timeout, final TimeUnit uni * Runs the given task if Engine has a capacity to start new plan as specified by * {@value #MAX_CONCURRENT_PLANS} configuration parameter within specified amount of time. * For the sake of backwards compatibility default value for a {@value #MAX_CONCURRENT_PLANS} is - * {@value #DEFUALT_MAX_CONCURRENT_PLANS} which essentially means "unbounded capacity". + * {@link #DEFAULT_MAX_CONCURRENT_PLANS} which essentially means "unbounded capacity". * Task passed in as a parameter becomes a root on a new Plan. * All tasks created and started as a consequence of a root task will belong to that plan and will share a Trace. * If Engine does not have capacity to start the task, this method will block up to specified amount of diff --git a/subprojects/parseq/src/main/java/com/linkedin/parseq/Task.java b/subprojects/parseq/src/main/java/com/linkedin/parseq/Task.java index f41327b0..8a2c57ec 100644 --- a/subprojects/parseq/src/main/java/com/linkedin/parseq/Task.java +++ b/subprojects/parseq/src/main/java/com/linkedin/parseq/Task.java @@ -1372,7 +1372,7 @@ public static Task async(final Function1> f * parameter must signal execution rejection by throwing an exception. *

* In order to prevent blocking ParSeq threads the Executor passed in as a - * parameter must not use {@link ThreadPoolExecutor.CallerRunsPolicy} + * parameter must not use {@link java.util.concurrent.ThreadPoolExecutor.CallerRunsPolicy} * as a rejection policy. * * @param the type of the return value for this task diff --git a/subprojects/parseq/src/main/java/com/linkedin/parseq/internal/Clock.java b/subprojects/parseq/src/main/java/com/linkedin/parseq/internal/Clock.java index a6848dd3..e6d46abb 100644 --- a/subprojects/parseq/src/main/java/com/linkedin/parseq/internal/Clock.java +++ b/subprojects/parseq/src/main/java/com/linkedin/parseq/internal/Clock.java @@ -24,6 +24,6 @@ public interface Clock { * or equal to zero, do not sleep at all. * @throws InterruptedException if interrupted while sleeping */ - void sleepNano(long nao) throws InterruptedException; + void sleepNano(long nano) throws InterruptedException; } diff --git a/subprojects/parseq/src/main/java/com/linkedin/parseq/internal/PlanDeactivationListener.java b/subprojects/parseq/src/main/java/com/linkedin/parseq/internal/PlanDeactivationListener.java index 15e8e9bc..ae2c829a 100644 --- a/subprojects/parseq/src/main/java/com/linkedin/parseq/internal/PlanDeactivationListener.java +++ b/subprojects/parseq/src/main/java/com/linkedin/parseq/internal/PlanDeactivationListener.java @@ -5,8 +5,7 @@ /** * This listener interface allows receiving notifications about plan deactivation. * It can be used for monitoring and to optimize task implementation e.g. to implement batching. - * See {@link EngineBuilder#setPlanActivityListener(PlanDeactivationListener)} - * for details. + * @see EngineBuilder#setPlanDeactivationListener(PlanDeactivationListener) for details * * @author Jaroslaw Odzga (jodzga@linkedin.com) * diff --git a/subprojects/parseq/src/main/java/com/linkedin/parseq/internal/PlatformClock.java b/subprojects/parseq/src/main/java/com/linkedin/parseq/internal/PlatformClock.java index 02a52256..73301cba 100644 --- a/subprojects/parseq/src/main/java/com/linkedin/parseq/internal/PlatformClock.java +++ b/subprojects/parseq/src/main/java/com/linkedin/parseq/internal/PlatformClock.java @@ -16,8 +16,8 @@ public long nanoTime() { } @Override - public void sleepNano(long nao) throws InterruptedException { - TimeUnit.NANOSECONDS.sleep(nao); + public void sleepNano(long nano) throws InterruptedException { + TimeUnit.NANOSECONDS.sleep(nano); } } diff --git a/subprojects/parseq/src/main/java/com/linkedin/parseq/internal/SystemHiddenTask.java b/subprojects/parseq/src/main/java/com/linkedin/parseq/internal/SystemHiddenTask.java index 1c7441d5..d1b25666 100644 --- a/subprojects/parseq/src/main/java/com/linkedin/parseq/internal/SystemHiddenTask.java +++ b/subprojects/parseq/src/main/java/com/linkedin/parseq/internal/SystemHiddenTask.java @@ -1,6 +1,7 @@ package com.linkedin.parseq.internal; import com.linkedin.parseq.BaseTask; +import com.linkedin.parseq.function.Function1; /** @@ -9,8 +10,8 @@ *

* Instead of extending this class consider using * - * {@link com.linkedin.parseq.Task#async(String, com.linkedin.parseq.function.Function1, boolean) Task.async}. - * @see com.linkedin.parseq.Task#async(String, com.linkedin.parseq.function.Function1, boolean) Task.async + * {@link com.linkedin.parseq.Task#async(String, Function1)}. + * @see com.linkedin.parseq.Task#async(String, Function1) */ public abstract class SystemHiddenTask extends BaseTask { protected SystemHiddenTask(String name) {