Skip to content

Commit

Permalink
Let Checkstyle run standalone and address Checktyle issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
garydgregory committed Jul 26, 2020
1 parent c49d5b2 commit 8f62ffc
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
18 changes: 11 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@
</properties>

<build>
<defaultGoal>clean verify apache-rat:check japicmp:cmp javadoc:javadoc</defaultGoal>
<defaultGoal>clean verify apache-rat:check checkstyle:check japicmp:cmp javadoc:javadoc</defaultGoal>
<pluginManagement>
<plugins>
<plugin>
Expand Down Expand Up @@ -229,6 +229,16 @@
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.0.0</version>
<configuration>
<configLocation>${basedir}/checkstyle.xml</configLocation>
<enableRulesSummary>false</enableRulesSummary>
<headerLocation>${basedir}/license-header.txt</headerLocation>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
Expand Down Expand Up @@ -334,12 +344,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.0.0</version>
<configuration>
<configLocation>${basedir}/checkstyle.xml</configLocation>
<enableRulesSummary>false</enableRulesSummary>
<headerLocation>${basedir}/license-header.txt</headerLocation>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
Expand Down
12 changes: 10 additions & 2 deletions src/main/java/org/apache/commons/pool2/impl/EvictionTimer.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map.Entry;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.ScheduledThreadPoolExecutor;
Expand Down Expand Up @@ -104,6 +103,7 @@ static synchronized void schedule(
* long should this thread wait for the executor to
* terminate?
* @param unit The units for the specified timeout.
* @param restarting The state of the evictor.
*/
static synchronized void cancel(
final BaseGenericObjectPool<?>.Evictor evictor, final long timeout, final TimeUnit unit, final boolean restarting) {
Expand Down Expand Up @@ -195,10 +195,18 @@ public void run() {
* no longer reachable, run is no-op.
*/
private static class WeakRunner implements Runnable {

private final WeakReference<Runnable> ref;
public WeakRunner(WeakReference<Runnable> ref) {

/**
* Constructs a new instance to track the given reference.
*
* @param ref the reference to track.
*/
private WeakRunner(WeakReference<Runnable> ref) {
this.ref = ref;
}

@Override
public void run() {
final Runnable task = ref.get();
Expand Down

0 comments on commit 8f62ffc

Please sign in to comment.