Author: peterreilly Date: Fri Nov 2 11:56:20 2007 New Revision: 591425 URL: http://svn.apache.org/viewvc?rev=591425&view=rev Log: checkstyle
Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/WaitFor.java ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/testing/BlockFor.java ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/testing/BuildTimeoutException.java ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/testing/Funtest.java ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/rmic/DefaultRmicAdapter.java ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/rmic/WLRmic.java ant/core/trunk/src/main/org/apache/tools/ant/util/WorkerAnt.java Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/WaitFor.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/WaitFor.java?rev=591425&r1=591424&r2=591425&view=diff ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/WaitFor.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/WaitFor.java Fri Nov 2 11:56:20 2007 @@ -52,14 +52,22 @@ * @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*/ Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java?rev=591425&r1=591424&r2=591425&view=diff ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java Fri Nov 2 11:56:20 2007 @@ -1080,7 +1080,8 @@ * @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) { Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/testing/BlockFor.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/testing/BlockFor.java?rev=591425&r1=591424&r2=591425&view=diff ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/testing/BlockFor.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/testing/BlockFor.java Fri Nov 2 11:56:20 2007 @@ -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 BlockFor() { super("blockfor"); - text=getTaskName()+" timed out"; + text = getTaskName() + " timed out"; } /** Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/testing/BuildTimeoutException.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/testing/BuildTimeoutException.java?rev=591425&r1=591424&r2=591425&view=diff ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/testing/BuildTimeoutException.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/testing/BuildTimeoutException.java Fri Nov 2 11:56:20 2007 @@ -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; Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/testing/Funtest.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/testing/Funtest.java?rev=591425&r1=591424&r2=591425&view=diff ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/testing/Funtest.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/testing/Funtest.java Fri Nov 2 11:56:20 2007 @@ -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 @@ * <li>A reporting sequence that runs after the tests have finished</li> * <li>A "teardown" clause that runs after the rest.</li> * <li>Automated termination of the program it executes, if a timeout is not met</li> - * <li>Checking of a failure property and automatic raising of a fault (with the text in failureText) + * <li>Checking of a failure property and automatic raising of a fault + * (with the text in failureText) * if test shutdown and reporting succeeded</li> * </ul> * - * The task is designed to be framework neutral; it will work with JUnit, TestNG and other test frameworks That can be - * executed from Ant. It bears a resemblance to the FunctionalTest task from SmartFrog, as the attribute names were - * chosen to make migration easier. However, this task benefits from the ability to tweak Ant's internals, and so - * simplify the workflow, and from the experience of using the SmartFrog task. No code has been shared. + * The task is designed to be framework neutral; it will work with JUnit, + * TestNG and other test frameworks That can be + * executed from Ant. It bears a resemblance to the FunctionalTest task from + * SmartFrog, as the attribute names were + * chosen to make migration easier. However, this task benefits from the + * ability to tweak Ant's internals, and so + * simplify the workflow, and from the experience of using the SmartFrog task. + * No code has been shared. * * @since Ant 1.8 */ @@ -53,7 +59,8 @@ public class Funtest extends Task { /** - * A condition that must be true before the tests are run. This makes it easier to define complex tests that only + * A condition that must be true before the tests are run. This makes it + * easier to define complex tests that only * run if certain conditions are met, such as OS or network state. */ private Condition condition; @@ -65,7 +72,8 @@ private Parallel timedTests; /** - * Setup runs if the condition is met. Once setup is complete, teardown will be run when the task finishes + * Setup runs if the condition is met. Once setup is complete, teardown + * will be run when the task finishes */ private Sequential setup; @@ -85,7 +93,8 @@ private Sequential tests; /** - * Reporting only runs if the tests were executed. If the block stopped them, reporting is skipped. + * Reporting only runs if the tests were executed. If the block stopped + * them, reporting is skipped. */ private Sequential reporting; @@ -99,12 +108,12 @@ */ private long timeout; - private long timeoutUnitMultiplier= WaitFor.ONE_MILLISECOND; + private long timeoutUnitMultiplier = WaitFor.ONE_MILLISECOND; /** * time for the execution to time out. */ - private long shutdownTime = 10*WaitFor.ONE_SECOND; + private long shutdownTime = 10 * WaitFor.ONE_SECOND; private long shutdownUnitMultiplier = WaitFor.ONE_MILLISECOND; @@ -116,7 +125,7 @@ /** * Message to send when tests failed */ - private String failureMessage="Tests failed"; + private String failureMessage = "Tests failed"; /** * Flag to set to true if you don't care about any shutdown errors. @@ -125,7 +134,7 @@ * turned into BuildFault events. Similar to catching and ignoring * <code>finally {}</code> clauses in Java/ */ - private boolean failOnTeardownErrors=true; + private boolean failOnTeardownErrors = true; /** @@ -153,7 +162,9 @@ public static final String APPLICATION_FORCIBLY_SHUT_DOWN = "Application forcibly shut down"; /** [EMAIL PROTECTED] */ public static final String SHUTDOWN_INTERRUPTED = "Shutdown interrupted"; - public static final String SKIPPING_TESTS = "Condition failed -skipping tests"; + /** [EMAIL PROTECTED] */ + public static final String SKIPPING_TESTS + = "Condition failed -skipping tests"; /** * Log if the definition is overriding something @@ -224,7 +235,7 @@ } public void setTimeoutUnit(WaitFor.Unit unit) { - timeoutUnitMultiplier=unit.getMultiplier(); + timeoutUnitMultiplier = unit.getMultiplier(); } public void setShutdownUnit(WaitFor.Unit unit) { @@ -263,7 +274,7 @@ * @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 @@ * @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 @@ && getProject().getProperty(failureProperty) != null) { //we've failed log(failureMessage); - if(taskException == null) { + if (taskException == null) { taskException = new BuildException(failureMessage); } } Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/rmic/DefaultRmicAdapter.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/rmic/DefaultRmicAdapter.java?rev=591425&r1=591424&r2=591425&view=diff ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/rmic/DefaultRmicAdapter.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/rmic/DefaultRmicAdapter.java Fri Nov 2 11:56:20 2007 @@ -209,7 +209,7 @@ 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); Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/rmic/WLRmic.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/rmic/WLRmic.java?rev=591425&r1=591424&r2=591425&view=diff ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/rmic/WLRmic.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/rmic/WLRmic.java Fri Nov 2 11:56:20 2007 @@ -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 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 @@ //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; } Modified: ant/core/trunk/src/main/org/apache/tools/ant/util/WorkerAnt.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/util/WorkerAnt.java?rev=591425&r1=591424&r2=591425&view=diff ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/util/WorkerAnt.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/util/WorkerAnt.java Fri Nov 2 11:56:20 2007 @@ -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 @@ 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 @@ * @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 @@ /** * 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 @@ /** * 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 @@ * @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 @@ */ 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 @@ caught(thrown); } finally { synchronized (notify) { - finished=true; + finished = true; //reset the task. //wake up our owner, if it is waiting notify.notifyAll(); --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]