jkf 2004/12/09 15:06:47
Modified: src/main/org/apache/tools/ant/taskdefs Parallel.java
Log:
Checkstyle updates.
(removed trailing spaces just added, updated javadoc, removed an undocumented
BuildException
which was neither thrown according to interface nor according to methods
implementation.)
Revision Changes Path
1.31 +18 -8 ant/src/main/org/apache/tools/ant/taskdefs/Parallel.java
Index: Parallel.java
===================================================================
RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Parallel.java,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- Parallel.java 9 Dec 2004 22:17:24 -0000 1.30
+++ Parallel.java 9 Dec 2004 23:06:47 -0000 1.31
@@ -56,9 +56,10 @@
/**
* Add a nested task to execute parallel (asynchron).
* <p>
- * @param nestedTask Nested task to be executed in parallel
+ * @param nestedTask Nested task to be executed in parallel.
+ * must not be null.
*/
- public void addTask(Task nestedTask) throws BuildException {
+ public void addTask(Task nestedTask) {
tasks.add(nestedTask);
}
}
@@ -107,6 +108,7 @@
/**
* Add a group of daemon threads
+ * @param daemonTasks The tasks to be executed as daemon.
*/
public void addDaemons(TaskList daemonTasks) {
if (this.daemonTasks != null) {
@@ -266,13 +268,13 @@
}
synchronized (semaphore) {
- // When we leave this block we can be sure all data is really
- // stored in main memory before the new threads start, the new
+ // When we leave this block we can be sure all data is really
+ // stored in main memory before the new threads start, the new
// threads will for sure load the data from main memory.
//
// This probably is slightly paranoid.
}
-
+
synchronized (semaphore) {
// start any daemon threads
if (daemons != null) {
@@ -315,7 +317,7 @@
outer:
while (threadNumber < numTasks && stillRunning) {
for (int i = 0; i < maxRunning; i++) {
- if (running[i] == null || running[i].finished) {
+ if (running[i] == null || running[i].isFinished()) {
running[i] = runnables[threadNumber++];
Thread thread = new Thread(group, running[i]);
thread.start();
@@ -340,7 +342,7 @@
outer2:
while (stillRunning) {
for (int i = 0; i < maxRunning; ++i) {
- if (running[i] != null && !running[i].finished) {
+ if (running[i] != null && !running[i].isFinished()) {
//System.out.println("Thread " + i + " is still
alive ");
// still running - wait for it
try {
@@ -405,7 +407,7 @@
private class TaskRunnable implements Runnable {
private Throwable exception;
private Task task;
- boolean finished;
+ private boolean finished;
/**
* Construct a new TaskRunnable.<p>
@@ -442,6 +444,14 @@
*/
public Throwable getException() {
return exception;
+ }
+
+ /**
+ * Provides the indicator that the task has been finished.
+ * @return Returns true when the task is finished.
+ */
+ boolean isFinished() {
+ return finished;
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]