You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by jh...@apache.org on 2014/07/04 09:17:53 UTC
[11/17] checkstyle
http://git-wip-us.apache.org/repos/asf/ant/blob/1b76f1b6/src/main/org/apache/tools/ant/taskdefs/launcher/CommandLauncher.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/taskdefs/launcher/CommandLauncher.java b/src/main/org/apache/tools/ant/taskdefs/launcher/CommandLauncher.java
index 71b7e60..f39fff0 100644
--- a/src/main/org/apache/tools/ant/taskdefs/launcher/CommandLauncher.java
+++ b/src/main/org/apache/tools/ant/taskdefs/launcher/CommandLauncher.java
@@ -80,7 +80,7 @@ public class CommandLauncher {
/**
* Launches the given command in a new process.
- *
+ *
* @param project
* The project that the command is part of.
* @param cmd
@@ -104,7 +104,7 @@ public class CommandLauncher {
/**
* Launches the given command in a new process, in the given
* working directory.
- *
+ *
* @param project
* The project that the command is part of.
* @param cmd
http://git-wip-us.apache.org/repos/asf/ant/blob/1b76f1b6/src/main/org/apache/tools/ant/taskdefs/launcher/CommandLauncherProxy.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/taskdefs/launcher/CommandLauncherProxy.java b/src/main/org/apache/tools/ant/taskdefs/launcher/CommandLauncherProxy.java
index dce5d40..7a1c877 100644
--- a/src/main/org/apache/tools/ant/taskdefs/launcher/CommandLauncherProxy.java
+++ b/src/main/org/apache/tools/ant/taskdefs/launcher/CommandLauncherProxy.java
@@ -35,7 +35,7 @@ public class CommandLauncherProxy extends CommandLauncher {
/**
* Launches the given command in a new process. Delegates this
* method to the proxied launcher.
- *
+ *
* @param project
* the Ant project.
* @param cmd
http://git-wip-us.apache.org/repos/asf/ant/blob/1b76f1b6/src/main/org/apache/tools/ant/taskdefs/launcher/Java13CommandLauncher.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/taskdefs/launcher/Java13CommandLauncher.java b/src/main/org/apache/tools/ant/taskdefs/launcher/Java13CommandLauncher.java
index df22fb3..e022ade 100644
--- a/src/main/org/apache/tools/ant/taskdefs/launcher/Java13CommandLauncher.java
+++ b/src/main/org/apache/tools/ant/taskdefs/launcher/Java13CommandLauncher.java
@@ -33,7 +33,7 @@ public class Java13CommandLauncher extends CommandLauncher {
/**
* Launches the given command in a new process, in the given
* working directory.
- *
+ *
* @param project
* the Ant project.
* @param cmd
http://git-wip-us.apache.org/repos/asf/ant/blob/1b76f1b6/src/main/org/apache/tools/ant/taskdefs/launcher/MacCommandLauncher.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/taskdefs/launcher/MacCommandLauncher.java b/src/main/org/apache/tools/ant/taskdefs/launcher/MacCommandLauncher.java
index 7794176..02a8e78 100644
--- a/src/main/org/apache/tools/ant/taskdefs/launcher/MacCommandLauncher.java
+++ b/src/main/org/apache/tools/ant/taskdefs/launcher/MacCommandLauncher.java
@@ -34,7 +34,7 @@ public class MacCommandLauncher extends CommandLauncherProxy {
/**
* Launches the given command in a new process, in the given
* working directory.
- *
+ *
* @param project
* the Ant project.
* @param cmd
http://git-wip-us.apache.org/repos/asf/ant/blob/1b76f1b6/src/main/org/apache/tools/ant/taskdefs/launcher/OS2CommandLauncher.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/taskdefs/launcher/OS2CommandLauncher.java b/src/main/org/apache/tools/ant/taskdefs/launcher/OS2CommandLauncher.java
index 24be3cb..75ecaa3 100644
--- a/src/main/org/apache/tools/ant/taskdefs/launcher/OS2CommandLauncher.java
+++ b/src/main/org/apache/tools/ant/taskdefs/launcher/OS2CommandLauncher.java
@@ -37,7 +37,7 @@ public class OS2CommandLauncher extends CommandLauncherProxy {
/**
* Launches the given command in a new process, in the given
* working directory.
- *
+ *
* @param project
* the Ant project.
* @param cmd
http://git-wip-us.apache.org/repos/asf/ant/blob/1b76f1b6/src/main/org/apache/tools/ant/taskdefs/launcher/PerlScriptCommandLauncher.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/taskdefs/launcher/PerlScriptCommandLauncher.java b/src/main/org/apache/tools/ant/taskdefs/launcher/PerlScriptCommandLauncher.java
index d624d76..d5b06f7 100644
--- a/src/main/org/apache/tools/ant/taskdefs/launcher/PerlScriptCommandLauncher.java
+++ b/src/main/org/apache/tools/ant/taskdefs/launcher/PerlScriptCommandLauncher.java
@@ -38,7 +38,7 @@ public class PerlScriptCommandLauncher extends CommandLauncherProxy {
/**
* Launches the given command in a new process, in the given
* working directory.
- *
+ *
* @param project
* the Ant project.
* @param cmd
http://git-wip-us.apache.org/repos/asf/ant/blob/1b76f1b6/src/main/org/apache/tools/ant/taskdefs/launcher/ScriptCommandLauncher.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/taskdefs/launcher/ScriptCommandLauncher.java b/src/main/org/apache/tools/ant/taskdefs/launcher/ScriptCommandLauncher.java
index ee0a966..936f948 100644
--- a/src/main/org/apache/tools/ant/taskdefs/launcher/ScriptCommandLauncher.java
+++ b/src/main/org/apache/tools/ant/taskdefs/launcher/ScriptCommandLauncher.java
@@ -38,7 +38,7 @@ public class ScriptCommandLauncher extends CommandLauncherProxy {
/**
* Launches the given command in a new process, in the given
* working directory.
- *
+ *
* @param project
* the Ant project.
* @param cmd
http://git-wip-us.apache.org/repos/asf/ant/blob/1b76f1b6/src/main/org/apache/tools/ant/taskdefs/launcher/VmsCommandLauncher.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/taskdefs/launcher/VmsCommandLauncher.java b/src/main/org/apache/tools/ant/taskdefs/launcher/VmsCommandLauncher.java
index 9d953db..4c1b3f0 100644
--- a/src/main/org/apache/tools/ant/taskdefs/launcher/VmsCommandLauncher.java
+++ b/src/main/org/apache/tools/ant/taskdefs/launcher/VmsCommandLauncher.java
@@ -38,7 +38,7 @@ public class VmsCommandLauncher extends Java13CommandLauncher {
/**
* Launches the given command in a new process.
- *
+ *
* @param project
* the Ant project.
* @param cmd
@@ -63,7 +63,7 @@ public class VmsCommandLauncher extends Java13CommandLauncher {
* working directory. Note that under Java 1.4.0 and 1.4.1 on VMS
* this method only works if <code>workingDir</code> is null or
* the logical JAVA$FORK_SUPPORT_CHDIR needs to be set to TRUE.
- *
+ *
* @param project
* the Ant project.
* @param cmd
http://git-wip-us.apache.org/repos/asf/ant/blob/1b76f1b6/src/main/org/apache/tools/ant/taskdefs/launcher/WinNTCommandLauncher.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/taskdefs/launcher/WinNTCommandLauncher.java b/src/main/org/apache/tools/ant/taskdefs/launcher/WinNTCommandLauncher.java
index aeea46a..65abafc 100644
--- a/src/main/org/apache/tools/ant/taskdefs/launcher/WinNTCommandLauncher.java
+++ b/src/main/org/apache/tools/ant/taskdefs/launcher/WinNTCommandLauncher.java
@@ -35,7 +35,7 @@ public class WinNTCommandLauncher extends CommandLauncherProxy {
/**
* Launches the given command in a new process, in the given
* working directory.
- *
+ *
* @param project
* the Ant project.
* @param cmd
http://git-wip-us.apache.org/repos/asf/ant/blob/1b76f1b6/src/main/org/apache/tools/ant/taskdefs/optional/PropertyFile.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/PropertyFile.java b/src/main/org/apache/tools/ant/taskdefs/optional/PropertyFile.java
index dec296a..13f6b8f 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/PropertyFile.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/PropertyFile.java
@@ -71,9 +71,9 @@ import org.apache.tools.ant.util.LayoutPreservingProperties;
* </ul>
* Other parameters are:
* <ul>
- * <li>comment</li>
- * <li>key</li>
- * <li>operation</li>
+ * <li>comment</li>
+ * <li>key</li>
+ * <li>operation</li>
* <li>type</li>
* <li>value (the final four being eliminated shortly)</li>
* </ul>
@@ -155,7 +155,8 @@ public class PropertyFile extends Task {
* Execute the task.
* @throws BuildException on error.
*/
- public void execute() throws BuildException {
+ @Override
+ public void execute() throws BuildException {
checkParameters();
readFile();
executeOperation();
@@ -378,7 +379,7 @@ public class PropertyFile extends Task {
*/
protected void executeOn(Properties props) throws BuildException {
checkParameters();
-
+
if (operation == Operation.DELETE_OPER) {
props.remove(key);
return;
@@ -614,7 +615,8 @@ public class PropertyFile extends Task {
public static final int DELETE_OPER = 3;
/** {@inheritDoc}. */
- public String[] getValues() {
+ @Override
+ public String[] getValues() {
return new String[] {"+", "-", "=", "del"};
}
@@ -649,7 +651,8 @@ public class PropertyFile extends Task {
public static final int STRING_TYPE = 2;
/** {@inheritDoc} */
- public String[] getValues() {
+ @Override
+ public String[] getValues() {
return new String[] {"int", "date", "string"};
}
@@ -715,7 +718,8 @@ public class PropertyFile extends Task {
}
/** {@inheritDoc}. */
- public String[] getValues() {
+ @Override
+ public String[] getValues() {
return UNITS;
}
}
http://git-wip-us.apache.org/repos/asf/ant/blob/1b76f1b6/src/main/org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.java b/src/main/org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.java
index 726ceee..64e552b 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.java
@@ -213,7 +213,7 @@ public class ReplaceRegExp extends Task {
* want to only replace the first occurrence of a regular expression on
* each line, which is not easy to do when processing the file as a whole.
* Defaults to <i>false</i>.
- *
+ *
* @param byline the byline attribute as a string
* @deprecated since 1.6.x.
* Use setByLine(boolean).
@@ -234,7 +234,7 @@ public class ReplaceRegExp extends Task {
* want to only replace the first occurrence of a regular expression on
* each line, which is not easy to do when processing the file as a whole.
* Defaults to <i>false</i>.
- *
+ *
* @param byline the byline attribute
*/
public void setByLine(boolean byline) {
@@ -465,7 +465,8 @@ public class ReplaceRegExp extends Task {
*
* @throws BuildException is there is a problem in the task execution.
*/
- public void execute() throws BuildException {
+ @Override
+ public void execute() throws BuildException {
if (regex == null) {
throw new BuildException("No expression to match.");
}
http://git-wip-us.apache.org/repos/asf/ant/blob/1b76f1b6/src/main/org/apache/tools/ant/taskdefs/optional/TraXLiaison.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/TraXLiaison.java b/src/main/org/apache/tools/ant/taskdefs/optional/TraXLiaison.java
index 9f6c3d7..111e79b 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/TraXLiaison.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/TraXLiaison.java
@@ -143,7 +143,8 @@ public class TraXLiaison implements XSLTLiaison4, ErrorListener, XSLTLoggerAware
* @param stylesheet a <code>File</code> value
* @throws Exception on error
*/
- public void setStylesheet(File stylesheet) throws Exception {
+ @Override
+ public void setStylesheet(File stylesheet) throws Exception {
FileResource fr = new FileResource();
fr.setProject(project);
fr.setFile(stylesheet);
@@ -155,7 +156,8 @@ public class TraXLiaison implements XSLTLiaison4, ErrorListener, XSLTLoggerAware
* @param stylesheet a {@link org.apache.tools.ant.types.Resource} value
* @throws Exception on error
*/
- public void setStylesheet(Resource stylesheet) throws Exception {
+ @Override
+ public void setStylesheet(Resource stylesheet) throws Exception {
if (this.stylesheet != null) {
// resetting the stylesheet - reset transformer
transformer = null;
@@ -175,7 +177,8 @@ public class TraXLiaison implements XSLTLiaison4, ErrorListener, XSLTLoggerAware
* @param outfile the result file
* @throws Exception on error
*/
- public void transform(File infile, File outfile) throws Exception {
+ @Override
+ public void transform(File infile, File outfile) throws Exception {
if (transformer == null) {
createTransformer();
}
@@ -504,17 +507,19 @@ public class TraXLiaison implements XSLTLiaison4, ErrorListener, XSLTLoggerAware
* @param name the name of the parameter
* @param value the value of the parameter
*/
- public void addParam(String name, String value) {
+ @Override
+ public void addParam(String name, String value) {
params.put(name, value);
}
-
+
/**
* Add a parameter.
* @param name the name of the parameter
* @param value the value of the parameter
* @since Ant 1.9.3
*/
- public void addParam(String name, Object value) {
+ @Override
+ public void addParam(String name, Object value) {
params.put(name, value);
}
@@ -522,7 +527,8 @@ public class TraXLiaison implements XSLTLiaison4, ErrorListener, XSLTLoggerAware
* Set a logger.
* @param l a logger.
*/
- public void setLogger(XSLTLogger l) {
+ @Override
+ public void setLogger(XSLTLogger l) {
logger = l;
}
@@ -530,7 +536,8 @@ public class TraXLiaison implements XSLTLiaison4, ErrorListener, XSLTLoggerAware
* Log an error.
* @param e the exception to log.
*/
- public void error(TransformerException e) {
+ @Override
+ public void error(TransformerException e) {
logError(e, "Error");
}
@@ -538,7 +545,8 @@ public class TraXLiaison implements XSLTLiaison4, ErrorListener, XSLTLoggerAware
* Log a fatal error.
* @param e the exception to log.
*/
- public void fatalError(TransformerException e) {
+ @Override
+ public void fatalError(TransformerException e) {
logError(e, "Fatal Error");
throw new BuildException("Fatal error during transformation using " + stylesheet + ": " + e.getMessageAndLocation(), e);
}
@@ -547,7 +555,8 @@ public class TraXLiaison implements XSLTLiaison4, ErrorListener, XSLTLoggerAware
* Log a warning.
* @param e the exception to log.
*/
- public void warning(TransformerException e) {
+ @Override
+ public void warning(TransformerException e) {
if (!suppressWarnings) {
logError(e, "Warning");
}
@@ -601,7 +610,8 @@ public class TraXLiaison implements XSLTLiaison4, ErrorListener, XSLTLoggerAware
* @deprecated since 1.5.x.
* Use org.apache.tools.ant.util.JAXPUtils#getSystemId instead.
*/
- protected String getSystemId(File file) {
+ @Deprecated
+ protected String getSystemId(File file) {
return JAXPUtils.getSystemId(file);
}
@@ -611,7 +621,8 @@ public class TraXLiaison implements XSLTLiaison4, ErrorListener, XSLTLoggerAware
* @param xsltTask the XSLTProcess task instance from which this liasion
* is to be configured.
*/
- public void configure(XSLTProcess xsltTask) {
+ @Override
+ public void configure(XSLTProcess xsltTask) {
project = xsltTask.getProject();
XSLTProcess.Factory factory = xsltTask.getFactory();
if (factory != null) {
http://git-wip-us.apache.org/repos/asf/ant/blob/1b76f1b6/src/main/org/apache/tools/ant/taskdefs/optional/depend/constantpool/MethodTypeCPInfo.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/depend/constantpool/MethodTypeCPInfo.java b/src/main/org/apache/tools/ant/taskdefs/optional/depend/constantpool/MethodTypeCPInfo.java
index 54ec522..857c484 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/depend/constantpool/MethodTypeCPInfo.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/depend/constantpool/MethodTypeCPInfo.java
@@ -43,7 +43,8 @@ public class MethodTypeCPInfo extends ConstantCPInfo {
* @exception java.io.IOException if there is a problem reading the entry from
* the stream.
*/
- public void read(DataInputStream cpStream) throws IOException {
+ @Override
+ public void read(final DataInputStream cpStream) throws IOException {
methodDescriptorIndex = cpStream.readUnsignedShort();
}
@@ -54,8 +55,9 @@ public class MethodTypeCPInfo extends ConstantCPInfo {
* @param constantPool the constant pool of which this entry is a member
* and against which this entry is to be resolved.
*/
- public void resolve(ConstantPool constantPool) {
- Utf8CPInfo methodClass
+ @Override
+ public void resolve(final ConstantPool constantPool) {
+ final Utf8CPInfo methodClass
= (Utf8CPInfo) constantPool.getEntry(methodDescriptorIndex);
methodClass.resolve(constantPool);
methodDescriptor = methodClass.getValue();
@@ -66,8 +68,9 @@ public class MethodTypeCPInfo extends ConstantCPInfo {
*
* @return the string representation of this constant pool entry.
*/
- public String toString() {
- if (! isResolved()) {
+ @Override
+ public String toString() {
+ if (!isResolved()) {
return "MethodDescriptorIndex: " + methodDescriptorIndex;
} else {
return "MethodDescriptor: " + methodDescriptor;
http://git-wip-us.apache.org/repos/asf/ant/blob/1b76f1b6/src/main/org/apache/tools/ant/taskdefs/optional/ejb/IPlanetDeploymentTool.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/ejb/IPlanetDeploymentTool.java b/src/main/org/apache/tools/ant/taskdefs/optional/ejb/IPlanetDeploymentTool.java
index 7db731d..193f32c 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/ejb/IPlanetDeploymentTool.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/ejb/IPlanetDeploymentTool.java
@@ -166,7 +166,8 @@ public class IPlanetDeploymentTool extends GenericDeploymentTool {
* @param inString the string to use as the suffix. This parameter is
* ignored.
*/
- public void setGenericJarSuffix(String inString) {
+ @Override
+ public void setGenericJarSuffix(String inString) {
log("Since a generic JAR file is not created during processing, the "
+ "iPlanet Deployment Tool does not support the "
+ "\"genericjarsuffix\" attribute. It will be ignored.",
@@ -174,7 +175,8 @@ public class IPlanetDeploymentTool extends GenericDeploymentTool {
}
/** {@inheritDoc}. */
- public void processDescriptor(String descriptorName, SAXParser saxParser) {
+ @Override
+ public void processDescriptor(String descriptorName, SAXParser saxParser) {
this.descriptorName = descriptorName;
this.iasDescriptorName = null;
@@ -193,7 +195,8 @@ public class IPlanetDeploymentTool extends GenericDeploymentTool {
* descriptor
* @throws BuildException If the user selections are invalid.
*/
- protected void checkConfiguration(String descriptorFileName,
+ @Override
+ protected void checkConfiguration(String descriptorFileName,
SAXParser saxParser) throws BuildException {
int startOfName = descriptorFileName.lastIndexOf(File.separatorChar) + 1;
@@ -236,7 +239,8 @@ public class IPlanetDeploymentTool extends GenericDeploymentTool {
* @throws SAXException Any SAX exception, possibly wrapping another
* exception
*/
- protected Hashtable parseEjbFiles(String descriptorFileName,
+ @Override
+ protected Hashtable parseEjbFiles(String descriptorFileName,
SAXParser saxParser) throws IOException, SAXException {
Hashtable files;
@@ -257,7 +261,7 @@ public class IPlanetDeploymentTool extends GenericDeploymentTool {
}
if (getConfig().dtdLocations != null) {
for (Iterator i = getConfig().dtdLocations.iterator();
- i.hasNext(); ) {
+ i.hasNext();) {
EjbJar.DTDLocation dtdLocation =
(EjbJar.DTDLocation) i.next();
ejbc.registerDTD(dtdLocation.getPublicId(),
@@ -308,7 +312,8 @@ public class IPlanetDeploymentTool extends GenericDeploymentTool {
* the completed JAR file.
* @param ddPrefix not used
*/
- protected void addVendorFiles(Hashtable ejbFiles, String ddPrefix) {
+ @Override
+ protected void addVendorFiles(Hashtable ejbFiles, String ddPrefix) {
ejbFiles.put(META_DIR + IAS_DD, new File(getConfig().descriptorDir,
getIasDescriptorName()));
}
@@ -322,7 +327,8 @@ public class IPlanetDeploymentTool extends GenericDeploymentTool {
*
* @return File representing the JAR file which will be written.
*/
- File getVendorOutputJarFile(String baseName) {
+ @Override
+ File getVendorOutputJarFile(String baseName) {
File jarFile = new File(getDestDir(), baseName + jarSuffix);
log("JAR file name: " + jarFile.toString(), Project.MSG_VERBOSE);
return jarFile;
@@ -335,7 +341,8 @@ public class IPlanetDeploymentTool extends GenericDeploymentTool {
*
* @return <code>null</code>.
*/
- protected String getPublicId() {
+ @Override
+ protected String getPublicId() {
return null;
}
http://git-wip-us.apache.org/repos/asf/ant/blob/1b76f1b6/src/main/org/apache/tools/ant/taskdefs/optional/ejb/IPlanetEjbc.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/ejb/IPlanetEjbc.java b/src/main/org/apache/tools/ant/taskdefs/optional/ejb/IPlanetEjbc.java
index caf0b43..ed799d3 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/ejb/IPlanetEjbc.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/ejb/IPlanetEjbc.java
@@ -37,7 +37,6 @@ import java.util.StringTokenizer;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
-import org.apache.tools.ant.BuildException;
import org.xml.sax.AttributeList;
import org.xml.sax.HandlerBase;
import org.xml.sax.InputSource;
http://git-wip-us.apache.org/repos/asf/ant/blob/1b76f1b6/src/main/org/apache/tools/ant/taskdefs/optional/extension/ExtensionSet.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/extension/ExtensionSet.java b/src/main/org/apache/tools/ant/taskdefs/optional/extension/ExtensionSet.java
index 3786c66..676c707 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/extension/ExtensionSet.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/extension/ExtensionSet.java
@@ -113,7 +113,8 @@ public class ExtensionSet
* @param reference the reference to which this instance is associated
* @exception BuildException if this instance already has been configured.
*/
- public void setRefid(final Reference reference)
+ @Override
+ public void setRefid(final Reference reference)
throws BuildException {
if (!extensions.isEmpty() || !extensionsFilesets.isEmpty()) {
throw tooManyAttributes();
@@ -121,7 +122,8 @@ public class ExtensionSet
super.setRefid(reference);
}
- protected synchronized void dieOnCircularReference(Stack stk, Project p)
+ @Override
+ protected synchronized void dieOnCircularReference(Stack stk, Project p)
throws BuildException {
if (isChecked()) {
return;
@@ -129,11 +131,11 @@ public class ExtensionSet
if (isReference()) {
super.dieOnCircularReference(stk, p);
} else {
- for (Iterator i = extensions.iterator(); i.hasNext(); ) {
+ for (Iterator i = extensions.iterator(); i.hasNext();) {
pushAndInvokeCircularReferenceCheck((ExtensionAdapter) i.next(),
stk, p);
}
- for (Iterator i = extensionsFilesets.iterator(); i.hasNext(); ) {
+ for (Iterator i = extensionsFilesets.iterator(); i.hasNext();) {
pushAndInvokeCircularReferenceCheck((FileSet) i.next(), stk, p);
}
setChecked(true);
@@ -144,7 +146,8 @@ public class ExtensionSet
* @see java.lang.Object#toString()
* @return the extensions in a string.
*/
- public String toString() {
+ @Override
+ public String toString() {
return "ExtensionSet" + Arrays.asList(toExtensions(getProject()));
}
}
http://git-wip-us.apache.org/repos/asf/ant/blob/1b76f1b6/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnit4TestMethodAdapter.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnit4TestMethodAdapter.java b/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnit4TestMethodAdapter.java
index 4b52689..71068e9 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnit4TestMethodAdapter.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnit4TestMethodAdapter.java
@@ -48,7 +48,7 @@ public class JUnit4TestMethodAdapter implements Test {
/**
* Creates a new adapter for the given class and a method within the class.
- *
+ *
* @param testClass test class containing the method to be executed
* @param methodNames names of the test methods that are to be executed
* @exception java.lang.IllegalArgumentException
@@ -72,7 +72,7 @@ public class JUnit4TestMethodAdapter implements Test {
}
}
this.testClass = testClass;
- this.methodNames = (String[]) methodNames.clone();
+ this.methodNames = methodNames.clone();
this.cache = CustomJUnit4TestAdapterCache.getInstance();
// Warning: If 'testClass' is an old-style (pre-JUnit-4) class,
@@ -87,7 +87,8 @@ public class JUnit4TestMethodAdapter implements Test {
runner = request.getRunner();
}
- public int countTestCases() {
+ @Override
+ public int countTestCases() {
return runner.testCount();
}
@@ -103,11 +104,13 @@ public class JUnit4TestMethodAdapter implements Test {
return testClass;
}
- public void run(final TestResult result) {
+ @Override
+ public void run(final TestResult result) {
runner.run(cache.getNotifier(result));
}
- public String toString() {
+ @Override
+ public String toString() {
String testClassName = testClass.getName();
StringBuilder buf = new StringBuilder(testClassName.length()
+ 12 * methodNames.length)
@@ -144,7 +147,8 @@ public class JUnit4TestMethodAdapter implements Test {
this.methodNames = methodNames;
}
- public boolean shouldRun(Description description) {
+ @Override
+ public boolean shouldRun(Description description) {
if (methodNames.length == 0) {
return false;
}
@@ -165,10 +169,11 @@ public class JUnit4TestMethodAdapter implements Test {
}
}
}
- return false;
+ return false;
}
- public String describe() {
+ @Override
+ public String describe() {
StringBuilder buf = new StringBuilder(40);
if (methodNames.length == 0) {
buf.append("No methods");
http://git-wip-us.apache.org/repos/asf/ant/blob/1b76f1b6/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java
----------------------------------------------------------------------
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 1ecbeba..2b41f8e 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
@@ -364,7 +364,8 @@ public class JUnitTask extends Task {
* list the possible values
* @return array of allowed values
*/
- public String[] getValues() {
+ @Override
+ public String[] getValues() {
return new String[] {"true", "yes", "false", "no",
"on", "off", "withOutAndErr"};
}
@@ -455,7 +456,8 @@ public class JUnitTask extends Task {
* @deprecated since ant 1.6
* @param sysp environment variable to add
*/
- public void addSysproperty(Environment.Variable sysp) {
+ @Deprecated
+ public void addSysproperty(Environment.Variable sysp) {
getCommandline().addSysproperty(sysp);
}
@@ -703,7 +705,7 @@ public class JUnitTask extends Task {
* Whether test listener events shall be generated.
*
* <p>Defaults to false.</p>
- *
+ *
* <p>This value will be overridden by the magic property
* ant.junit.enabletestlistenerevents if it has been set.</p>
*
@@ -732,7 +734,8 @@ public class JUnitTask extends Task {
*
* @since Ant 1.4
*/
- public void init() {
+ @Override
+ public void init() {
antRuntimeClasses = new Path(getProject());
splitJUnit = !addClasspathResource("/junit/framework/TestCase.class");
addClasspathEntry("/org/apache/tools/ant/launch/AntMain.class");
@@ -779,7 +782,8 @@ public class JUnitTask extends Task {
path.add(extra);
}
mirrorLoader = (ClassLoader) AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
+ @Override
+ public Object run() {
return new SplitClassLoader(myLoader, path, getProject(),
new String[] {
"BriefJUnitResultFormatter",
@@ -812,7 +816,8 @@ public class JUnitTask extends Task {
* @throws BuildException in case of test failures or errors
* @since Ant 1.2
*/
- public void execute() throws BuildException {
+ @Override
+ public void execute() throws BuildException {
checkMethodLists();
setupJUnitDelegate();
@@ -866,7 +871,8 @@ public class JUnitTask extends Task {
this.id = id;
}
- public void run() {
+ @Override
+ public void run() {
try {
masterTask.oneJunitThread(iterator, id);
} catch (BuildException b) {
@@ -877,7 +883,7 @@ public class JUnitTask extends Task {
private JUnitTask masterTask;
private Iterator<List> iterator;
- private int id;
+ private int id;
}
/*
@@ -1436,7 +1442,8 @@ public class JUnitTask extends Task {
* @param output output coming from System.out
* @since Ant 1.5
*/
- protected void handleOutput(String output) {
+ @Override
+ protected void handleOutput(String output) {
if (output.startsWith(TESTLISTENER_PREFIX)) {
log(output, Project.MSG_VERBOSE);
} else if (runner != null) {
@@ -1465,7 +1472,8 @@ public class JUnitTask extends Task {
*
* @since Ant 1.6
*/
- protected int handleInput(byte[] buffer, int offset, int length)
+ @Override
+ protected int handleInput(byte[] buffer, int offset, int length)
throws IOException {
if (runner != null) {
return runner.handleInput(buffer, offset, length);
@@ -1482,7 +1490,8 @@ public class JUnitTask extends Task {
* @param output output coming from System.out
* @since Ant 1.5.2
*/
- protected void handleFlush(String output) {
+ @Override
+ protected void handleFlush(String output) {
if (runner != null) {
runner.handleFlush(output);
if (showOutput) {
@@ -1500,7 +1509,8 @@ public class JUnitTask extends Task {
* @param output output coming from System.err
* @since Ant 1.5
*/
- public void handleErrorOutput(String output) {
+ @Override
+ public void handleErrorOutput(String output) {
if (runner != null) {
runner.handleErrorOutput(output);
if (showOutput) {
@@ -1519,7 +1529,8 @@ public class JUnitTask extends Task {
* @param output coming from System.err
* @since Ant 1.5.2
*/
- public void handleErrorFlush(String output) {
+ @Override
+ public void handleErrorFlush(String output) {
if (runner != null) {
runner.handleErrorFlush(output);
if (showOutput) {
@@ -1783,7 +1794,7 @@ public class JUnitTask extends Task {
}
}
- static final String TIMEOUT_MESSAGE =
+ static final String TIMEOUT_MESSAGE =
"Timeout occurred. Please note the time in the report does"
+ " not reflect the time until the timeout.";
@@ -1999,7 +2010,8 @@ public class JUnitTask extends Task {
* @param other
* @return true if everything is equal
*/
- public boolean equals(Object other) {
+ @Override
+ public boolean equals(Object other) {
if (other == null
|| other.getClass() != ForkedTestConfiguration.class) {
return false;
@@ -2023,7 +2035,8 @@ public class JUnitTask extends Task {
* in the range 0-7.
* @return hash code value
*/
- public int hashCode() {
+ @Override
+ public int hashCode() {
// CheckStyle:MagicNumber OFF
return (filterTrace ? 1 : 0)
+ (haltOnError ? 2 : 0)
@@ -2066,7 +2079,8 @@ public class JUnitTask extends Task {
}
/** {@inheritDoc}. */
- public String[] getValues() {
+ @Override
+ public String[] getValues() {
return new String[] {ONCE, PER_TEST, PER_BATCH};
}
}
@@ -2203,7 +2217,8 @@ public class JUnitTask extends Task {
* @param line the line to log.
* @param level the logging level to use.
*/
- protected void processLine(String line, int level) {
+ @Override
+ protected void processLine(String line, int level) {
if (line.startsWith(TESTLISTENER_PREFIX)) {
task.log(line, Project.MSG_VERBOSE);
} else {
http://git-wip-us.apache.org/repos/asf/ant/blob/1b76f1b6/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTest.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTest.java b/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTest.java
index b96a1a7..86ccad7 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTest.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTest.java
@@ -55,7 +55,7 @@ public class JUnitTest extends BaseTest implements Cloneable {
/** the names of test methods to execute */
private String[] methods = null;
-
+
/** the name of the result file */
private String outfile = null;
@@ -110,7 +110,7 @@ public class JUnitTest extends BaseTest implements Cloneable {
*/
public JUnitTest(String name, boolean haltOnError, boolean haltOnFailure,
boolean filtertrace, String[] methods) {
- this(name, haltOnError, haltOnFailure, filtertrace, methods, 0);
+ this(name, haltOnError, haltOnFailure, filtertrace, methods, 0);
}
/**
@@ -527,7 +527,8 @@ public class JUnitTest extends BaseTest implements Cloneable {
* @since Ant 1.5
* @return a clone of this test.
*/
- public Object clone() {
+ @Override
+ public Object clone() {
try {
JUnitTest t = (JUnitTest) super.clone();
t.props = props == null ? null : (Properties) props.clone();
http://git-wip-us.apache.org/repos/asf/ant/blob/1b76f1b6/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java b/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java
index 042b05d..515e65d 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java
@@ -75,7 +75,7 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
/**
* Holds the registered formatters.
*/
- private Vector<JUnitTaskMirror.JUnitResultFormatterMirror> formatters = new Vector();
+ private final Vector<JUnitTaskMirror.JUnitResultFormatterMirror> formatters = new Vector();
/**
* Collects TestResults.
@@ -138,7 +138,7 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
/**
* The TestSuite we are currently running.
*/
- private JUnitTest junitTest;
+ private final JUnitTest junitTest;
/** output written during the test */
private PrintStream systemError;
@@ -153,7 +153,7 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
private static boolean multipleTests = false;
/** ClassLoader passed in in non-forked mode. */
- private ClassLoader loader;
+ private final ClassLoader loader;
/** Do we print TestListener events? */
private boolean logTestListenerEvents = false;
@@ -169,7 +169,7 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
/** Names of test methods to execute */
private String[] methods = null;
-
+
/**
* Constructor for fork=true or when the user hasn't specified a
* classpath.
@@ -178,8 +178,8 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
* @param filtertrace whether to filter junit.*.* stack frames out of exceptions
* @param haltOnFailure whether to stop the run if failure is found.
*/
- public JUnitTestRunner(JUnitTest test, boolean haltOnError,
- boolean filtertrace, boolean haltOnFailure) {
+ public JUnitTestRunner(final JUnitTest test, final boolean haltOnError,
+ final boolean filtertrace, final boolean haltOnFailure) {
this(test, haltOnError, filtertrace, haltOnFailure, false);
}
@@ -192,9 +192,9 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
* @param haltOnFailure whether to stop the run if failure is found.
* @param showOutput whether to send output to System.out/.err as well as formatters.
*/
- public JUnitTestRunner(JUnitTest test, boolean haltOnError,
- boolean filtertrace, boolean haltOnFailure,
- boolean showOutput) {
+ public JUnitTestRunner(final JUnitTest test, final boolean haltOnError,
+ final boolean filtertrace, final boolean haltOnFailure,
+ final boolean showOutput) {
this(test, haltOnError, filtertrace, haltOnFailure, showOutput, false);
}
@@ -209,9 +209,9 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
* @param logTestListenerEvents whether to print TestListener events.
* @since Ant 1.7
*/
- public JUnitTestRunner(JUnitTest test, boolean haltOnError,
- boolean filtertrace, boolean haltOnFailure,
- boolean showOutput, boolean logTestListenerEvents) {
+ public JUnitTestRunner(final JUnitTest test, final boolean haltOnError,
+ final boolean filtertrace, final boolean haltOnFailure,
+ final boolean showOutput, final boolean logTestListenerEvents) {
this(test, null, haltOnError, filtertrace, haltOnFailure, showOutput,
logTestListenerEvents, null);
}
@@ -228,9 +228,9 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
* @param logTestListenerEvents whether to print TestListener events.
* @since 1.8.2
*/
- public JUnitTestRunner(JUnitTest test, String[] methods, boolean haltOnError,
- boolean filtertrace, boolean haltOnFailure,
- boolean showOutput, boolean logTestListenerEvents) {
+ public JUnitTestRunner(final JUnitTest test, final String[] methods, final boolean haltOnError,
+ final boolean filtertrace, final boolean haltOnFailure,
+ final boolean showOutput, final boolean logTestListenerEvents) {
this(test, methods, haltOnError, filtertrace, haltOnFailure, showOutput,
logTestListenerEvents, null);
}
@@ -243,9 +243,9 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
* @param haltOnFailure whether to stop the run if failure is found.
* @param loader the classloader to use running the test.
*/
- public JUnitTestRunner(JUnitTest test, boolean haltOnError,
- boolean filtertrace, boolean haltOnFailure,
- ClassLoader loader) {
+ public JUnitTestRunner(final JUnitTest test, final boolean haltOnError,
+ final boolean filtertrace, final boolean haltOnFailure,
+ final ClassLoader loader) {
this(test, haltOnError, filtertrace, haltOnFailure, false, loader);
}
@@ -258,9 +258,9 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
* @param showOutput whether to send output to System.out/.err as well as formatters.
* @param loader the classloader to use running the test.
*/
- public JUnitTestRunner(JUnitTest test, boolean haltOnError,
- boolean filtertrace, boolean haltOnFailure,
- boolean showOutput, ClassLoader loader) {
+ public JUnitTestRunner(final JUnitTest test, final boolean haltOnError,
+ final boolean filtertrace, final boolean haltOnFailure,
+ final boolean showOutput, final ClassLoader loader) {
this(test, haltOnError, filtertrace, haltOnFailure, showOutput,
false, loader);
}
@@ -276,11 +276,11 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
* @param loader the classloader to use running the test.
* @since Ant 1.7
*/
- public JUnitTestRunner(JUnitTest test, boolean haltOnError,
- boolean filtertrace, boolean haltOnFailure,
- boolean showOutput, boolean logTestListenerEvents,
- ClassLoader loader) {
- this(test, null, haltOnError, filtertrace, haltOnFailure, showOutput,
+ public JUnitTestRunner(final JUnitTest test, final boolean haltOnError,
+ final boolean filtertrace, final boolean haltOnFailure,
+ final boolean showOutput, final boolean logTestListenerEvents,
+ final ClassLoader loader) {
+ this(test, null, haltOnError, filtertrace, haltOnFailure, showOutput,
logTestListenerEvents, loader);
}
@@ -289,10 +289,10 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
* Constructor to use when the user has specified a classpath.
* @since 1.8.2
*/
- public JUnitTestRunner(JUnitTest test, String[] methods, boolean haltOnError,
- boolean filtertrace, boolean haltOnFailure,
- boolean showOutput, boolean logTestListenerEvents,
- ClassLoader loader) {
+ public JUnitTestRunner(final JUnitTest test, final String[] methods, final boolean haltOnError,
+ final boolean filtertrace, final boolean haltOnFailure,
+ final boolean showOutput, final boolean logTestListenerEvents,
+ final ClassLoader loader) {
super();
JUnitTestRunner.filtertrace = filtertrace; // TODO clumsy, should use instance field somehow
this.junitTest = test;
@@ -310,17 +310,18 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
private PrintStream createEmptyStream() {
return new PrintStream(
new OutputStream() {
- public void write(int b) {
+ @Override
+ public void write(final int b) {
}
});
}
- private PrintStream createTeePrint(PrintStream ps1, PrintStream ps2) {
+ private PrintStream createTeePrint(final PrintStream ps1, final PrintStream ps2) {
return new PrintStream(new TeeOutputStream(ps1, ps2));
}
- private void setupIOStreams(ByteArrayOutputStream o,
- ByteArrayOutputStream e) {
+ private void setupIOStreams(final ByteArrayOutputStream o,
+ final ByteArrayOutputStream e) {
systemOut = new PrintStream(o);
systemError = new PrintStream(e);
@@ -354,7 +355,8 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
/**
* Run the test.
*/
- public void run() {
+ @Override
+ public void run() {
res = new IgnoredTestResult();
res.addListener(wrapListener(this));
final int size = formatters.size();
@@ -362,8 +364,8 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
res.addListener(wrapListener((TestListener) formatters.elementAt(i)));
}
- ByteArrayOutputStream errStrm = new ByteArrayOutputStream();
- ByteArrayOutputStream outStrm = new ByteArrayOutputStream();
+ final ByteArrayOutputStream errStrm = new ByteArrayOutputStream();
+ final ByteArrayOutputStream outStrm = new ByteArrayOutputStream();
setupIOStreams(outStrm, errStrm);
@@ -391,7 +393,7 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
try {
// check if there is a suite method
suiteMethod = testClass.getMethod("suite", new Class[0]);
- } catch (NoSuchMethodException e) {
+ } catch (final NoSuchMethodException e) {
// no appropriate suite method found. We don't report any
// error here since it might be perfectly normal.
}
@@ -461,14 +463,14 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
useSingleMethodAdapter = true;
}
}
- } catch (ClassNotFoundException e) {
+ } catch (final ClassNotFoundException e) {
// OK, fall back to JUnit 3.
}
}
junit4 = junit4TestAdapterClass != null;
if (junitTest.isSkipNonTests()) {
- if (!containsTests( testClass, junit4)) {
+ if (!containsTests(testClass, junit4)) {
return;
}
}
@@ -500,7 +502,7 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
} else if (methods.length == 1) {
suite = TestSuite.createTest(testClass, methods[0]);
} else {
- TestSuite testSuite = new TestSuite(testClass.getName());
+ final TestSuite testSuite = new TestSuite(testClass.getName());
for (int i = 0; i < methods.length; i++) {
testSuite.addTest(
TestSuite.createTest(testClass, methods[i]));
@@ -511,12 +513,12 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
}
- } catch (Throwable e) {
+ } catch (final Throwable e) {
retCode = ERRORS;
exception = e;
}
- long start = System.currentTimeMillis();
+ final long start = System.currentTimeMillis();
fireStartTestSuite();
startTestSuiteSuccess = true;
@@ -535,7 +537,7 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
} finally {
if (junit4 ||
suite.getClass().getName().equals(JUNIT_4_TEST_ADAPTER)) {
- int[] cnts = findJUnit4FailureErrorCount(res);
+ final int[] cnts = findJUnit4FailureErrorCount(res);
junitTest.setCounts(res.runCount() + res.ignoredCount(), cnts[0], cnts[1], res.ignoredCount() + res.skippedCount());
} else {
junitTest.setCounts(res.runCount() + res.ignoredCount(), res.failureCount(),
@@ -563,12 +565,12 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
String out, err;
try {
out = new String(outStrm.toByteArray());
- } catch (OutOfMemoryError ex) {
+ } catch (final OutOfMemoryError ex) {
out = "out of memory on output stream";
}
try {
err = new String(errStrm.toByteArray());
- } catch (OutOfMemoryError ex) {
+ } catch (final OutOfMemoryError ex) {
err = "out of memory on error stream";
}
sendOutAndErr(out, err);
@@ -584,14 +586,14 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
}
}
- private static boolean containsTests(Class<?> testClass, boolean isJUnit4) {
+ private static boolean containsTests(final Class<?> testClass, final boolean isJUnit4) {
Class testAnnotation = null;
Class suiteAnnotation = null;
Class runWithAnnotation = null;
try {
testAnnotation = Class.forName("org.junit.Test");
- } catch (ClassNotFoundException e) {
+ } catch (final ClassNotFoundException e) {
if (isJUnit4) {
// odd - we think we're JUnit4 but don't support the test annotation. We therefore can't have any tests!
return false;
@@ -601,12 +603,12 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
try {
suiteAnnotation = Class.forName("org.junit.Suite.SuiteClasses");
- } catch(ClassNotFoundException ex) {
+ } catch(final ClassNotFoundException ex) {
// ignore - we don't have this annotation so make sure we don't check for it
}
try {
runWithAnnotation = Class.forName("org.junit.runner.RunWith");
- } catch(ClassNotFoundException ex) {
+ } catch(final ClassNotFoundException ex) {
// also ignore as this annotation doesn't exist so tests can't use it
}
@@ -617,7 +619,7 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
}
// check if we have any inner classes that contain suitable test methods
- for (Class<?> innerClass : testClass.getDeclaredClasses()) {
+ for (final Class<?> innerClass : testClass.getDeclaredClasses()) {
if (containsTests(innerClass, isJUnit4) || containsTests(innerClass, !isJUnit4)) {
return true;
}
@@ -645,7 +647,7 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
}
}
- for (Method m : testClass.getMethods()) {
+ for (final Method m : testClass.getMethods()) {
if (isJUnit4) {
// check if suspected JUnit4 classes have methods with @Test annotation
if (m.getAnnotation(testAnnotation) != null) {
@@ -676,7 +678,8 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
*
* @return 2 if errors occurred, 1 if tests failed else 0.
*/
- public int getRetCode() {
+ @Override
+ public int getRetCode() {
return retCode;
}
@@ -686,8 +689,9 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
* <p>A new Test is started.
* @param t the test.
*/
- public void startTest(Test t) {
- String testName = JUnitVersionHelper.getTestCaseName(t);
+ @Override
+ public void startTest(final Test t) {
+ final String testName = JUnitVersionHelper.getTestCaseName(t);
logTestListenerEvent("startTest(" + testName + ")");
}
@@ -697,19 +701,20 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
* <p>A Test is finished.
* @param test the test.
*/
- public void endTest(Test test) {
- String testName = JUnitVersionHelper.getTestCaseName(test);
+ @Override
+ public void endTest(final Test test) {
+ final String testName = JUnitVersionHelper.getTestCaseName(test);
logTestListenerEvent("endTest(" + testName + ")");
}
private void logTestListenerEvent(String msg) {
if (logTestListenerEvents) {
- PrintStream out = savedOut != null ? savedOut : System.out;
+ final PrintStream out = savedOut != null ? savedOut : System.out;
out.flush();
if (msg == null) {
msg = "null";
}
- StringTokenizer msgLines = new StringTokenizer(msg, "\r\n", false);
+ final StringTokenizer msgLines = new StringTokenizer(msg, "\r\n", false);
while (msgLines.hasMoreTokens()) {
out.println(JUnitTask.TESTLISTENER_PREFIX
+ msgLines.nextToken());
@@ -725,8 +730,8 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
* @param test the test.
* @param t the exception thrown by the test.
*/
- public void addFailure(Test test, Throwable t) {
- String testName = JUnitVersionHelper.getTestCaseName(test);
+ public void addFailure(final Test test, final Throwable t) {
+ final String testName = JUnitVersionHelper.getTestCaseName(test);
logTestListenerEvent("addFailure(" + testName + ", " + t.getMessage() + ")");
if (haltOnFailure) {
res.stop();
@@ -740,7 +745,8 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
* @param test the test.
* @param t the assertion thrown by the test.
*/
- public void addFailure(Test test, AssertionFailedError t) {
+ @Override
+ public void addFailure(final Test test, final AssertionFailedError t) {
addFailure(test, (Throwable) t);
}
@@ -751,8 +757,9 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
* @param test the test.
* @param t the error thrown by the test.
*/
- public void addError(Test test, Throwable t) {
- String testName = JUnitVersionHelper.getTestCaseName(test);
+ @Override
+ public void addError(final Test test, final Throwable t) {
+ final String testName = JUnitVersionHelper.getTestCaseName(test);
logTestListenerEvent("addError(" + testName + ", " + t.getMessage() + ")");
if (haltOnError) {
res.stop();
@@ -764,7 +771,8 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
* @since Ant 1.6
* @param permissions the permissions to use.
*/
- public void setPermissions(Permissions permissions) {
+ @Override
+ public void setPermissions(final Permissions permissions) {
perm = permissions;
}
@@ -772,7 +780,8 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
* Handle a string destined for standard output.
* @param output the string to output
*/
- public void handleOutput(String output) {
+ @Override
+ public void handleOutput(final String output) {
if (!logTestListenerEvents && output.startsWith(JUnitTask.TESTLISTENER_PREFIX)) {
// ignore
} else if (systemOut != null) {
@@ -791,36 +800,40 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
*
* @since Ant 1.6
*/
- public int handleInput(byte[] buffer, int offset, int length)
+ @Override
+ public int handleInput(final byte[] buffer, final int offset, final int length)
throws IOException {
return -1;
}
/** {@inheritDoc}. */
- public void handleErrorOutput(String output) {
+ @Override
+ public void handleErrorOutput(final String output) {
if (systemError != null) {
systemError.print(output);
}
}
/** {@inheritDoc}. */
- public void handleFlush(String output) {
+ @Override
+ public void handleFlush(final String output) {
if (systemOut != null) {
systemOut.print(output);
}
}
/** {@inheritDoc}. */
- public void handleErrorFlush(String output) {
+ @Override
+ public void handleErrorFlush(final String output) {
if (systemError != null) {
systemError.print(output);
}
}
- private void sendOutAndErr(String out, String err) {
+ private void sendOutAndErr(final String out, final String err) {
final int size = formatters.size();
for (int i = 0; i < size; i++) {
- JUnitResultFormatter formatter =
+ final JUnitResultFormatter formatter =
((JUnitResultFormatter) formatters.elementAt(i));
formatter.setSystemOutput(out);
@@ -848,12 +861,13 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
* Add a formatter.
* @param f the formatter to add.
*/
- public void addFormatter(JUnitResultFormatter f) {
+ public void addFormatter(final JUnitResultFormatter f) {
formatters.addElement(f);
}
/** {@inheritDoc}. */
- public void addFormatter(JUnitTaskMirror.JUnitResultFormatterMirror f) {
+ @Override
+ public void addFormatter(final JUnitTaskMirror.JUnitResultFormatterMirror f) {
formatters.addElement(f);
}
@@ -890,12 +904,12 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
* @param args the command line arguments.
* @throws IOException on error.
*/
- public static void main(String[] args) throws IOException {
+ public static void main(final String[] args) throws IOException {
String[] methods = null;
boolean haltError = false;
boolean haltFail = false;
boolean stackfilter = true;
- Properties props = new Properties();
+ final Properties props = new Properties();
boolean showOut = false;
boolean outputToFormat = true;
boolean logFailedTests = true;
@@ -916,9 +930,9 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
for (int i = 1; i < args.length; i++) {
if (args[i].startsWith(Constants.METHOD_NAMES)) {
try {
- String methodsList = args[i].substring(Constants.METHOD_NAMES.length());
+ final String methodsList = args[i].substring(Constants.METHOD_NAMES.length());
methods = JUnitTest.parseTestMethodNamesList(methodsList);
- } catch (IllegalArgumentException ex) {
+ } catch (final IllegalArgumentException ex) {
System.err.println("Invalid specification of test method names: " + args[i]);
System.exit(ERRORS);
}
@@ -934,12 +948,12 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
} else if (args[i].startsWith(Constants.FORMATTER)) {
try {
createAndStoreFormatter(args[i].substring(Constants.FORMATTER.length()));
- } catch (BuildException be) {
+ } catch (final BuildException be) {
System.err.println(be.getMessage());
System.exit(ERRORS);
}
} else if (args[i].startsWith(Constants.PROPSFILE)) {
- FileInputStream in = new FileInputStream(args[i]
+ final FileInputStream in = new FileInputStream(args[i]
.substring(Constants.PROPSFILE.length()));
props.load(in);
in.close();
@@ -958,21 +972,21 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
skipNonTests = Project.toBoolean(
args[i].substring(Constants.SKIP_NON_TESTS.length()));
} else if (args[i].startsWith(Constants.THREADID)) {
- antThreadID = Integer.parseInt( args[i].substring(Constants.THREADID.length()) );
+ antThreadID = Integer.parseInt(args[i].substring(Constants.THREADID.length()));
}
}
// Add/overlay system properties on the properties from the Ant project
- Hashtable p = System.getProperties();
- for (Enumeration e = p.keys(); e.hasMoreElements();) {
- Object key = e.nextElement();
+ final Hashtable p = System.getProperties();
+ for (final Enumeration e = p.keys(); e.hasMoreElements();) {
+ final Object key = e.nextElement();
props.put(key, p.get(key));
}
int returnCode = SUCCESS;
if (multipleTests) {
try {
- java.io.BufferedReader reader =
+ final java.io.BufferedReader reader =
new java.io.BufferedReader(new java.io.FileReader(args[0]));
String testCaseName;
String[] testMethodNames;
@@ -981,9 +995,9 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
boolean failureOccurred = false;
String line = null;
while ((line = reader.readLine()) != null) {
- StringTokenizer st = new StringTokenizer(line, ",");
- String testListSpec = st.nextToken();
- int colonIndex = testListSpec.indexOf(':');
+ final StringTokenizer st = new StringTokenizer(line, ",");
+ final String testListSpec = st.nextToken();
+ final int colonIndex = testListSpec.indexOf(':');
if (colonIndex == -1) {
testCaseName = testListSpec;
testMethodNames = null;
@@ -994,7 +1008,7 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
.substring(colonIndex + 1)
.replace('+', ','));
}
- JUnitTest t = new JUnitTest(testCaseName);
+ final JUnitTest t = new JUnitTest(testCaseName);
t.setTodir(new File(st.nextToken()));
t.setOutfile(st.nextToken());
t.setProperties(props);
@@ -1021,11 +1035,11 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
}
}
}
- } catch (IOException e) {
+ } catch (final IOException e) {
e.printStackTrace();
}
} else {
- JUnitTest t = new JUnitTest(args[0]);
+ final JUnitTest t = new JUnitTest(args[0]);
t.setThread(antThreadID);
t.setProperties(props);
t.setSkipNonTests(skipNonTests);
@@ -1040,43 +1054,52 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
private static Vector fromCmdLine = new Vector();
- private static void transferFormatters(JUnitTestRunner runner,
- JUnitTest test) {
+ private static void transferFormatters(final JUnitTestRunner runner,
+ final JUnitTest test) {
runner.addFormatter(new JUnitResultFormatter() {
- public void startTestSuite(JUnitTest suite) throws BuildException {
+ @Override
+ public void startTestSuite(final JUnitTest suite) throws BuildException {
}
- public void endTestSuite(JUnitTest suite) throws BuildException {
+ @Override
+ public void endTestSuite(final JUnitTest suite) throws BuildException {
}
- public void setOutput(OutputStream out) {
+ @Override
+ public void setOutput(final OutputStream out) {
}
- public void setSystemOutput(String out) {
+ @Override
+ public void setSystemOutput(final String out) {
}
- public void setSystemError(String err) {
+ @Override
+ public void setSystemError(final String err) {
}
- public void addError(Test arg0, Throwable arg1) {
+ @Override
+ public void addError(final Test arg0, final Throwable arg1) {
}
- public void addFailure(Test arg0, AssertionFailedError arg1) {
+ @Override
+ public void addFailure(final Test arg0, final AssertionFailedError arg1) {
}
- public void endTest(Test arg0) {
+ @Override
+ public void endTest(final Test arg0) {
}
- public void startTest(Test arg0) {
+ @Override
+ public void startTest(final Test arg0) {
registerTestCase(JUnitVersionHelper.getTestCaseName(arg0));
}
});
final int size = fromCmdLine.size();
for (int i = 0; i < size; i++) {
- FormatterElement fe = (FormatterElement) fromCmdLine.elementAt(i);
+ final FormatterElement fe = (FormatterElement) fromCmdLine.elementAt(i);
if (multipleTests && fe.getUseFile()) {
- File destFile =
+ final File destFile =
new File(test.getTodir(),
test.getOutfile() + fe.getExtension());
fe.setOutfile(destFile);
@@ -1088,10 +1111,10 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
/**
* Line format is: formatter=<classname>(,<pathname>)?
*/
- private static void createAndStoreFormatter(String line)
+ private static void createAndStoreFormatter(final String line)
throws BuildException {
- FormatterElement fe = new FormatterElement();
- int pos = line.indexOf(',');
+ final FormatterElement fe = new FormatterElement();
+ final int pos = line.indexOf(',');
if (pos == -1) {
fe.setClassname(line);
fe.setUseFile(false);
@@ -1101,7 +1124,7 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
if (!multipleTests) {
fe.setOutfile(new File(line.substring(pos + 1)));
} else {
- int fName = line.indexOf(IGNORED_FILE_NAME);
+ final int fName = line.indexOf(IGNORED_FILE_NAME);
if (fName > -1) {
fe.setExtension(line
.substring(fName
@@ -1118,8 +1141,8 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
* @param t the exception to filter.
* @return the filtered stack trace.
*/
- public static String getFilteredTrace(Throwable t) {
- String trace = StringUtils.getStackTrace(t);
+ public static String getFilteredTrace(final Throwable t) {
+ final String trace = StringUtils.getStackTrace(t);
return JUnitTestRunner.filterStack(trace);
}
@@ -1128,14 +1151,14 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
* @param stack the stack trace to filter.
* @return the filtered stack.
*/
- public static String filterStack(String stack) {
+ public static String filterStack(final String stack) {
if (!filtertrace) {
return stack;
}
- StringWriter sw = new StringWriter();
- BufferedWriter pw = new BufferedWriter(sw);
- StringReader sr = new StringReader(stack);
- BufferedReader br = new BufferedReader(sr);
+ final StringWriter sw = new StringWriter();
+ final BufferedWriter pw = new BufferedWriter(sw);
+ final StringReader sr = new StringReader(stack);
+ final BufferedReader br = new BufferedReader(sr);
String line;
try {
@@ -1147,7 +1170,7 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
}
firstLine = false;
}
- } catch (Exception e) {
+ } catch (final Exception e) {
return stack; // return the stack unfiltered
} finally {
FileUtils.close(pw);
@@ -1155,7 +1178,7 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
return sw.toString();
}
- private static boolean filterLine(String line) {
+ private static boolean filterLine(final String line) {
for (int i = 0; i < DEFAULT_TRACE_FILTERS.length; i++) {
if (line.indexOf(DEFAULT_TRACE_FILTERS[i]) != -1) {
return true;
@@ -1167,11 +1190,11 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
/**
* @since Ant 1.6.2
*/
- private static int launch(JUnitTest t, String[] methods, boolean haltError,
- boolean stackfilter, boolean haltFail,
- boolean showOut, boolean outputToFormat,
- boolean logTestListenerEvents) {
- JUnitTestRunner runner =
+ private static int launch(final JUnitTest t, final String[] methods, final boolean haltError,
+ final boolean stackfilter, final boolean haltFail,
+ final boolean showOut, final boolean outputToFormat,
+ final boolean logTestListenerEvents) {
+ final JUnitTestRunner runner =
new JUnitTestRunner(t, methods, haltError, stackfilter, haltFail, showOut,
logTestListenerEvents, null);
runner.forked = true;
@@ -1199,7 +1222,7 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
}
}
- private static void registerTestCase(String testCase) {
+ private static void registerTestCase(final String testCase) {
if (crashFile != null) {
try {
FileWriter out = null;
@@ -1210,7 +1233,7 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
} finally {
FileUtils.close(out);
}
- } catch (IOException e) {
+ } catch (final IOException e) {
// ignored.
}
}
@@ -1224,7 +1247,8 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
*/
private TestListenerWrapper wrapListener(final TestListener testListener) {
return new TestListenerWrapper(testListener) {
- public void addError(Test test, Throwable t) {
+ @Override
+ public void addError(final Test test, final Throwable t) {
if (junit4 && t instanceof AssertionFailedError) {
// JUnit 4 does not distinguish between errors and failures
// even in the JUnit 3 adapter.
@@ -1235,8 +1259,8 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
// JUnit 4-specific test GUIs will show just "failures".
// But Ant's output shows "failures" vs. "errors".
// We would prefer to show "failure" for things that logically are.
- String msg = t.getMessage();
- AssertionFailedError failure = msg != null
+ final String msg = t.getMessage();
+ final AssertionFailedError failure = msg != null
? new AssertionFailedError(msg) : new AssertionFailedError();
failure.setStackTrace(t.getStackTrace());
testListener.addFailure(test, failure);
@@ -1244,20 +1268,23 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
testListener.addError(test, t);
}
}
- public void addFailure(Test test, AssertionFailedError t) {
+ @Override
+ public void addFailure(final Test test, final AssertionFailedError t) {
testListener.addFailure(test, t);
}
- public void addFailure(Test test, Throwable t) { // pre-3.4
+ public void addFailure(final Test test, final Throwable t) { // pre-3.4
if (t instanceof AssertionFailedError) {
testListener.addFailure(test, (AssertionFailedError) t);
} else {
testListener.addError(test, t);
}
}
- public void endTest(Test test) {
+ @Override
+ public void endTest(final Test test) {
testListener.endTest(test);
}
- public void startTest(Test test) {
+ @Override
+ public void startTest(final Test test) {
testListener.startTest(test);
}
};
@@ -1268,7 +1295,7 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
* since the adapter claims that all failures are errors.
* @since Ant 1.7
*/
- private int[] findJUnit4FailureErrorCount(TestResult result) {
+ private int[] findJUnit4FailureErrorCount(final TestResult result) {
int failures = 0;
int errors = 0;
Enumeration e = result.failures();
@@ -1278,7 +1305,7 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
}
e = result.errors();
while (e.hasMoreElements()) {
- Throwable t = ((TestFailure) e.nextElement()).thrownException();
+ final Throwable t = ((TestFailure) e.nextElement()).thrownException();
if (t instanceof AssertionFailedError
|| t instanceof AssertionError) {
failures++;
http://git-wip-us.apache.org/repos/asf/ant/blob/1b76f1b6/src/main/org/apache/tools/ant/taskdefs/optional/junit/TearDownOnVmCrash.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/junit/TearDownOnVmCrash.java b/src/main/org/apache/tools/ant/taskdefs/optional/junit/TearDownOnVmCrash.java
index c32870d..4d6f9af 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/junit/TearDownOnVmCrash.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/junit/TearDownOnVmCrash.java
@@ -43,7 +43,8 @@ public class TearDownOnVmCrash implements JUnitResultFormatter {
* Records the suite's name to later determine the class to invoke
* tearDown on.
*/
- public void startTestSuite(final JUnitTest suite) {
+ @Override
+ public void startTestSuite(final JUnitTest suite) {
suiteName = suite.getName();
if (suiteName != null &&
suiteName.endsWith(JUnitTask.NAME_OF_DUMMY_TEST)) {
@@ -57,7 +58,8 @@ public class TearDownOnVmCrash implements JUnitResultFormatter {
* test we get when a Batch fails and the error is an actual
* error generated by Ant.
*/
- public void addError(final Test fakeTest, final Throwable t) {
+ @Override
+ public void addError(final Test fakeTest, final Throwable t) {
if (suiteName != null
&& fakeTest instanceof JUnitTaskMirrorImpl.VmExitErrorTest) {
tearDown();
@@ -67,19 +69,26 @@ public class TearDownOnVmCrash implements JUnitResultFormatter {
// no need to implement the rest
public void addFailure(Test test, Throwable t) {}
- public void addFailure(Test test, AssertionFailedError t) {}
+ @Override
+ public void addFailure(Test test, AssertionFailedError t) {}
- public void startTest(Test test) {}
+ @Override
+ public void startTest(Test test) {}
- public void endTest(Test test) {}
+ @Override
+ public void endTest(Test test) {}
- public void endTestSuite(JUnitTest suite) {}
-
- public void setOutput(OutputStream out) {}
+ @Override
+ public void endTestSuite(JUnitTest suite) {}
- public void setSystemOutput(String out) {}
+ @Override
+ public void setOutput(OutputStream out) {}
- public void setSystemError(String err) {}
+ @Override
+ public void setSystemOutput(String out) {}
+
+ @Override
+ public void setSystemError(String err) {}
private void tearDown() {
try {
http://git-wip-us.apache.org/repos/asf/ant/blob/1b76f1b6/src/main/org/apache/tools/ant/taskdefs/optional/junit/XMLJUnitResultFormatter.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/junit/XMLJUnitResultFormatter.java b/src/main/org/apache/tools/ant/taskdefs/optional/junit/XMLJUnitResultFormatter.java
index 3c159f0..2a93474 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/junit/XMLJUnitResultFormatter.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/junit/XMLJUnitResultFormatter.java
@@ -76,7 +76,7 @@ public class XMLJUnitResultFormatter implements JUnitResultFormatter, XMLConstan
private Element rootElement;
/**
* Element for the current test.
- *
+ *
* The keying of this map is a bit of a hack: tests are keyed by caseName(className) since
* the Test we get for Test-start isn't the same as the Test we get during test-assumption-fail,
* so we can't easily match Test objects without manually iterating over all keys and checking
@@ -109,17 +109,20 @@ public class XMLJUnitResultFormatter implements JUnitResultFormatter, XMLConstan
}
/** {@inheritDoc}. */
- public void setOutput(OutputStream out) {
+ @Override
+ public void setOutput(OutputStream out) {
this.out = out;
}
/** {@inheritDoc}. */
- public void setSystemOutput(String out) {
+ @Override
+ public void setSystemOutput(String out) {
formatOutput(SYSTEM_OUT, out);
}
/** {@inheritDoc}. */
- public void setSystemError(String out) {
+ @Override
+ public void setSystemError(String out) {
formatOutput(SYSTEM_ERR, out);
}
@@ -127,7 +130,8 @@ public class XMLJUnitResultFormatter implements JUnitResultFormatter, XMLConstan
* The whole testsuite started.
* @param suite the testsuite.
*/
- public void startTestSuite(JUnitTest suite) {
+ @Override
+ public void startTestSuite(JUnitTest suite) {
doc = getDocumentBuilder().newDocument();
rootElement = doc.createElement(TESTSUITE);
String n = suite.getName();
@@ -178,7 +182,8 @@ public class XMLJUnitResultFormatter implements JUnitResultFormatter, XMLConstan
* @param suite the testsuite.
* @throws BuildException on error.
*/
- public void endTestSuite(JUnitTest suite) throws BuildException {
+ @Override
+ public void endTestSuite(JUnitTest suite) throws BuildException {
rootElement.setAttribute(ATTR_TESTS, "" + suite.runCount());
rootElement.setAttribute(ATTR_FAILURES, "" + suite.failureCount());
rootElement.setAttribute(ATTR_ERRORS, "" + suite.errorCount());
@@ -214,7 +219,8 @@ public class XMLJUnitResultFormatter implements JUnitResultFormatter, XMLConstan
* <p>A new Test is started.
* @param t the test.
*/
- public void startTest(Test t) {
+ @Override
+ public void startTest(Test t) {
testStarts.put(createDescription(t), System.currentTimeMillis());
}
@@ -228,7 +234,8 @@ public class XMLJUnitResultFormatter implements JUnitResultFormatter, XMLConstan
* <p>A Test is finished.
* @param test the test.
*/
- public void endTest(Test test) {
+ @Override
+ public void endTest(Test test) {
String testDescription = createDescription(test);
// Fix for bug #5637 - if a junit.extensions.TestSetup is
@@ -276,7 +283,8 @@ public class XMLJUnitResultFormatter implements JUnitResultFormatter, XMLConstan
* @param test the test.
* @param t the assertion.
*/
- public void addFailure(Test test, AssertionFailedError t) {
+ @Override
+ public void addFailure(Test test, AssertionFailedError t) {
addFailure(test, (Throwable) t);
}
@@ -287,7 +295,8 @@ public class XMLJUnitResultFormatter implements JUnitResultFormatter, XMLConstan
* @param test the test.
* @param t the error.
*/
- public void addError(Test test, Throwable t) {
+ @Override
+ public void addError(Test test, Throwable t) {
formatError(ERROR, test, t);
}
@@ -324,7 +333,8 @@ public class XMLJUnitResultFormatter implements JUnitResultFormatter, XMLConstan
nested.appendChild(doc.createCDATASection(output));
}
- public void testIgnored(Test test) {
+ @Override
+ public void testIgnored(Test test) {
formatSkip(test, JUnitVersionHelper.getIgnoreMessage(test));
if (test != null) {
ignoredTests.put(createDescription(test), test);
@@ -354,7 +364,8 @@ public class XMLJUnitResultFormatter implements JUnitResultFormatter, XMLConstan
}
- public void testAssumptionFailure(Test test, Throwable failure) {
+ @Override
+ public void testAssumptionFailure(Test test, Throwable failure) {
formatSkip(test, failure.getMessage());
skippedTests.put(createDescription(test), test);
http://git-wip-us.apache.org/repos/asf/ant/blob/1b76f1b6/src/main/org/apache/tools/ant/taskdefs/optional/net/FTPTaskMirror.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/net/FTPTaskMirror.java b/src/main/org/apache/tools/ant/taskdefs/optional/net/FTPTaskMirror.java
index e01403b..5d09e6f 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/net/FTPTaskMirror.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/net/FTPTaskMirror.java
@@ -20,6 +20,5 @@ package org.apache.tools.ant.taskdefs.optional.net;
import org.apache.tools.ant.BuildException;
public interface FTPTaskMirror {
-
- public void doFTP() throws BuildException;
+ void doFTP() throws BuildException;
}
http://git-wip-us.apache.org/repos/asf/ant/blob/1b76f1b6/src/main/org/apache/tools/ant/taskdefs/optional/splash/SplashTask.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/splash/SplashTask.java b/src/main/org/apache/tools/ant/taskdefs/optional/splash/SplashTask.java
index 042155e..ff3a940 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/splash/SplashTask.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/splash/SplashTask.java
@@ -71,7 +71,8 @@ public class SplashTask extends Task {
* @deprecated since 1.5.x.
* Use org.apache.tools.ant.taskdefs.optional.net.SetProxy
*/
- public void setUseproxy(boolean useProxy) {
+ @Deprecated
+ public void setUseproxy(boolean useProxy) {
this.useProxy = useProxy;
}
@@ -81,7 +82,8 @@ public class SplashTask extends Task {
* @deprecated since 1.5.x.
* Use org.apache.tools.ant.taskdefs.optional.net.SetProxy
*/
- public void setProxy(String proxy) {
+ @Deprecated
+ public void setProxy(String proxy) {
this.proxy = proxy;
}
@@ -91,7 +93,8 @@ public class SplashTask extends Task {
* @deprecated since 1.5.x.
* Use org.apache.tools.ant.taskdefs.optional.net.SetProxy
*/
- public void setPort(String port) {
+ @Deprecated
+ public void setPort(String port) {
this.port = port;
}
@@ -101,7 +104,8 @@ public class SplashTask extends Task {
* @deprecated since 1.5.x.
* Use org.apache.tools.ant.taskdefs.optional.net.SetProxy
*/
- public void setUser(String user) {
+ @Deprecated
+ public void setUser(String user) {
this.user = user;
}
@@ -111,7 +115,8 @@ public class SplashTask extends Task {
* @deprecated since 1.5.x.
* Use org.apache.tools.ant.taskdefs.optional.net.SetProxy
*/
- public void setPassword(String password) {
+ @Deprecated
+ public void setPassword(String password) {
this.password = password;
}
@@ -140,7 +145,7 @@ public class SplashTask extends Task {
/**
* Sets the display text presented in the splash window.
- * optional; defaults to "Building ..."
+ * optional; defaults to "Building ..."
* @param displayText the display text presented the splash window
* @since Ant 1.8.0
*/
@@ -152,7 +157,8 @@ public class SplashTask extends Task {
* Execute the task.
* @throws BuildException on error
*/
- public void execute() throws BuildException {
+ @Override
+ public void execute() throws BuildException {
if (splash != null) {
splash.setVisible(false);
getProject().removeBuildListener(splash);