| @@ -38,6 +38,7 @@ import java.util.Stack; | |||||
| import org.apache.tools.ant.launch.Launcher; | import org.apache.tools.ant.launch.Launcher; | ||||
| import org.apache.tools.ant.taskdefs.Definer; | import org.apache.tools.ant.taskdefs.Definer; | ||||
| import org.apache.tools.ant.taskdefs.Property; | |||||
| import org.apache.tools.ant.taskdefs.Typedef; | import org.apache.tools.ant.taskdefs.Typedef; | ||||
| import org.apache.tools.ant.util.FileUtils; | import org.apache.tools.ant.util.FileUtils; | ||||
| @@ -522,7 +523,7 @@ public class ComponentHelper { | |||||
| if (task == null && taskType.equals(ANT_PROPERTY_TASK)) { | if (task == null && taskType.equals(ANT_PROPERTY_TASK)) { | ||||
| // quick fix for Ant.java use of property before | // quick fix for Ant.java use of property before | ||||
| // initializing the project | // initializing the project | ||||
| addTaskDefinition(ANT_PROPERTY_TASK, org.apache.tools.ant.taskdefs.Property.class); | |||||
| addTaskDefinition(ANT_PROPERTY_TASK, Property.class); | |||||
| task = createNewTask(taskType); | task = createNewTask(taskType); | ||||
| } | } | ||||
| return task; | return task; | ||||
| @@ -445,6 +445,7 @@ public final class Diagnostics { | |||||
| /** | /** | ||||
| * Call org.apache.env.Which if available | * Call org.apache.env.Which if available | ||||
| * | |||||
| * @param out the stream to print the content to. | * @param out the stream to print the content to. | ||||
| */ | */ | ||||
| private static void doReportWhich(PrintStream out) { | private static void doReportWhich(PrintStream out) { | ||||
| @@ -17,6 +17,7 @@ | |||||
| */ | */ | ||||
| package org.apache.tools.ant; | package org.apache.tools.ant; | ||||
| import java.io.File; | |||||
| import java.lang.reflect.Constructor; | import java.lang.reflect.Constructor; | ||||
| import java.lang.reflect.InvocationTargetException; | import java.lang.reflect.InvocationTargetException; | ||||
| import java.lang.reflect.Method; | import java.lang.reflect.Method; | ||||
| @@ -187,30 +188,30 @@ public final class IntrospectionHelper { | |||||
| final Class<?>[] args = m.getParameterTypes(); | final Class<?>[] args = m.getParameterTypes(); | ||||
| // check of add[Configured](Class) pattern | // check of add[Configured](Class) pattern | ||||
| if (args.length == 1 && java.lang.Void.TYPE.equals(returnType) | |||||
| if (args.length == 1 && Void.TYPE.equals(returnType) | |||||
| && ("add".equals(name) || "addConfigured".equals(name))) { | && ("add".equals(name) || "addConfigured".equals(name))) { | ||||
| insertAddTypeMethod(m); | insertAddTypeMethod(m); | ||||
| continue; | continue; | ||||
| } | } | ||||
| // not really user settable properties on tasks/project components | // not really user settable properties on tasks/project components | ||||
| if (org.apache.tools.ant.ProjectComponent.class.isAssignableFrom(bean) | |||||
| if (ProjectComponent.class.isAssignableFrom(bean) | |||||
| && args.length == 1 && isHiddenSetMethod(name, args[0])) { | && args.length == 1 && isHiddenSetMethod(name, args[0])) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| // hide addTask for TaskContainers | // hide addTask for TaskContainers | ||||
| if (isContainer() && args.length == 1 && "addTask".equals(name) | if (isContainer() && args.length == 1 && "addTask".equals(name) | ||||
| && org.apache.tools.ant.Task.class.equals(args[0])) { | |||||
| && Task.class.equals(args[0])) { | |||||
| continue; | continue; | ||||
| } | } | ||||
| if ("addText".equals(name) && java.lang.Void.TYPE.equals(returnType) | |||||
| && args.length == 1 && java.lang.String.class.equals(args[0])) { | |||||
| if ("addText".equals(name) && Void.TYPE.equals(returnType) | |||||
| && args.length == 1 && String.class.equals(args[0])) { | |||||
| addTextMethod = methods[i]; | addTextMethod = methods[i]; | ||||
| } else if (name.startsWith("set") && java.lang.Void.TYPE.equals(returnType) | |||||
| } else if (name.startsWith("set") && Void.TYPE.equals(returnType) | |||||
| && args.length == 1 && !args[0].isArray()) { | && args.length == 1 && !args[0].isArray()) { | ||||
| final String propName = getPropertyName(name, "set"); | final String propName = getPropertyName(name, "set"); | ||||
| AttributeSetter as = attributeSetters.get(propName); | AttributeSetter as = attributeSetters.get(propName); | ||||
| if (as != null) { | if (as != null) { | ||||
| if (java.lang.String.class.equals(args[0])) { | |||||
| if (String.class.equals(args[0])) { | |||||
| /* | /* | ||||
| Ignore method m, as there is an overloaded | Ignore method m, as there is an overloaded | ||||
| form of this method that takes in a | form of this method that takes in a | ||||
| @@ -219,7 +220,7 @@ public final class IntrospectionHelper { | |||||
| */ | */ | ||||
| continue; | continue; | ||||
| } | } | ||||
| if (java.io.File.class.equals(args[0])) { | |||||
| if (File.class.equals(args[0])) { | |||||
| // Ant Resources/FileProviders override java.io.File | // Ant Resources/FileProviders override java.io.File | ||||
| if (Resource.class.equals(as.type) || FileProvider.class.equals(as.type)) { | if (Resource.class.equals(as.type) || FileProvider.class.equals(as.type)) { | ||||
| continue; | continue; | ||||
| @@ -251,8 +252,8 @@ public final class IntrospectionHelper { | |||||
| nestedCreators.put(propName, new CreateNestedCreator(m)); | nestedCreators.put(propName, new CreateNestedCreator(m)); | ||||
| } | } | ||||
| } else if (name.startsWith("addConfigured") | } else if (name.startsWith("addConfigured") | ||||
| && java.lang.Void.TYPE.equals(returnType) && args.length == 1 | |||||
| && !java.lang.String.class.equals(args[0]) | |||||
| && Void.TYPE.equals(returnType) && args.length == 1 | |||||
| && !String.class.equals(args[0]) | |||||
| && !args[0].isArray() && !args[0].isPrimitive()) { | && !args[0].isArray() && !args[0].isPrimitive()) { | ||||
| try { | try { | ||||
| Constructor<?> constructor = null; | Constructor<?> constructor = null; | ||||
| @@ -269,8 +270,8 @@ public final class IntrospectionHelper { | |||||
| // ignore | // ignore | ||||
| } | } | ||||
| } else if (name.startsWith("add") | } else if (name.startsWith("add") | ||||
| && java.lang.Void.TYPE.equals(returnType) && args.length == 1 | |||||
| && !java.lang.String.class.equals(args[0]) | |||||
| && Void.TYPE.equals(returnType) && args.length == 1 | |||||
| && !String.class.equals(args[0]) | |||||
| && !args[0].isArray() && !args[0].isPrimitive()) { | && !args[0].isArray() && !args[0].isPrimitive()) { | ||||
| try { | try { | ||||
| Constructor<?> constructor = null; | Constructor<?> constructor = null; | ||||
| @@ -308,10 +309,10 @@ public final class IntrospectionHelper { | |||||
| * @return true if the given set method is to be hidden. | * @return true if the given set method is to be hidden. | ||||
| */ | */ | ||||
| private boolean isHiddenSetMethod(final String name, final Class<?> type) { | private boolean isHiddenSetMethod(final String name, final Class<?> type) { | ||||
| if ("setLocation".equals(name) && org.apache.tools.ant.Location.class.equals(type)) { | |||||
| if ("setLocation".equals(name) && Location.class.equals(type)) { | |||||
| return true; | return true; | ||||
| } | } | ||||
| if ("setTaskType".equals(name) && java.lang.String.class.equals(type)) { | |||||
| if ("setTaskType".equals(name) && String.class.equals(type)) { | |||||
| return true; | return true; | ||||
| } | } | ||||
| return false; | return false; | ||||
| @@ -1060,7 +1061,7 @@ public final class IntrospectionHelper { | |||||
| }; | }; | ||||
| } | } | ||||
| // simplest case - setAttribute expects String | // simplest case - setAttribute expects String | ||||
| if (java.lang.String.class.equals(reflectedArg)) { | |||||
| if (String.class.equals(reflectedArg)) { | |||||
| return new AttributeSetter(m, arg) { | return new AttributeSetter(m, arg) { | ||||
| @Override | @Override | ||||
| public void set(final Project p, final Object parent, final String value) | public void set(final Project p, final Object parent, final String value) | ||||
| @@ -1695,7 +1696,7 @@ public final class IntrospectionHelper { | |||||
| if (exposedClass == null) { | if (exposedClass == null) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| final Method method = findMatchingMethod(exposedClass, methods); | |||||
| final Method method = findMatchingMethod(exposedClass, methods); | |||||
| if (method == null) { | if (method == null) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| @@ -38,6 +38,7 @@ import java.util.WeakHashMap; | |||||
| import org.apache.tools.ant.helper.DefaultExecutor; | import org.apache.tools.ant.helper.DefaultExecutor; | ||||
| import org.apache.tools.ant.input.DefaultInputHandler; | import org.apache.tools.ant.input.DefaultInputHandler; | ||||
| import org.apache.tools.ant.input.InputHandler; | import org.apache.tools.ant.input.InputHandler; | ||||
| import org.apache.tools.ant.launch.Locator; | |||||
| import org.apache.tools.ant.types.Description; | import org.apache.tools.ant.types.Description; | ||||
| import org.apache.tools.ant.types.FilterSet; | import org.apache.tools.ant.types.FilterSet; | ||||
| import org.apache.tools.ant.types.FilterSetCollection; | import org.apache.tools.ant.types.FilterSetCollection; | ||||
| @@ -326,7 +327,7 @@ public class Project implements ResourceFactory { | |||||
| * to the result | * to the result | ||||
| */ | */ | ||||
| private void setAntLib() { | private void setAntLib() { | ||||
| final File antlib = org.apache.tools.ant.launch.Locator.getClassSource( | |||||
| final File antlib = Locator.getClassSource( | |||||
| Project.class); | Project.class); | ||||
| if (antlib != null) { | if (antlib != null) { | ||||
| setPropertyInternal(MagicNames.ANT_LIB, antlib.getAbsolutePath()); | setPropertyInternal(MagicNames.ANT_LIB, antlib.getAbsolutePath()); | ||||
| @@ -18,6 +18,8 @@ | |||||
| package org.apache.tools.ant.input; | package org.apache.tools.ant.input; | ||||
| import org.apache.tools.ant.BuildException; | |||||
| /** | /** | ||||
| * Plugin to Ant to handle requests for user input. | * Plugin to Ant to handle requests for user input. | ||||
| * | * | ||||
| @@ -34,8 +36,8 @@ public interface InputHandler { | |||||
| * <p>Postcondition: request.getInput will return a non-null | * <p>Postcondition: request.getInput will return a non-null | ||||
| * value, request.isInputValid will return true.</p> | * value, request.isInputValid will return true.</p> | ||||
| * @param request the request to be processed | * @param request the request to be processed | ||||
| * @throws org.apache.tools.ant.BuildException if the input cannot be read from the console | |||||
| * @throws BuildException if the input cannot be read from the console | |||||
| */ | */ | ||||
| void handleInput(InputRequest request) | void handleInput(InputRequest request) | ||||
| throws org.apache.tools.ant.BuildException; | |||||
| throws BuildException; | |||||
| } | } | ||||
| @@ -222,7 +222,7 @@ public class MakeUrl extends Task { | |||||
| /** | /** | ||||
| * Create the url | * Create the url | ||||
| * | * | ||||
| * @throws org.apache.tools.ant.BuildException | |||||
| * @throws BuildException | |||||
| * if something goes wrong with the build | * if something goes wrong with the build | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| @@ -69,8 +69,8 @@ public class Rename extends Task { | |||||
| /** | /** | ||||
| * Renames the file <code>src</code> to <code>dest</code> | * Renames the file <code>src</code> to <code>dest</code> | ||||
| * @exception org.apache.tools.ant.BuildException The exception is | |||||
| * thrown, if the rename operation fails. | |||||
| * | |||||
| * @throws BuildException if the rename operation fails | |||||
| */ | */ | ||||
| public void execute() throws BuildException { | public void execute() throws BuildException { | ||||
| log("DEPRECATED - The rename task is deprecated. Use move instead."); | log("DEPRECATED - The rename task is deprecated. Use move instead."); | ||||
| @@ -591,7 +591,7 @@ public class Rmic extends MatchingTask { | |||||
| /** | /** | ||||
| * execute by creating an instance of an implementation | * execute by creating an instance of an implementation | ||||
| * class and getting to do the work | * class and getting to do the work | ||||
| * @throws org.apache.tools.ant.BuildException | |||||
| * @throws BuildException | |||||
| * if there's a problem with baseDir or RMIC | * if there's a problem with baseDir or RMIC | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| @@ -697,7 +697,7 @@ public class Rmic extends MatchingTask { | |||||
| /** | /** | ||||
| * Move the generated source file(s) to the base directory | * Move the generated source file(s) to the base directory | ||||
| * | * | ||||
| * @throws org.apache.tools.ant.BuildException When error | |||||
| * @throws BuildException When error | |||||
| * copying/removing files. | * copying/removing files. | ||||
| */ | */ | ||||
| private void moveGeneratedFile(File baseDir, File sourceBaseFile, String classname, | private void moveGeneratedFile(File baseDir, File sourceBaseFile, String classname, | ||||
| @@ -154,10 +154,9 @@ public class Sleep extends Task { | |||||
| } | } | ||||
| /** | /** | ||||
| * Executes this build task. Throws org.apache.tools.ant.BuildException | |||||
| * if there is an error during task execution. | |||||
| * Executes this build task. | |||||
| * | * | ||||
| * @exception BuildException Description of Exception | |||||
| * @throws BuildException if there is an error during task execution | |||||
| */ | */ | ||||
| @Override | @Override | ||||
| public void execute() | public void execute() | ||||
| @@ -41,6 +41,7 @@ import org.apache.tools.ant.DynamicConfigurator; | |||||
| import org.apache.tools.ant.Project; | import org.apache.tools.ant.Project; | ||||
| import org.apache.tools.ant.ProjectComponent; | import org.apache.tools.ant.ProjectComponent; | ||||
| import org.apache.tools.ant.PropertyHelper; | import org.apache.tools.ant.PropertyHelper; | ||||
| import org.apache.tools.ant.taskdefs.optional.TraXLiaison; | |||||
| import org.apache.tools.ant.types.CommandlineJava; | import org.apache.tools.ant.types.CommandlineJava; | ||||
| import org.apache.tools.ant.types.Environment; | import org.apache.tools.ant.types.Environment; | ||||
| import org.apache.tools.ant.types.Mapper; | import org.apache.tools.ant.types.Mapper; | ||||
| @@ -697,7 +698,7 @@ public class XSLTProcess extends MatchingTask implements XSLTLogger { | |||||
| */ | */ | ||||
| private void resolveProcessor(final String proc) throws Exception { | private void resolveProcessor(final String proc) throws Exception { | ||||
| if (PROCESSOR_TRAX.equals(proc)) { | if (PROCESSOR_TRAX.equals(proc)) { | ||||
| liaison = new org.apache.tools.ant.taskdefs.optional.TraXLiaison(); | |||||
| liaison = new TraXLiaison(); | |||||
| } else { | } else { | ||||
| //anything else is a classname | //anything else is a classname | ||||
| final Class<? extends XSLTLiaison> clazz = loadClass(proc).asSubclass(XSLTLiaison.class); | final Class<? extends XSLTLiaison> clazz = loadClass(proc).asSubclass(XSLTLiaison.class); | ||||
| @@ -29,6 +29,7 @@ import javax.xml.parsers.ParserConfigurationException; | |||||
| import org.apache.tools.ant.BuildException; | import org.apache.tools.ant.BuildException; | ||||
| import org.apache.tools.ant.Project; | import org.apache.tools.ant.Project; | ||||
| import org.apache.tools.ant.Task; | |||||
| import org.apache.tools.ant.types.Path; | import org.apache.tools.ant.types.Path; | ||||
| import org.apache.tools.ant.types.Resource; | import org.apache.tools.ant.types.Resource; | ||||
| import org.apache.tools.ant.types.ResourceCollection; | import org.apache.tools.ant.types.ResourceCollection; | ||||
| @@ -176,7 +177,7 @@ import org.xml.sax.SAXException; | |||||
| * | * | ||||
| * @ant.task name="xmlproperty" category="xml" | * @ant.task name="xmlproperty" category="xml" | ||||
| */ | */ | ||||
| public class XmlProperty extends org.apache.tools.ant.Task { | |||||
| public class XmlProperty extends Task { | |||||
| private static final String ID = "id"; | private static final String ID = "id"; | ||||
| private static final String REF_ID = "refid"; | private static final String REF_ID = "refid"; | ||||
| private static final String LOCATION = "location"; | private static final String LOCATION = "location"; | ||||
| @@ -136,7 +136,7 @@ public class IsReachable extends ProjectComponent implements Condition { | |||||
| * | * | ||||
| * @return true if the condition is true. | * @return true if the condition is true. | ||||
| * | * | ||||
| * @throws org.apache.tools.ant.BuildException | |||||
| * @throws BuildException | |||||
| * if an error occurs | * if an error occurs | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| @@ -31,7 +31,7 @@ public class Xor extends ConditionBase implements Condition { | |||||
| /** | /** | ||||
| * Evaluate the contained conditions. | * Evaluate the contained conditions. | ||||
| * @return the result of xoring the conditions together. | * @return the result of xoring the conditions together. | ||||
| * @throws org.apache.tools.ant.BuildException | |||||
| * @throws BuildException | |||||
| * if an error occurs. | * if an error occurs. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| @@ -431,7 +431,6 @@ public class CvsTagDiff extends AbstractCvsTask { | |||||
| if (writer.checkError()) { | if (writer.checkError()) { | ||||
| throw new IOException("Encountered an error writing tagdiff"); | throw new IOException("Encountered an error writing tagdiff"); | ||||
| } | } | ||||
| writer.close(); | |||||
| } catch (UnsupportedEncodingException uee) { | } catch (UnsupportedEncodingException uee) { | ||||
| log(uee.toString(), Project.MSG_ERR); | log(uee.toString(), Project.MSG_ERR); | ||||
| } catch (IOException ioe) { | } catch (IOException ioe) { | ||||
| @@ -779,8 +779,8 @@ public class NetRexxC extends MatchingTask { | |||||
| final String eol = System.getProperty("line.separator"); | final String eol = System.getProperty("line.separator"); | ||||
| log( | log( | ||||
| compileList.stream().map(s -> " " + s).collect(Collectors.joining(eol)) | |||||
| , Project.MSG_VERBOSE); | |||||
| compileList.stream().map(s -> " " + s).collect(Collectors.joining(eol)), | |||||
| Project.MSG_VERBOSE); | |||||
| // create a single array of arguments for the compiler | // create a single array of arguments for the compiler | ||||
| String[] compileArgs = | String[] compileArgs = | ||||
| @@ -321,7 +321,7 @@ public class BorlandDeploymentTool extends GenericDeploymentTool | |||||
| * @param sourceJar java.io.File representing the produced jar file | * @param sourceJar java.io.File representing the produced jar file | ||||
| */ | */ | ||||
| private void verifyBorlandJarV4(File sourceJar) { | private void verifyBorlandJarV4(File sourceJar) { | ||||
| org.apache.tools.ant.taskdefs.Java javaTask = null; | |||||
| Java javaTask = null; | |||||
| log("verify BAS " + sourceJar, Project.MSG_INFO); | log("verify BAS " + sourceJar, Project.MSG_INFO); | ||||
| try { | try { | ||||
| String args = verifyArgs; | String args = verifyArgs; | ||||
| @@ -45,7 +45,7 @@ public class OrionDeploymentTool extends GenericDeploymentTool { | |||||
| * @param ejbFiles Hashtable<String, File> | * @param ejbFiles Hashtable<String, File> | ||||
| * @param baseName String | * @param baseName String | ||||
| */ | */ | ||||
| protected void addVendorFiles(Hashtable ejbFiles, String baseName) { | |||||
| protected void addVendorFiles(Hashtable<String, File> ejbFiles, String baseName) { | |||||
| String ddPrefix = usingBaseJarName() ? "" : baseName; | String ddPrefix = usingBaseJarName() ? "" : baseName; | ||||
| File orionDD = new File(getConfig().descriptorDir, ddPrefix + ORION_DD); | File orionDD = new File(getConfig().descriptorDir, ddPrefix + ORION_DD); | ||||
| @@ -85,7 +85,7 @@ public abstract class AbstractHotDeploymentTool implements HotDeploymentTool { | |||||
| * validation of boilerplate attributes. | * validation of boilerplate attributes. | ||||
| * <p>Only the "action" attribute is required in the | * <p>Only the "action" attribute is required in the | ||||
| * base class. Subclasses should check attributes accordingly. | * base class. Subclasses should check attributes accordingly. | ||||
| * @exception org.apache.tools.ant.BuildException if the attributes are invalid or incomplete. | |||||
| * @throws BuildException if the attributes are invalid or incomplete. | |||||
| */ | */ | ||||
| @Override | @Override | ||||
| public void validateAttributes() throws BuildException { | public void validateAttributes() throws BuildException { | ||||
| @@ -90,7 +90,7 @@ public class GenericHotDeploymentTool extends AbstractHotDeploymentTool { | |||||
| * Perform the actual deployment. | * Perform the actual deployment. | ||||
| * For this generic implementation, a JVM is spawned using the | * For this generic implementation, a JVM is spawned using the | ||||
| * supplied classpath, classname, JVM args, and command line arguments. | * supplied classpath, classname, JVM args, and command line arguments. | ||||
| * @exception org.apache.tools.ant.BuildException if the attributes are invalid or incomplete. | |||||
| * @exception BuildException if the attributes are invalid or incomplete. | |||||
| */ | */ | ||||
| @Override | @Override | ||||
| public void deploy() throws BuildException { | public void deploy() throws BuildException { | ||||
| @@ -104,7 +104,7 @@ public class GenericHotDeploymentTool extends AbstractHotDeploymentTool { | |||||
| /** | /** | ||||
| * Validates the passed in attributes. | * Validates the passed in attributes. | ||||
| * Ensures the className and arguments attribute have been set. | * Ensures the className and arguments attribute have been set. | ||||
| * @exception org.apache.tools.ant.BuildException if the attributes are invalid or incomplete. | |||||
| * @throws BuildException if the attributes are invalid or incomplete. | |||||
| */ | */ | ||||
| @Override | @Override | ||||
| public void validateAttributes() throws BuildException { | public void validateAttributes() throws BuildException { | ||||
| @@ -43,13 +43,13 @@ public interface HotDeploymentTool { | |||||
| /** | /** | ||||
| * Validates the passed in attributes. | * Validates the passed in attributes. | ||||
| * @exception org.apache.tools.ant.BuildException if the attributes are invalid or incomplete. | |||||
| * @exception BuildException if the attributes are invalid or incomplete. | |||||
| */ | */ | ||||
| void validateAttributes() throws BuildException; | void validateAttributes() throws BuildException; | ||||
| /** | /** | ||||
| * Perform the actual deployment. | * Perform the actual deployment. | ||||
| * @exception org.apache.tools.ant.BuildException if the attributes are invalid or incomplete. | |||||
| * @throws BuildException if the attributes are invalid or incomplete. | |||||
| */ | */ | ||||
| void deploy() throws BuildException; | void deploy() throws BuildException; | ||||
| @@ -97,7 +97,7 @@ public class ServerDeploy extends Task { | |||||
| * <p>This method calls the deploy() method on each of the vendor-specific tools | * <p>This method calls the deploy() method on each of the vendor-specific tools | ||||
| * in the <code>vendorTools</code> collection. This performs the actual | * in the <code>vendorTools</code> collection. This performs the actual | ||||
| * process of deployment on each tool. | * process of deployment on each tool. | ||||
| * @exception org.apache.tools.ant.BuildException if the attributes | |||||
| * @throws BuildException if the attributes | |||||
| * are invalid or incomplete, or a failure occurs in the deployment process. | * are invalid or incomplete, or a failure occurs in the deployment process. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| @@ -33,6 +33,7 @@ import java.util.Vector; | |||||
| import org.apache.tools.ant.BuildException; | import org.apache.tools.ant.BuildException; | ||||
| import org.apache.tools.ant.Project; | import org.apache.tools.ant.Project; | ||||
| import org.apache.tools.ant.Task; | |||||
| import org.apache.tools.ant.taskdefs.Execute; | import org.apache.tools.ant.taskdefs.Execute; | ||||
| import org.apache.tools.ant.taskdefs.ExecuteStreamHandler; | import org.apache.tools.ant.taskdefs.ExecuteStreamHandler; | ||||
| import org.apache.tools.ant.taskdefs.LogOutputStream; | import org.apache.tools.ant.taskdefs.LogOutputStream; | ||||
| @@ -71,7 +72,7 @@ import org.apache.tools.ant.util.FileUtils; | |||||
| * discussion. | * discussion. | ||||
| * | * | ||||
| */ | */ | ||||
| public class Pvcs extends org.apache.tools.ant.Task { | |||||
| public class Pvcs extends Task { | |||||
| // CheckStyle - magic numbers | // CheckStyle - magic numbers | ||||
| // checking for "X:\ 0=dquote,1=letter,2=:,3=\ | // checking for "X:\ 0=dquote,1=letter,2=:,3=\ | ||||
| private static final int POS_1 = 1; | private static final int POS_1 = 1; | ||||
| @@ -157,7 +158,7 @@ public class Pvcs extends org.apache.tools.ant.Task { | |||||
| } | } | ||||
| /** | /** | ||||
| * @exception org.apache.tools.ant.BuildException Something is stopping the build... | |||||
| * @throws BuildException Something is stopping the build... | |||||
| */ | */ | ||||
| @Override | @Override | ||||
| public void execute() throws BuildException { | public void execute() throws BuildException { | ||||
| @@ -118,11 +118,8 @@ public class ScpFromMessageBySftp extends ScpFromMessage { | |||||
| } | } | ||||
| getDir(channel, remoteFile, localFile); | getDir(channel, remoteFile, localFile); | ||||
| } catch (final SftpException e) { | } catch (final SftpException e) { | ||||
| final JSchException schException = | |||||
| new JSchException("Could not get '" + remoteFile + "' to '" | |||||
| + localFile + "' - " + e.toString()); | |||||
| schException.initCause(e); | |||||
| throw schException; | |||||
| throw new JSchException("Could not get '" + remoteFile + "' to '" | |||||
| + localFile + "' - " + e.toString(), e); | |||||
| } finally { | } finally { | ||||
| if (channel != null) { | if (channel != null) { | ||||
| channel.disconnect(); | channel.disconnect(); | ||||
| @@ -32,6 +32,7 @@ package org.apache.tools.ant.taskdefs.optional.unix; | |||||
| import java.io.File; | import java.io.File; | ||||
| import org.apache.tools.ant.BuildException; | import org.apache.tools.ant.BuildException; | ||||
| import org.apache.tools.ant.taskdefs.ExecuteOn; | |||||
| import org.apache.tools.ant.taskdefs.condition.Os; | import org.apache.tools.ant.taskdefs.condition.Os; | ||||
| import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
| import org.apache.tools.ant.types.FileSet; | import org.apache.tools.ant.types.FileSet; | ||||
| @@ -42,8 +43,7 @@ import org.apache.tools.ant.types.FileSet; | |||||
| * @ant.task category="filesystem" | * @ant.task category="filesystem" | ||||
| */ | */ | ||||
| public abstract class AbstractAccessTask | |||||
| extends org.apache.tools.ant.taskdefs.ExecuteOn { | |||||
| public abstract class AbstractAccessTask extends ExecuteOn { | |||||
| /** | /** | ||||
| * Chmod task for setting file and directory permissions. | * Chmod task for setting file and directory permissions. | ||||
| @@ -211,7 +211,7 @@ public class Symlink extends DispatchTask { | |||||
| // it's already a symlink and the symlink target is the same | // it's already a symlink and the symlink target is the same | ||||
| // as the target noted in the properties file. So there's no | // as the target noted in the properties file. So there's no | ||||
| // need to recreate it | // need to recreate it | ||||
| log("not recreating " + lnk + " as it points to the correct target already" , | |||||
| log("not recreating " + lnk + " as it points to the correct target already", | |||||
| Project.MSG_DEBUG); | Project.MSG_DEBUG); | ||||
| continue; | continue; | ||||
| } | } | ||||
| @@ -219,7 +219,7 @@ public class FilterSet extends DataType implements Cloneable { | |||||
| return getRef().getFilters(); | return getRef().getFilters(); | ||||
| } | } | ||||
| dieOnCircularReference(); | dieOnCircularReference(); | ||||
| //silly hack to avoid stack overflow... | |||||
| // silly hack to avoid stack overflow... | |||||
| if (!readingFiles) { | if (!readingFiles) { | ||||
| readingFiles = true; | readingFiles = true; | ||||
| final int size = filtersFiles.size(); | final int size = filtersFiles.size(); | ||||
| @@ -27,6 +27,7 @@ import java.util.Vector; | |||||
| import org.apache.tools.ant.BuildException; | import org.apache.tools.ant.BuildException; | ||||
| import org.apache.tools.ant.Project; | import org.apache.tools.ant.Project; | ||||
| import org.apache.tools.ant.taskdefs.Redirector; | import org.apache.tools.ant.taskdefs.Redirector; | ||||
| import org.apache.tools.ant.util.MergingMapper; | |||||
| /** | /** | ||||
| * Element representation of a <code>Redirector</code>. | * Element representation of a <code>Redirector</code>. | ||||
| @@ -556,8 +557,7 @@ public class RedirectorElement extends DataType { | |||||
| */ | */ | ||||
| protected Mapper createMergeMapper(File destfile) { | protected Mapper createMergeMapper(File destfile) { | ||||
| Mapper result = new Mapper(getProject()); | Mapper result = new Mapper(getProject()); | ||||
| result.setClassname( | |||||
| org.apache.tools.ant.util.MergingMapper.class.getName()); | |||||
| result.setClassname(MergingMapper.class.getName()); | |||||
| result.setTo(destfile.getAbsolutePath()); | result.setTo(destfile.getAbsolutePath()); | ||||
| return result; | return result; | ||||
| } | } | ||||
| @@ -38,7 +38,7 @@ public class ScriptCondition extends AbstractScriptComponent implements Conditio | |||||
| * | * | ||||
| * @return true if the condition is true | * @return true if the condition is true | ||||
| * | * | ||||
| * @throws org.apache.tools.ant.BuildException | |||||
| * @throws BuildException | |||||
| * if an error occurs | * if an error occurs | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| @@ -86,7 +86,7 @@ public class ScriptSelector extends BaseSelector { | |||||
| /** | /** | ||||
| * Initialize on demand. | * Initialize on demand. | ||||
| * | * | ||||
| * @throws org.apache.tools.ant.BuildException | |||||
| * @throws BuildException | |||||
| * if something goes wrong | * if something goes wrong | ||||
| */ | */ | ||||
| private void init() throws BuildException { | private void init() throws BuildException { | ||||
| @@ -77,7 +77,8 @@ public class TokenizedPath { | |||||
| tokenizedPath[parent.tokenizedPath.length] = child; | tokenizedPath[parent.tokenizedPath.length] = child; | ||||
| } | } | ||||
| /* package */ TokenizedPath(String path, String[] tokens) { | |||||
| /* package */ | |||||
| TokenizedPath(String path, String[] tokens) { | |||||
| this.path = path; | this.path = path; | ||||
| this.tokenizedPath = tokens; | this.tokenizedPath = tokens; | ||||
| } | } | ||||
| @@ -393,6 +393,7 @@ public class ModifiedSelector extends BaseExtendSelector | |||||
| * @param type the type to check against | * @param type the type to check against | ||||
| * @return a castable object | * @return a castable object | ||||
| */ | */ | ||||
| @SuppressWarnings("unchecked") | |||||
| protected <T> T loadClass(String classname, String msg, Class<? extends T> type) { | protected <T> T loadClass(String classname, String msg, Class<? extends T> type) { | ||||
| try { | try { | ||||
| // load the specified class | // load the specified class | ||||
| @@ -295,9 +295,7 @@ public class TarInputStream extends FilterInputStream { | |||||
| try { | try { | ||||
| currEntry = new TarEntry(headerBuf, encoding); | currEntry = new TarEntry(headerBuf, encoding); | ||||
| } catch (IllegalArgumentException e) { | } catch (IllegalArgumentException e) { | ||||
| IOException ioe = new IOException("Error detected parsing the header"); | |||||
| ioe.initCause(e); | |||||
| throw ioe; | |||||
| throw new IOException("Error detected parsing the header", e); | |||||
| } | } | ||||
| if (debug) { | if (debug) { | ||||
| System.err.println("TarInputStream: SET CURRENTRY '" | System.err.println("TarInputStream: SET CURRENTRY '" | ||||
| @@ -244,7 +244,7 @@ public class ZipTest { | |||||
| @Test | @Test | ||||
| public void testTarFileSet() throws IOException { | public void testTarFileSet() throws IOException { | ||||
| buildRule.executeTarget("testTarFileSet"); | |||||
| buildRule.executeTarget("testTarFileSet"); | |||||
| org.apache.tools.zip.ZipFile zf = null; | org.apache.tools.zip.ZipFile zf = null; | ||||
| try { | try { | ||||
| zf = new org.apache.tools.zip.ZipFile(new File(buildRule.getProject().getProperty("output"), "test3.zip")); | zf = new org.apache.tools.zip.ZipFile(new File(buildRule.getProject().getProperty("output"), "test3.zip")); | ||||
| @@ -18,6 +18,7 @@ | |||||
| package org.apache.tools.ant.taskdefs.optional; | package org.apache.tools.ant.taskdefs.optional; | ||||
| import org.apache.tools.ant.BuildException; | import org.apache.tools.ant.BuildException; | ||||
| import org.apache.tools.ant.Project; | |||||
| import org.apache.tools.ant.taskdefs.Execute; | import org.apache.tools.ant.taskdefs.Execute; | ||||
| import org.apache.tools.ant.taskdefs.ExecuteStreamHandler; | import org.apache.tools.ant.taskdefs.ExecuteStreamHandler; | ||||
| import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
| @@ -32,7 +33,7 @@ public class RpmTest { | |||||
| @Test | @Test | ||||
| public void testShouldThrowExceptionWhenRpmFails() throws Exception { | public void testShouldThrowExceptionWhenRpmFails() throws Exception { | ||||
| Rpm rpm = new MyRpm(); | Rpm rpm = new MyRpm(); | ||||
| rpm.setProject(new org.apache.tools.ant.Project()); | |||||
| rpm.setProject(new Project()); | |||||
| rpm.setFailOnError(true); | rpm.setFailOnError(true); | ||||
| // execute | // execute | ||||
| try { | try { | ||||
| @@ -1,9 +1,9 @@ | |||||
| package org.example.junitlauncher.vintage; | package org.example.junitlauncher.vintage; | ||||
| import org.junit.Assert; | |||||
| import org.junit.Ignore; | |||||
| import org.junit.Test; | import org.junit.Test; | ||||
| import static org.junit.Assert.assertEquals; | |||||
| /** | /** | ||||
| * | * | ||||
| */ | */ | ||||
| @@ -11,6 +11,6 @@ public class AlwaysFailingJUnit4Test { | |||||
| @Test | @Test | ||||
| public void testWillFail() throws Exception { | public void testWillFail() throws Exception { | ||||
| Assert.assertEquals("Values weren't equal", 3, 4); | |||||
| assertEquals("Values weren't equal", 3, 4); | |||||
| } | } | ||||
| } | } | ||||