diff --git a/src/main/org/apache/tools/ant/taskdefs/WaitFor.java b/src/main/org/apache/tools/ant/taskdefs/WaitFor.java index 80f6c2f0d..e4f404b7c 100644 --- a/src/main/org/apache/tools/ant/taskdefs/WaitFor.java +++ b/src/main/org/apache/tools/ant/taskdefs/WaitFor.java @@ -52,14 +52,22 @@ import org.apache.tools.ant.types.EnumeratedAttribute; * @ant.task category="control" */ public class WaitFor extends ConditionBase { + /** a millisecond */ public static final long ONE_MILLISECOND = 1L; + /** a second in milliseconds */ public static final long ONE_SECOND = 1000L; + /** a minute in milliseconds */ public static final long ONE_MINUTE = ONE_SECOND * 60L; + /** an hour in milliseconds */ public static final long ONE_HOUR = ONE_MINUTE * 60L; + /** a day in milliseconds */ public static final long ONE_DAY = ONE_HOUR * 24L; + /** a week in milliseconds */ public static final long ONE_WEEK = ONE_DAY * 7L; + /** default wait time */ public static final long DEFAULT_MAX_WAIT_MILLIS = ONE_MINUTE * 3L; + /** default check time */ public static final long DEFAULT_CHECK_MILLIS = 500L; /** default max wait time in the current unit*/ diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java b/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java index 1417d13b0..d7830c2e5 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java @@ -1080,7 +1080,8 @@ public class JUnitTask extends Task { * @return true if the run should be withoutput and error */ private boolean equalsWithOutAndErr(String summaryOption) { - return summaryOption != null && "withoutanderr".equals(summaryOption.toLowerCase(Locale.ENGLISH)); + return summaryOption != null && "withoutanderr".equals( + summaryOption.toLowerCase(Locale.ENGLISH)); } private void checkIncludeSummary(CommandlineJava cmd) { diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/testing/BlockFor.java b/src/main/org/apache/tools/ant/taskdefs/optional/testing/BlockFor.java index 22399683c..a886457d3 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/testing/BlockFor.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/testing/BlockFor.java @@ -1,9 +1,10 @@ /* - * Copyright 2007 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * @@ -38,7 +39,7 @@ public class BlockFor extends WaitFor { */ public BlockFor() { super("blockfor"); - text=getTaskName()+" timed out"; + text = getTaskName() + " timed out"; } /** diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/testing/BuildTimeoutException.java b/src/main/org/apache/tools/ant/taskdefs/optional/testing/BuildTimeoutException.java index 579ac5dae..3aa83caa5 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/testing/BuildTimeoutException.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/testing/BuildTimeoutException.java @@ -1,9 +1,10 @@ /* - * Copyright 2007 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * @@ -14,6 +15,7 @@ * limitations under the License. * */ + package org.apache.tools.ant.taskdefs.optional.testing; import org.apache.tools.ant.BuildException; diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/testing/Funtest.java b/src/main/org/apache/tools/ant/taskdefs/optional/testing/Funtest.java index 28757b7c2..2c47ac6bc 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/testing/Funtest.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/testing/Funtest.java @@ -1,9 +1,10 @@ /* - * Copyright 2007 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * @@ -38,14 +39,19 @@ import org.apache.tools.ant.taskdefs.WaitFor; *
finally {}
clauses in Java/
*/
- private boolean failOnTeardownErrors=true;
+ private boolean failOnTeardownErrors = true;
/**
@@ -153,7 +162,9 @@ public class Funtest extends Task {
public static final String APPLICATION_FORCIBLY_SHUT_DOWN = "Application forcibly shut down";
/** {@value} */
public static final String SHUTDOWN_INTERRUPTED = "Shutdown interrupted";
- public static final String SKIPPING_TESTS = "Condition failed -skipping tests";
+ /** {@value} */
+ public static final String SKIPPING_TESTS
+ = "Condition failed -skipping tests";
/**
* Log if the definition is overriding something
@@ -224,7 +235,7 @@ public class Funtest extends Task {
}
public void setTimeoutUnit(WaitFor.Unit unit) {
- timeoutUnitMultiplier=unit.getMultiplier();
+ timeoutUnitMultiplier = unit.getMultiplier();
}
public void setShutdownUnit(WaitFor.Unit unit) {
@@ -263,7 +274,7 @@ public class Funtest extends Task {
* @return a bound and initialised parallel instance.
*/
private Parallel newParallel(long parallelTimeout) {
- Parallel par=new Parallel();
+ Parallel par = new Parallel();
bind(par);
par.setFailOnAny(true);
par.setTimeout(parallelTimeout);
@@ -275,7 +286,7 @@ public class Funtest extends Task {
* @param parallelTimeout timeout
* @return a bound and initialised parallel instance.
*/
- private Parallel newParallel(long parallelTimeout,Task child) {
+ private Parallel newParallel(long parallelTimeout, Task child) {
Parallel par = newParallel(parallelTimeout);
par.addTask(child);
return par;
@@ -443,7 +454,7 @@ public class Funtest extends Task {
&& getProject().getProperty(failureProperty) != null) {
//we've failed
log(failureMessage);
- if(taskException == null) {
+ if (taskException == null) {
taskException = new BuildException(failureMessage);
}
}
diff --git a/src/main/org/apache/tools/ant/taskdefs/rmic/DefaultRmicAdapter.java b/src/main/org/apache/tools/ant/taskdefs/rmic/DefaultRmicAdapter.java
index 674bc5b2d..e62015ba7 100644
--- a/src/main/org/apache/tools/ant/taskdefs/rmic/DefaultRmicAdapter.java
+++ b/src/main/org/apache/tools/ant/taskdefs/rmic/DefaultRmicAdapter.java
@@ -209,7 +209,7 @@ public abstract class DefaultRmicAdapter implements RmicAdapter {
cmd.createArgument().setValue("-classpath");
cmd.createArgument().setPath(classpath);
- String stubOption=addStubVersionOptions();
+ String stubOption = addStubVersionOptions();
if (stubOption != null) {
//set the non-null stubOption
cmd.createArgument().setValue(stubOption);
diff --git a/src/main/org/apache/tools/ant/taskdefs/rmic/WLRmic.java b/src/main/org/apache/tools/ant/taskdefs/rmic/WLRmic.java
index 80dc0aa36..613de52ea 100644
--- a/src/main/org/apache/tools/ant/taskdefs/rmic/WLRmic.java
+++ b/src/main/org/apache/tools/ant/taskdefs/rmic/WLRmic.java
@@ -19,8 +19,6 @@
package org.apache.tools.ant.taskdefs.rmic;
import java.lang.reflect.Method;
-import java.util.List;
-import java.util.ArrayList;
import org.apache.tools.ant.AntClassLoader;
import org.apache.tools.ant.BuildException;
@@ -51,6 +49,7 @@ public class WLRmic extends DefaultRmicAdapter {
public static final String WL_RMI_STUB_SUFFIX = "_WLStub";
/** The skeleton suffix */
public static final String WL_RMI_SKEL_SUFFIX = "_WLSkel";
+ /** upsupported error message */
public static final String UNSUPPORTED_STUB_OPTION = "Unsupported stub option: ";
/**
@@ -128,7 +127,8 @@ public class WLRmic extends DefaultRmicAdapter {
//handle the many different stub options.
String stubVersion = getRmic().getStubVersion();
if (null != stubVersion) {
- getRmic().log(UNSUPPORTED_STUB_OPTION + stubVersion,Project.MSG_WARN);
+ getRmic().log(UNSUPPORTED_STUB_OPTION + stubVersion,
+ Project.MSG_WARN);
}
return null;
}
diff --git a/src/main/org/apache/tools/ant/util/WorkerAnt.java b/src/main/org/apache/tools/ant/util/WorkerAnt.java
index 2c66ab53d..9a6b4d85b 100644
--- a/src/main/org/apache/tools/ant/util/WorkerAnt.java
+++ b/src/main/org/apache/tools/ant/util/WorkerAnt.java
@@ -1,9 +1,10 @@
/*
- * Copyright 2007 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@@ -14,6 +15,7 @@
* limitations under the License.
*
*/
+
package org.apache.tools.ant.util;
import org.apache.tools.ant.Task;
@@ -35,7 +37,7 @@ public class WorkerAnt extends Thread {
private Task task;
private Object notify;
- private volatile boolean finished=false;
+ private volatile boolean finished = false;
private volatile BuildException buildException;
private volatile Throwable exception;
@@ -64,12 +66,13 @@ public class WorkerAnt extends Thread {
* @param task the task
*/
public WorkerAnt(Task task) {
- this(task,null);
+ this(task, null);
}
/**
* Get any build exception.
- * This would seem to be oversynchronised, but know that Java pre-1.5 can reorder volatile access.
+ * This would seem to be oversynchronised, but know that Java pre-1.5 can
+ * reorder volatile access.
* The synchronized attribute is to force an ordering.
*
* @return the exception or null
@@ -81,7 +84,7 @@ public class WorkerAnt extends Thread {
/**
* Get whatever was thrown, which may or may not be a buildException.
* Assertion: getException() instanceof BuildException <=> getBuildException()==getException()
- * @return
+ * @return the exception.
*/
public synchronized Throwable getException() {
return exception;
@@ -99,7 +102,8 @@ public class WorkerAnt extends Thread {
/**
* Query the task/thread for being finished.
- * This would seem to be oversynchronised, but know that Java pre-1.5 can reorder volatile access.
+ * This would seem to be oversynchronised, but know that Java pre-1.5 can
+ * reorder volatile access.
* The synchronized attribute is to force an ordering.
* @return true if the task is finished.
*/
@@ -113,8 +117,8 @@ public class WorkerAnt extends Thread {
* @throws InterruptedException if the execution was interrupted
*/
public void waitUntilFinished(long timeout) throws InterruptedException {
- synchronized(notify) {
- if(!finished) {
+ synchronized (notify) {
+ if (!finished) {
notify.wait(timeout);
}
}
@@ -140,9 +144,9 @@ public class WorkerAnt extends Thread {
*/
private synchronized void caught(Throwable thrown) {
exception = thrown;
- buildException = (thrown instanceof BuildException)?
- (BuildException)thrown
- :new BuildException(thrown);
+ buildException = (thrown instanceof BuildException)
+ ? (BuildException) thrown
+ : new BuildException(thrown);
}
/**
@@ -158,7 +162,7 @@ public class WorkerAnt extends Thread {
caught(thrown);
} finally {
synchronized (notify) {
- finished=true;
+ finished = true;
//reset the task.
//wake up our owner, if it is waiting
notify.notifyAll();