| @@ -53,8 +53,8 @@ | |||||
| <!-- | <!-- | ||||
| Generates the HTML page with the data. | Generates the HTML page with the data. | ||||
| --> | |||||
| <xsl:template name="sorted.html"> | |||||
| --> | |||||
| <xsl:template name="sorted.html"> | |||||
| <html> | <html> | ||||
| <head> | <head> | ||||
| <title>CheckStyle Audit</title> | <title>CheckStyle Audit</title> | ||||
| @@ -71,17 +71,17 @@ | |||||
| <xsl:apply-templates select="." mode="data"/> | <xsl:apply-templates select="." mode="data"/> | ||||
| </body> | </body> | ||||
| </html> | </html> | ||||
| </xsl:template> | |||||
| </xsl:template> | |||||
| <!-- | <!-- | ||||
| Key for detecting duplicate CheckModules | Key for detecting duplicate CheckModules | ||||
| --> | |||||
| --> | |||||
| <xsl:key name="module" match="file/error" use="@source"/> | <xsl:key name="module" match="file/error" use="@source"/> | ||||
| <!-- | <!-- | ||||
| Generates the navagation bar. | Generates the navagation bar. | ||||
| --> | --> | ||||
| @@ -101,9 +101,9 @@ | |||||
| </xsl:for-each> | </xsl:for-each> | ||||
| </ul> | </ul> | ||||
| </xsl:template> | </xsl:template> | ||||
| <!-- | <!-- | ||||
| Generates the data part. | Generates the data part. | ||||
| --> | --> | ||||
| @@ -127,10 +127,10 @@ | |||||
| <!-- | <!-- | ||||
| Generates the content table for the given check module. | Generates the content table for the given check module. | ||||
| @param filter full qualified module name | @param filter full qualified module name | ||||
| --> | |||||
| --> | |||||
| <xsl:template name="data"> | <xsl:template name="data"> | ||||
| <xsl:param name="filter"/> | <xsl:param name="filter"/> | ||||
| <table> | <table> | ||||
| <tr> | <tr> | ||||
| <th>file</th> | <th>file</th> | ||||
| @@ -150,9 +150,9 @@ | |||||
| </xsl:for-each> | </xsl:for-each> | ||||
| </table> | </table> | ||||
| </xsl:template> | </xsl:template> | ||||
| <!-- | <!-- | ||||
| Generates the data rows for the current check module. | Generates the data rows for the current check module. | ||||
| Ignores errors in the current file from other modules. | Ignores errors in the current file from other modules. | ||||
| @@ -183,15 +183,15 @@ | |||||
| <!-- | <!-- | ||||
| Generates the CSS with the layout instructions. | Generates the CSS with the layout instructions. | ||||
| Generated so this XSL is the single source of the whole report. | Generated so this XSL is the single source of the whole report. | ||||
| --> | |||||
| <xsl:template name="sorted.css"> | |||||
| --> | |||||
| <xsl:template name="sorted.css"> | |||||
| body { | body { | ||||
| font:normal 80% arial,helvetica,sanserif; | font:normal 80% arial,helvetica,sanserif; | ||||
| color: black; | color: black; | ||||
| background-color: white; | background-color: white; | ||||
| margin: 0; | margin: 0; | ||||
| padding: 1em; | padding: 1em; | ||||
| min-width: 41em; | |||||
| min-width: 41em; | |||||
| } | } | ||||
| h1 { | h1 { | ||||
| font-weight:bold; | font-weight:bold; | ||||
| @@ -203,9 +203,9 @@ | |||||
| border: 2px ridge silver; | border: 2px ridge silver; | ||||
| } | } | ||||
| html<xsl:text disable-output-escaping="yes">></xsl:text>body h1 { | html<xsl:text disable-output-escaping="yes">></xsl:text>body h1 { | ||||
| border-color: gray; | |||||
| border-color: gray; | |||||
| } | } | ||||
| ul#navigation { | ul#navigation { | ||||
| font-size: 0.83em; | font-size: 0.83em; | ||||
| float: left; width: 18em; | float: left; width: 18em; | ||||
| @@ -233,7 +233,7 @@ | |||||
| ul#navigation a:active { | ul#navigation a:active { | ||||
| color: white; background-color: gray; | color: white; background-color: gray; | ||||
| } | } | ||||
| div#content { | div#content { | ||||
| margin: 0 1em 1em 16em; | margin: 0 1em 1em 16em; | ||||
| padding: 0 1em; | padding: 0 1em; | ||||
| @@ -271,10 +271,10 @@ | |||||
| } | } | ||||
| table tr:nth-child(odd) td { | table tr:nth-child(odd) td { | ||||
| background: #efefef; | background: #efefef; | ||||
| } | |||||
| } | |||||
| table tr:nth-child(even) td { | table tr:nth-child(even) td { | ||||
| background: #fff; | background: #fff; | ||||
| } | |||||
| } | |||||
| </xsl:template> | </xsl:template> | ||||
| @@ -282,8 +282,8 @@ | |||||
| <!-- | <!-- | ||||
| Generates the JavaScript for the dynamic style. | Generates the JavaScript for the dynamic style. | ||||
| Generated so this XSL is the single source of the whole report. | Generated so this XSL is the single source of the whole report. | ||||
| --> | |||||
| <xsl:template name="switch.js"> | |||||
| --> | |||||
| <xsl:template name="switch.js"> | |||||
| /* | /* | ||||
| * Hides all "hideable" div-containers | * Hides all "hideable" div-containers | ||||
| */ | */ | ||||
| @@ -296,11 +296,11 @@ | |||||
| } | } | ||||
| return; | return; | ||||
| } | } | ||||
| /* | /* | ||||
| * Shows one div-container and hides the other. | * Shows one div-container and hides the other. | ||||
| * @param id id of the element to show | |||||
| */ | |||||
| * @param id id of the element to show | |||||
| */ | |||||
| function change(id) { | function change(id) { | ||||
| hideAll(); | hideAll(); | ||||
| e = document.getElementById(id); | e = document.getElementById(id); | ||||
| @@ -310,11 +310,11 @@ | |||||
| window.scrollTo(0, 0); | window.scrollTo(0, 0); | ||||
| return; | return; | ||||
| } | } | ||||
| /* | /* | ||||
| * Shows only the first data row. | * Shows only the first data row. | ||||
| * Used in body:onload so the user could directly see some messages. | |||||
| */ | |||||
| * Used in body:onload so the user could directly see some messages. | |||||
| */ | |||||
| function openFirst() { | function openFirst() { | ||||
| hideAll(); | hideAll(); | ||||
| for (i = 0; i <xsl:text disable-output-escaping="yes"><</xsl:text> allElements.length; i++) { | for (i = 0; i <xsl:text disable-output-escaping="yes"><</xsl:text> allElements.length; i++) { | ||||
| @@ -325,7 +325,7 @@ | |||||
| } | } | ||||
| return; | return; | ||||
| } | } | ||||
| </xsl:template> | |||||
| </xsl:template> | |||||
| @@ -333,19 +333,19 @@ | |||||
| Calculates the index of the last occurence of a substring in a string. | Calculates the index of the last occurence of a substring in a string. | ||||
| @param txt the whole string in which to search | @param txt the whole string in which to search | ||||
| @delimiter the substring to search | @delimiter the substring to search | ||||
| --> | |||||
| --> | |||||
| <xsl:template name="last-index-of"> | <xsl:template name="last-index-of"> | ||||
| <xsl:param name="txt"/> | <xsl:param name="txt"/> | ||||
| <xsl:param name="remainder" select="$txt"/> | <xsl:param name="remainder" select="$txt"/> | ||||
| <xsl:param name="delimiter" select="' '"/> | <xsl:param name="delimiter" select="' '"/> | ||||
| <xsl:choose> | <xsl:choose> | ||||
| <xsl:when test="contains($remainder, $delimiter)"> | <xsl:when test="contains($remainder, $delimiter)"> | ||||
| <xsl:call-template name="last-index-of"> | <xsl:call-template name="last-index-of"> | ||||
| <xsl:with-param name="txt" select="$txt"/> | <xsl:with-param name="txt" select="$txt"/> | ||||
| <xsl:with-param name="remainder" select="substring-after($remainder, $delimiter)"/> | <xsl:with-param name="remainder" select="substring-after($remainder, $delimiter)"/> | ||||
| <xsl:with-param name="delimiter" select="$delimiter"/> | <xsl:with-param name="delimiter" select="$delimiter"/> | ||||
| </xsl:call-template> | |||||
| </xsl:call-template> | |||||
| </xsl:when> | </xsl:when> | ||||
| <xsl:otherwise> | <xsl:otherwise> | ||||
| <xsl:variable name="lastIndex" select="string-length(substring($txt, 1, string-length($txt)-string-length($remainder)))+1"/> | <xsl:variable name="lastIndex" select="string-length(substring($txt, 1, string-length($txt)-string-length($remainder)))+1"/> | ||||
| @@ -364,4 +364,4 @@ | |||||
| </xsl:choose> | </xsl:choose> | ||||
| </xsl:template> | </xsl:template> | ||||
| </xsl:stylesheet> | |||||
| </xsl:stylesheet> | |||||
| @@ -119,7 +119,7 @@ public class AntClassLoader extends ClassLoader implements SubBuildListener { | |||||
| * @return <code>true</code> if there are more elements in the | * @return <code>true</code> if there are more elements in the | ||||
| * enumeration; <code>false</code> otherwise. | * enumeration; <code>false</code> otherwise. | ||||
| */ | */ | ||||
| public boolean hasMoreElements() { | |||||
| public boolean hasMoreElements() { | |||||
| return (this.nextResource != null); | return (this.nextResource != null); | ||||
| } | } | ||||
| @@ -128,7 +128,7 @@ public class AntClassLoader extends ClassLoader implements SubBuildListener { | |||||
| * | * | ||||
| * @return the next resource in the enumeration | * @return the next resource in the enumeration | ||||
| */ | */ | ||||
| public URL nextElement() { | |||||
| public URL nextElement() { | |||||
| final URL ret = this.nextResource; | final URL ret = this.nextResource; | ||||
| if (ret == null) { | if (ret == null) { | ||||
| throw new NoSuchElementException(); | throw new NoSuchElementException(); | ||||
| @@ -220,7 +220,7 @@ public class AntClassLoader extends ClassLoader implements SubBuildListener { | |||||
| /** Static map of jar file/time to manifest class-path entries */ | /** Static map of jar file/time to manifest class-path entries */ | ||||
| private static Map<String, String> pathMap = | private static Map<String, String> pathMap = | ||||
| Collections.synchronizedMap(new HashMap<String, String>()); | |||||
| Collections.synchronizedMap(new HashMap<String, String>()); | |||||
| /** | /** | ||||
| * The context loader saved when setting the thread's current | * The context loader saved when setting the thread's current | ||||
| @@ -289,7 +289,7 @@ public class AntClassLoader extends ClassLoader implements SubBuildListener { | |||||
| * load the a class through this loader. | * load the a class through this loader. | ||||
| */ | */ | ||||
| public AntClassLoader( | public AntClassLoader( | ||||
| final ClassLoader parent, final Project project, final Path classpath, final boolean parentFirst) { | |||||
| final ClassLoader parent, final Project project, final Path classpath, final boolean parentFirst) { | |||||
| this(project, classpath); | this(project, classpath); | ||||
| if (parent != null) { | if (parent != null) { | ||||
| setParent(parent); | setParent(parent); | ||||
| @@ -576,7 +576,7 @@ public class AntClassLoader extends ClassLoader implements SubBuildListener { | |||||
| * Use Class.forName with initialize=true instead. | * Use Class.forName with initialize=true instead. | ||||
| */ | */ | ||||
| @Deprecated | @Deprecated | ||||
| public static void initializeClass(final Class<?> theClass) { | |||||
| public static void initializeClass(final Class<?> theClass) { | |||||
| // ***HACK*** We ask the VM to create an instance | // ***HACK*** We ask the VM to create an instance | ||||
| // by voluntarily providing illegal arguments to force | // by voluntarily providing illegal arguments to force | ||||
| // the VM to run the class' static initializer, while | // the VM to run the class' static initializer, while | ||||
| @@ -698,7 +698,7 @@ public class AntClassLoader extends ClassLoader implements SubBuildListener { | |||||
| * resource cannot be found on the loader's classpath. | * resource cannot be found on the loader's classpath. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public InputStream getResourceAsStream(final String name) { | |||||
| public InputStream getResourceAsStream(final String name) { | |||||
| InputStream resourceStream = null; | InputStream resourceStream = null; | ||||
| if (isParentFirst(name)) { | if (isParentFirst(name)) { | ||||
| resourceStream = loadBaseResource(name); | resourceStream = loadBaseResource(name); | ||||
| @@ -716,8 +716,8 @@ public class AntClassLoader extends ClassLoader implements SubBuildListener { | |||||
| if (resourceStream == null && !isParentFirst(name)) { | if (resourceStream == null && !isParentFirst(name)) { | ||||
| if (ignoreBase) { | if (ignoreBase) { | ||||
| resourceStream = getRootLoader() == null | resourceStream = getRootLoader() == null | ||||
| ? null | |||||
| : getRootLoader().getResourceAsStream(name); | |||||
| ? null | |||||
| : getRootLoader().getResourceAsStream(name); | |||||
| } else { | } else { | ||||
| resourceStream = loadBaseResource(name); | resourceStream = loadBaseResource(name); | ||||
| } | } | ||||
| @@ -877,7 +877,7 @@ public class AntClassLoader extends ClassLoader implements SubBuildListener { | |||||
| * adequate privileges to get the resource. | * adequate privileges to get the resource. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public URL getResource(final String name) { | |||||
| public URL getResource(final String name) { | |||||
| // we need to search the components of the path to see if | // we need to search the components of the path to see if | ||||
| // we can find the class we want. | // we can find the class we want. | ||||
| URL url = null; | URL url = null; | ||||
| @@ -944,7 +944,7 @@ public class AntClassLoader extends ClassLoader implements SubBuildListener { | |||||
| * @exception IOException if I/O errors occurs (can't happen) | * @exception IOException if I/O errors occurs (can't happen) | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| protected Enumeration<URL> findResources(final String name) throws IOException { | |||||
| protected Enumeration<URL> findResources(final String name) throws IOException { | |||||
| return findResources(name, true); | return findResources(name, true); | ||||
| } | } | ||||
| @@ -961,7 +961,7 @@ public class AntClassLoader extends ClassLoader implements SubBuildListener { | |||||
| * @exception IOException if I/O errors occurs (can't happen) | * @exception IOException if I/O errors occurs (can't happen) | ||||
| */ | */ | ||||
| protected Enumeration<URL> findResources(final String name, | protected Enumeration<URL> findResources(final String name, | ||||
| final boolean parentHasBeenSearched) | |||||
| final boolean parentHasBeenSearched) | |||||
| throws IOException { | throws IOException { | ||||
| final Enumeration<URL> mine = new ResourceEnumeration(name); | final Enumeration<URL> mine = new ResourceEnumeration(name); | ||||
| Enumeration<URL> base; | Enumeration<URL> base; | ||||
| @@ -1070,8 +1070,8 @@ public class AntClassLoader extends ClassLoader implements SubBuildListener { | |||||
| * classpath. | * classpath. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| protected synchronized Class<?> loadClass(final String classname, final boolean resolve) | |||||
| throws ClassNotFoundException { | |||||
| protected synchronized Class<?> loadClass(final String classname, final boolean resolve) | |||||
| throws ClassNotFoundException { | |||||
| // 'sync' is needed - otherwise 2 threads can load the same class | // 'sync' is needed - otherwise 2 threads can load the same class | ||||
| // twice, resulting in LinkageError: duplicated class definition. | // twice, resulting in LinkageError: duplicated class definition. | ||||
| // findLoadedClass avoids that, but without sync it won't work. | // findLoadedClass avoids that, but without sync it won't work. | ||||
| @@ -1084,11 +1084,11 @@ public class AntClassLoader extends ClassLoader implements SubBuildListener { | |||||
| try { | try { | ||||
| theClass = findBaseClass(classname); | theClass = findBaseClass(classname); | ||||
| log("Class " + classname + " loaded from parent loader " + "(parentFirst)", | log("Class " + classname + " loaded from parent loader " + "(parentFirst)", | ||||
| Project.MSG_DEBUG); | |||||
| Project.MSG_DEBUG); | |||||
| } catch (final ClassNotFoundException cnfe) { | } catch (final ClassNotFoundException cnfe) { | ||||
| theClass = findClass(classname); | theClass = findClass(classname); | ||||
| log("Class " + classname + " loaded from ant loader " + "(parentFirst)", | log("Class " + classname + " loaded from ant loader " + "(parentFirst)", | ||||
| Project.MSG_DEBUG); | |||||
| Project.MSG_DEBUG); | |||||
| } | } | ||||
| } else { | } else { | ||||
| try { | try { | ||||
| @@ -1135,13 +1135,13 @@ public class AntClassLoader extends ClassLoader implements SubBuildListener { | |||||
| * @throws IOException if the class data cannot be read. | * @throws IOException if the class data cannot be read. | ||||
| */ | */ | ||||
| protected Class<?> defineClassFromData(final File container, final byte[] classData, final String classname) | protected Class<?> defineClassFromData(final File container, final byte[] classData, final String classname) | ||||
| throws IOException { | |||||
| throws IOException { | |||||
| definePackage(container, classname); | definePackage(container, classname); | ||||
| final ProtectionDomain currentPd = Project.class.getProtectionDomain(); | final ProtectionDomain currentPd = Project.class.getProtectionDomain(); | ||||
| final String classResource = getClassFilename(classname); | final String classResource = getClassFilename(classname); | ||||
| final CodeSource src = new CodeSource(FILE_UTILS.getFileURL(container), | final CodeSource src = new CodeSource(FILE_UTILS.getFileURL(container), | ||||
| getCertificates(container, | |||||
| classResource)); | |||||
| getCertificates(container, | |||||
| classResource)); | |||||
| final ProtectionDomain classesPd = | final ProtectionDomain classesPd = | ||||
| new ProtectionDomain(src, currentPd.getPermissions(), | new ProtectionDomain(src, currentPd.getPermissions(), | ||||
| this, | this, | ||||
| @@ -1288,7 +1288,7 @@ public class AntClassLoader extends ClassLoader implements SubBuildListener { | |||||
| } | } | ||||
| } | } | ||||
| definePackage(packageName, specificationTitle, specificationVersion, specificationVendor, | definePackage(packageName, specificationTitle, specificationVersion, specificationVendor, | ||||
| implementationTitle, implementationVersion, implementationVendor, sealBase); | |||||
| implementationTitle, implementationVersion, implementationVendor, sealBase); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -1308,7 +1308,7 @@ public class AntClassLoader extends ClassLoader implements SubBuildListener { | |||||
| * reading the class from the stream. | * reading the class from the stream. | ||||
| */ | */ | ||||
| private Class<?> getClassFromStream(final InputStream stream, final String classname, final File container) | private Class<?> getClassFromStream(final InputStream stream, final String classname, final File container) | ||||
| throws IOException, SecurityException { | |||||
| throws IOException, SecurityException { | |||||
| final ByteArrayOutputStream baos = new ByteArrayOutputStream(); | final ByteArrayOutputStream baos = new ByteArrayOutputStream(); | ||||
| int bytesRead = -1; | int bytesRead = -1; | ||||
| final byte[] buffer = new byte[BUFFER_SIZE]; | final byte[] buffer = new byte[BUFFER_SIZE]; | ||||
| @@ -1332,7 +1332,7 @@ public class AntClassLoader extends ClassLoader implements SubBuildListener { | |||||
| * on this loader's classpath. | * on this loader's classpath. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public Class<?> findClass(final String name) throws ClassNotFoundException { | |||||
| public Class<?> findClass(final String name) throws ClassNotFoundException { | |||||
| log("Finding class " + name, Project.MSG_DEBUG); | log("Finding class " + name, Project.MSG_DEBUG); | ||||
| return findClassInComponents(name); | return findClassInComponents(name); | ||||
| } | } | ||||
| @@ -1380,7 +1380,7 @@ public class AntClassLoader extends ClassLoader implements SubBuildListener { | |||||
| } catch (final IOException ioe) { | } catch (final IOException ioe) { | ||||
| // ioe.printStackTrace(); | // ioe.printStackTrace(); | ||||
| log("Exception reading component " + pathComponent + " (reason: " | log("Exception reading component " + pathComponent + " (reason: " | ||||
| + ioe.getMessage() + ")", Project.MSG_VERBOSE); | |||||
| + ioe.getMessage() + ")", Project.MSG_VERBOSE); | |||||
| } finally { | } finally { | ||||
| FileUtils.close(stream); | FileUtils.close(stream); | ||||
| } | } | ||||
| @@ -1443,7 +1443,7 @@ public class AntClassLoader extends ClassLoader implements SubBuildListener { | |||||
| * | * | ||||
| * @param event the buildStarted event | * @param event the buildStarted event | ||||
| */ | */ | ||||
| public void buildStarted(final BuildEvent event) { | |||||
| public void buildStarted(final BuildEvent event) { | |||||
| // Not significant for the class loader. | // Not significant for the class loader. | ||||
| } | } | ||||
| @@ -1453,7 +1453,7 @@ public class AntClassLoader extends ClassLoader implements SubBuildListener { | |||||
| * | * | ||||
| * @param event the buildFinished event | * @param event the buildFinished event | ||||
| */ | */ | ||||
| public void buildFinished(final BuildEvent event) { | |||||
| public void buildFinished(final BuildEvent event) { | |||||
| cleanup(); | cleanup(); | ||||
| } | } | ||||
| @@ -1466,7 +1466,7 @@ public class AntClassLoader extends ClassLoader implements SubBuildListener { | |||||
| * | * | ||||
| * @since Ant 1.6.2 | * @since Ant 1.6.2 | ||||
| */ | */ | ||||
| public void subBuildFinished(final BuildEvent event) { | |||||
| public void subBuildFinished(final BuildEvent event) { | |||||
| if (event.getProject() == project) { | if (event.getProject() == project) { | ||||
| cleanup(); | cleanup(); | ||||
| } | } | ||||
| @@ -1479,7 +1479,7 @@ public class AntClassLoader extends ClassLoader implements SubBuildListener { | |||||
| * | * | ||||
| * @since Ant 1.6.2 | * @since Ant 1.6.2 | ||||
| */ | */ | ||||
| public void subBuildStarted(final BuildEvent event) { | |||||
| public void subBuildStarted(final BuildEvent event) { | |||||
| // Not significant for the class loader. | // Not significant for the class loader. | ||||
| } | } | ||||
| @@ -1488,7 +1488,7 @@ public class AntClassLoader extends ClassLoader implements SubBuildListener { | |||||
| * | * | ||||
| * @param event the targetStarted event | * @param event the targetStarted event | ||||
| */ | */ | ||||
| public void targetStarted(final BuildEvent event) { | |||||
| public void targetStarted(final BuildEvent event) { | |||||
| // Not significant for the class loader. | // Not significant for the class loader. | ||||
| } | } | ||||
| @@ -1497,7 +1497,7 @@ public class AntClassLoader extends ClassLoader implements SubBuildListener { | |||||
| * | * | ||||
| * @param event the targetFinished event | * @param event the targetFinished event | ||||
| */ | */ | ||||
| public void targetFinished(final BuildEvent event) { | |||||
| public void targetFinished(final BuildEvent event) { | |||||
| // Not significant for the class loader. | // Not significant for the class loader. | ||||
| } | } | ||||
| @@ -1506,7 +1506,7 @@ public class AntClassLoader extends ClassLoader implements SubBuildListener { | |||||
| * | * | ||||
| * @param event the taskStarted event | * @param event the taskStarted event | ||||
| */ | */ | ||||
| public void taskStarted(final BuildEvent event) { | |||||
| public void taskStarted(final BuildEvent event) { | |||||
| // Not significant for the class loader. | // Not significant for the class loader. | ||||
| } | } | ||||
| @@ -1515,7 +1515,7 @@ public class AntClassLoader extends ClassLoader implements SubBuildListener { | |||||
| * | * | ||||
| * @param event the taskFinished event | * @param event the taskFinished event | ||||
| */ | */ | ||||
| public void taskFinished(final BuildEvent event) { | |||||
| public void taskFinished(final BuildEvent event) { | |||||
| // Not significant for the class loader. | // Not significant for the class loader. | ||||
| } | } | ||||
| @@ -1524,7 +1524,7 @@ public class AntClassLoader extends ClassLoader implements SubBuildListener { | |||||
| * | * | ||||
| * @param event the messageLogged event | * @param event the messageLogged event | ||||
| */ | */ | ||||
| public void messageLogged(final BuildEvent event) { | |||||
| public void messageLogged(final BuildEvent event) { | |||||
| // Not significant for the class loader. | // Not significant for the class loader. | ||||
| } | } | ||||
| @@ -1546,7 +1546,7 @@ public class AntClassLoader extends ClassLoader implements SubBuildListener { | |||||
| * @return the path that this classloader has. | * @return the path that this classloader has. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public String toString() { | |||||
| public String toString() { | |||||
| return "AntClassLoader[" + getClasspath() + "]"; | return "AntClassLoader[" + getClasspath() + "]"; | ||||
| } | } | ||||
| @@ -146,7 +146,7 @@ public class DirectoryScanner | |||||
| * method instead. | * method instead. | ||||
| */ | */ | ||||
| @Deprecated | @Deprecated | ||||
| protected static final String[] DEFAULTEXCLUDES = { | |||||
| protected static final String[] DEFAULTEXCLUDES = { | |||||
| // Miscellaneous typical temporary files | // Miscellaneous typical temporary files | ||||
| SelectorUtils.DEEP_TREE_MATCH + "/*~", | SelectorUtils.DEEP_TREE_MATCH + "/*~", | ||||
| SelectorUtils.DEEP_TREE_MATCH + "/#*#", | SelectorUtils.DEEP_TREE_MATCH + "/#*#", | ||||
| @@ -619,7 +619,7 @@ public class DirectoryScanner | |||||
| * | * | ||||
| * @param basedir The base directory to scan. | * @param basedir The base directory to scan. | ||||
| */ | */ | ||||
| public void setBasedir(final String basedir) { | |||||
| public void setBasedir(final String basedir) { | |||||
| setBasedir(basedir == null ? (File) null | setBasedir(basedir == null ? (File) null | ||||
| : new File(basedir.replace('/', File.separatorChar).replace( | : new File(basedir.replace('/', File.separatorChar).replace( | ||||
| '\\', File.separatorChar))); | '\\', File.separatorChar))); | ||||
| @@ -631,7 +631,7 @@ public class DirectoryScanner | |||||
| * | * | ||||
| * @param basedir The base directory for scanning. | * @param basedir The base directory for scanning. | ||||
| */ | */ | ||||
| public synchronized void setBasedir(final File basedir) { | |||||
| public synchronized void setBasedir(final File basedir) { | |||||
| this.basedir = basedir; | this.basedir = basedir; | ||||
| } | } | ||||
| @@ -641,7 +641,7 @@ public class DirectoryScanner | |||||
| * | * | ||||
| * @return the base directory to be scanned. | * @return the base directory to be scanned. | ||||
| */ | */ | ||||
| public synchronized File getBasedir() { | |||||
| public synchronized File getBasedir() { | |||||
| return basedir; | return basedir; | ||||
| } | } | ||||
| @@ -662,7 +662,7 @@ public class DirectoryScanner | |||||
| * @param isCaseSensitive whether or not the file system should be | * @param isCaseSensitive whether or not the file system should be | ||||
| * regarded as a case sensitive one. | * regarded as a case sensitive one. | ||||
| */ | */ | ||||
| public synchronized void setCaseSensitive(final boolean isCaseSensitive) { | |||||
| public synchronized void setCaseSensitive(final boolean isCaseSensitive) { | |||||
| this.isCaseSensitive = isCaseSensitive; | this.isCaseSensitive = isCaseSensitive; | ||||
| } | } | ||||
| @@ -720,7 +720,7 @@ public class DirectoryScanner | |||||
| * list is given, all elements must be | * list is given, all elements must be | ||||
| * non-<code>null</code>. | * non-<code>null</code>. | ||||
| */ | */ | ||||
| public synchronized void setIncludes(final String[] includes) { | |||||
| public synchronized void setIncludes(final String[] includes) { | |||||
| if (includes == null) { | if (includes == null) { | ||||
| this.includes = null; | this.includes = null; | ||||
| } else { | } else { | ||||
| @@ -743,7 +743,7 @@ public class DirectoryScanner | |||||
| * should be excluded. If a non-<code>null</code> list is | * should be excluded. If a non-<code>null</code> list is | ||||
| * given, all elements must be non-<code>null</code>. | * given, all elements must be non-<code>null</code>. | ||||
| */ | */ | ||||
| public synchronized void setExcludes(final String[] excludes) { | |||||
| public synchronized void setExcludes(final String[] excludes) { | |||||
| if (excludes == null) { | if (excludes == null) { | ||||
| this.excludes = null; | this.excludes = null; | ||||
| } else { | } else { | ||||
| @@ -808,7 +808,7 @@ public class DirectoryScanner | |||||
| * | * | ||||
| * @param selectors specifies the selectors to be invoked on a scan. | * @param selectors specifies the selectors to be invoked on a scan. | ||||
| */ | */ | ||||
| public synchronized void setSelectors(final FileSelector[] selectors) { | |||||
| public synchronized void setSelectors(final FileSelector[] selectors) { | |||||
| this.selectors = selectors; | this.selectors = selectors; | ||||
| } | } | ||||
| @@ -833,7 +833,7 @@ public class DirectoryScanner | |||||
| * @exception IllegalStateException if the base directory was set | * @exception IllegalStateException if the base directory was set | ||||
| * incorrectly (i.e. if it doesn't exist or isn't a directory). | * incorrectly (i.e. if it doesn't exist or isn't a directory). | ||||
| */ | */ | ||||
| public void scan() throws IllegalStateException { | |||||
| public void scan() throws IllegalStateException { | |||||
| synchronized (scanLock) { | synchronized (scanLock) { | ||||
| if (scanning) { | if (scanning) { | ||||
| while (scanning) { | while (scanning) { | ||||
| @@ -1568,7 +1568,7 @@ public class DirectoryScanner | |||||
| * @return the names of the files which matched at least one of the | * @return the names of the files which matched at least one of the | ||||
| * include patterns and none of the exclude patterns. | * include patterns and none of the exclude patterns. | ||||
| */ | */ | ||||
| public String[] getIncludedFiles() { | |||||
| public String[] getIncludedFiles() { | |||||
| String[] files; | String[] files; | ||||
| synchronized (this) { | synchronized (this) { | ||||
| if (filesIncluded == null) { | if (filesIncluded == null) { | ||||
| @@ -1603,7 +1603,7 @@ public class DirectoryScanner | |||||
| * | * | ||||
| * @see #slowScan | * @see #slowScan | ||||
| */ | */ | ||||
| public synchronized String[] getNotIncludedFiles() { | |||||
| public synchronized String[] getNotIncludedFiles() { | |||||
| slowScan(); | slowScan(); | ||||
| final String[] files = new String[filesNotIncluded.size()]; | final String[] files = new String[filesNotIncluded.size()]; | ||||
| filesNotIncluded.copyInto(files); | filesNotIncluded.copyInto(files); | ||||
| @@ -1621,7 +1621,7 @@ public class DirectoryScanner | |||||
| * | * | ||||
| * @see #slowScan | * @see #slowScan | ||||
| */ | */ | ||||
| public synchronized String[] getExcludedFiles() { | |||||
| public synchronized String[] getExcludedFiles() { | |||||
| slowScan(); | slowScan(); | ||||
| final String[] files = new String[filesExcluded.size()]; | final String[] files = new String[filesExcluded.size()]; | ||||
| filesExcluded.copyInto(files); | filesExcluded.copyInto(files); | ||||
| @@ -1639,7 +1639,7 @@ public class DirectoryScanner | |||||
| * | * | ||||
| * @see #slowScan | * @see #slowScan | ||||
| */ | */ | ||||
| public synchronized String[] getDeselectedFiles() { | |||||
| public synchronized String[] getDeselectedFiles() { | |||||
| slowScan(); | slowScan(); | ||||
| final String[] files = new String[filesDeselected.size()]; | final String[] files = new String[filesDeselected.size()]; | ||||
| filesDeselected.copyInto(files); | filesDeselected.copyInto(files); | ||||
| @@ -1654,7 +1654,7 @@ public class DirectoryScanner | |||||
| * @return the names of the directories which matched at least one of the | * @return the names of the directories which matched at least one of the | ||||
| * include patterns and none of the exclude patterns. | * include patterns and none of the exclude patterns. | ||||
| */ | */ | ||||
| public String[] getIncludedDirectories() { | |||||
| public String[] getIncludedDirectories() { | |||||
| String[] directories; | String[] directories; | ||||
| synchronized (this) { | synchronized (this) { | ||||
| if (dirsIncluded == null) { | if (dirsIncluded == null) { | ||||
| @@ -1689,7 +1689,7 @@ public class DirectoryScanner | |||||
| * | * | ||||
| * @see #slowScan | * @see #slowScan | ||||
| */ | */ | ||||
| public synchronized String[] getNotIncludedDirectories() { | |||||
| public synchronized String[] getNotIncludedDirectories() { | |||||
| slowScan(); | slowScan(); | ||||
| final String[] directories = new String[dirsNotIncluded.size()]; | final String[] directories = new String[dirsNotIncluded.size()]; | ||||
| dirsNotIncluded.copyInto(directories); | dirsNotIncluded.copyInto(directories); | ||||
| @@ -1707,7 +1707,7 @@ public class DirectoryScanner | |||||
| * | * | ||||
| * @see #slowScan | * @see #slowScan | ||||
| */ | */ | ||||
| public synchronized String[] getExcludedDirectories() { | |||||
| public synchronized String[] getExcludedDirectories() { | |||||
| slowScan(); | slowScan(); | ||||
| final String[] directories = new String[dirsExcluded.size()]; | final String[] directories = new String[dirsExcluded.size()]; | ||||
| dirsExcluded.copyInto(directories); | dirsExcluded.copyInto(directories); | ||||
| @@ -1725,7 +1725,7 @@ public class DirectoryScanner | |||||
| * | * | ||||
| * @see #slowScan | * @see #slowScan | ||||
| */ | */ | ||||
| public synchronized String[] getDeselectedDirectories() { | |||||
| public synchronized String[] getDeselectedDirectories() { | |||||
| slowScan(); | slowScan(); | ||||
| final String[] directories = new String[dirsDeselected.size()]; | final String[] directories = new String[dirsDeselected.size()]; | ||||
| dirsDeselected.copyInto(directories); | dirsDeselected.copyInto(directories); | ||||
| @@ -1754,7 +1754,7 @@ public class DirectoryScanner | |||||
| /** | /** | ||||
| * Add default exclusions to the current exclusions set. | * Add default exclusions to the current exclusions set. | ||||
| */ | */ | ||||
| public synchronized void addDefaultExcludes() { | |||||
| public synchronized void addDefaultExcludes() { | |||||
| final int excludesLength = excludes == null ? 0 : excludes.length; | final int excludesLength = excludes == null ? 0 : excludes.length; | ||||
| String[] newExcludes; | String[] newExcludes; | ||||
| final String[] defaultExcludesTemp = getDefaultExcludes(); | final String[] defaultExcludesTemp = getDefaultExcludes(); | ||||
| @@ -1777,7 +1777,7 @@ public class DirectoryScanner | |||||
| * @return the resource with the given name. | * @return the resource with the given name. | ||||
| * @since Ant 1.5.2 | * @since Ant 1.5.2 | ||||
| */ | */ | ||||
| public synchronized Resource getResource(final String name) { | |||||
| public synchronized Resource getResource(final String name) { | |||||
| return new FileResource(basedir, name); | return new FileResource(basedir, name); | ||||
| } | } | ||||
| @@ -45,7 +45,7 @@ public class ExtensionPoint extends Target { | |||||
| * Throws an exception. | * Throws an exception. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public final void addTask(Task task) { | |||||
| public final void addTask(Task task) { | |||||
| throw new BuildException(NO_CHILDREN_ALLOWED); | throw new BuildException(NO_CHILDREN_ALLOWED); | ||||
| } | } | ||||
| @@ -53,7 +53,7 @@ public class ExtensionPoint extends Target { | |||||
| * Throws an exception. | * Throws an exception. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public final void addDataType(RuntimeConfigurable r) { | |||||
| public final void addDataType(RuntimeConfigurable r) { | |||||
| throw new BuildException(NO_CHILDREN_ALLOWED); | throw new BuildException(NO_CHILDREN_ALLOWED); | ||||
| } | } | ||||
| @@ -552,7 +552,7 @@ public final class IntrospectionHelper { | |||||
| if (nestedElement != null) { | if (nestedElement != null) { | ||||
| nc = new NestedCreator(null) { | nc = new NestedCreator(null) { | ||||
| @Override | @Override | ||||
| Object create(final Project project, final Object parent, final Object ignore) { | |||||
| Object create(final Project project, final Object parent, final Object ignore) { | |||||
| return nestedElement; | return nestedElement; | ||||
| } | } | ||||
| }; | }; | ||||
| @@ -608,7 +608,7 @@ public final class IntrospectionHelper { | |||||
| * element instance, or if the creating method fails. | * element instance, or if the creating method fails. | ||||
| */ | */ | ||||
| @Deprecated | @Deprecated | ||||
| public Object createElement(final Project project, final Object parent, final String elementName) | |||||
| public Object createElement(final Project project, final Object parent, final String elementName) | |||||
| throws BuildException { | throws BuildException { | ||||
| final NestedCreator nc = getNestedCreator(project, "", parent, elementName, null); | final NestedCreator nc = getNestedCreator(project, "", parent, elementName, null); | ||||
| try { | try { | ||||
| @@ -1049,7 +1049,7 @@ public final class IntrospectionHelper { | |||||
| if (java.lang.Object.class == reflectedArg) { | if (java.lang.Object.class == 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) | |||||
| throws InvocationTargetException, | throws InvocationTargetException, | ||||
| IllegalAccessException { | IllegalAccessException { | ||||
| throw new BuildException( | throw new BuildException( | ||||
| @@ -1061,7 +1061,7 @@ public final class IntrospectionHelper { | |||||
| if (java.lang.String.class.equals(reflectedArg)) { | if (java.lang.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) | |||||
| throws InvocationTargetException, IllegalAccessException { | throws InvocationTargetException, IllegalAccessException { | ||||
| m.invoke(parent, (Object[]) new String[] {value}); | m.invoke(parent, (Object[]) new String[] {value}); | ||||
| } | } | ||||
| @@ -1071,7 +1071,7 @@ public final class IntrospectionHelper { | |||||
| if (java.lang.Character.class.equals(reflectedArg)) { | if (java.lang.Character.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) | |||||
| throws InvocationTargetException, IllegalAccessException { | throws InvocationTargetException, IllegalAccessException { | ||||
| if (value.length() == 0) { | if (value.length() == 0) { | ||||
| throw new BuildException("The value \"\" is not a " | throw new BuildException("The value \"\" is not a " | ||||
| @@ -1085,7 +1085,7 @@ public final class IntrospectionHelper { | |||||
| if (java.lang.Boolean.class.equals(reflectedArg)) { | if (java.lang.Boolean.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) | |||||
| throws InvocationTargetException, IllegalAccessException { | throws InvocationTargetException, IllegalAccessException { | ||||
| m.invoke(parent, (Object[]) new Boolean[] { | m.invoke(parent, (Object[]) new Boolean[] { | ||||
| Project.toBoolean(value) ? Boolean.TRUE : Boolean.FALSE }); | Project.toBoolean(value) ? Boolean.TRUE : Boolean.FALSE }); | ||||
| @@ -1096,7 +1096,7 @@ public final class IntrospectionHelper { | |||||
| if (java.lang.Class.class.equals(reflectedArg)) { | if (java.lang.Class.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) | |||||
| throws InvocationTargetException, IllegalAccessException, BuildException { | throws InvocationTargetException, IllegalAccessException, BuildException { | ||||
| try { | try { | ||||
| m.invoke(parent, new Object[] {Class.forName(value)}); | m.invoke(parent, new Object[] {Class.forName(value)}); | ||||
| @@ -1110,7 +1110,7 @@ public final class IntrospectionHelper { | |||||
| if (java.io.File.class.equals(reflectedArg)) { | if (java.io.File.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) | |||||
| throws InvocationTargetException, IllegalAccessException { | throws InvocationTargetException, IllegalAccessException { | ||||
| m.invoke(parent, new Object[] {p.resolveFile(value)}); | m.invoke(parent, new Object[] {p.resolveFile(value)}); | ||||
| } | } | ||||
| @@ -1120,7 +1120,7 @@ public final class IntrospectionHelper { | |||||
| if (Resource.class.equals(reflectedArg) || FileProvider.class.equals(reflectedArg)) { | if (Resource.class.equals(reflectedArg) || FileProvider.class.equals(reflectedArg)) { | ||||
| return new AttributeSetter(m, arg) { | return new AttributeSetter(m, arg) { | ||||
| @Override | @Override | ||||
| void set(final Project p, final Object parent, final String value) throws InvocationTargetException, | |||||
| void set(final Project p, final Object parent, final String value) throws InvocationTargetException, | |||||
| IllegalAccessException, BuildException { | IllegalAccessException, BuildException { | ||||
| m.invoke(parent, new Object[] {new FileResource(p, p.resolveFile(value))}); | m.invoke(parent, new Object[] {new FileResource(p, p.resolveFile(value))}); | ||||
| }; | }; | ||||
| @@ -1130,7 +1130,7 @@ public final class IntrospectionHelper { | |||||
| if (EnumeratedAttribute.class.isAssignableFrom(reflectedArg)) { | if (EnumeratedAttribute.class.isAssignableFrom(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) | |||||
| throws InvocationTargetException, IllegalAccessException, BuildException { | throws InvocationTargetException, IllegalAccessException, BuildException { | ||||
| try { | try { | ||||
| final EnumeratedAttribute ea = (EnumeratedAttribute) reflectedArg.newInstance(); | final EnumeratedAttribute ea = (EnumeratedAttribute) reflectedArg.newInstance(); | ||||
| @@ -1151,7 +1151,7 @@ public final class IntrospectionHelper { | |||||
| if (java.lang.Long.class.equals(reflectedArg)) { | if (java.lang.Long.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) | |||||
| throws InvocationTargetException, IllegalAccessException, BuildException { | throws InvocationTargetException, IllegalAccessException, BuildException { | ||||
| try { | try { | ||||
| m.invoke(parent, new Object[] { | m.invoke(parent, new Object[] { | ||||
| @@ -1195,7 +1195,7 @@ public final class IntrospectionHelper { | |||||
| 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) | |||||
| throws InvocationTargetException, IllegalAccessException, BuildException { | throws InvocationTargetException, IllegalAccessException, BuildException { | ||||
| try { | try { | ||||
| final Object[] args = finalIncludeProject | final Object[] args = finalIncludeProject | ||||
| @@ -1229,14 +1229,13 @@ public final class IntrospectionHelper { | |||||
| if (reflectedArg.isEnum()) { | if (reflectedArg.isEnum()) { | ||||
| 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) | |||||
| throws InvocationTargetException, IllegalAccessException, | throws InvocationTargetException, IllegalAccessException, | ||||
| BuildException { | BuildException { | ||||
| Enum<?> setValue; | Enum<?> setValue; | ||||
| try { | try { | ||||
| @SuppressWarnings({ "unchecked", "rawtypes" }) | @SuppressWarnings({ "unchecked", "rawtypes" }) | ||||
| final | |||||
| Enum<?> enumValue = Enum.valueOf((Class<? extends Enum>) reflectedArg, | |||||
| final Enum<?> enumValue = Enum.valueOf((Class<? extends Enum>) reflectedArg, | |||||
| value); | value); | ||||
| setValue = enumValue; | setValue = enumValue; | ||||
| } catch (final IllegalArgumentException e) { | } catch (final IllegalArgumentException e) { | ||||
| @@ -1422,7 +1421,7 @@ public final class IntrospectionHelper { | |||||
| } | } | ||||
| @Override | @Override | ||||
| Object create(final Project project, final Object parent, final Object ignore) | |||||
| Object create(final Project project, final Object parent, final Object ignore) | |||||
| throws InvocationTargetException, IllegalAccessException { | throws InvocationTargetException, IllegalAccessException { | ||||
| return getMethod().invoke(parent, new Object[] {}); | return getMethod().invoke(parent, new Object[] {}); | ||||
| } | } | ||||
| @@ -1444,12 +1443,12 @@ public final class IntrospectionHelper { | |||||
| } | } | ||||
| @Override | @Override | ||||
| boolean isPolyMorphic() { | |||||
| boolean isPolyMorphic() { | |||||
| return true; | return true; | ||||
| } | } | ||||
| @Override | @Override | ||||
| Object create(final Project project, final Object parent, Object child) | |||||
| Object create(final Project project, final Object parent, Object child) | |||||
| throws InvocationTargetException, IllegalAccessException, InstantiationException { | throws InvocationTargetException, IllegalAccessException, InstantiationException { | ||||
| if (child == null) { | if (child == null) { | ||||
| child = constructor.newInstance( | child = constructor.newInstance( | ||||
| @@ -1466,7 +1465,7 @@ public final class IntrospectionHelper { | |||||
| } | } | ||||
| @Override | @Override | ||||
| void store(final Object parent, final Object child) | |||||
| void store(final Object parent, final Object child) | |||||
| throws InvocationTargetException, IllegalAccessException, InstantiationException { | throws InvocationTargetException, IllegalAccessException, InstantiationException { | ||||
| if (behavior == ADD_CONFIGURED) { | if (behavior == ADD_CONFIGURED) { | ||||
| istore(parent, child); | istore(parent, child); | ||||
| @@ -1565,7 +1564,7 @@ public final class IntrospectionHelper { | |||||
| return new NestedCreator(methodAndObject.method) { | return new NestedCreator(methodAndObject.method) { | ||||
| @Override | @Override | ||||
| Object create(final Project project, final Object parent, final Object ignore) | |||||
| Object create(final Project project, final Object parent, final Object ignore) | |||||
| throws InvocationTargetException, IllegalAccessException { | throws InvocationTargetException, IllegalAccessException { | ||||
| if (!getMethod().getName().endsWith("Configured")) { | if (!getMethod().getName().endsWith("Configured")) { | ||||
| getMethod().invoke(parent, new Object[] {realObject}); | getMethod().invoke(parent, new Object[] {realObject}); | ||||
| @@ -1574,12 +1573,12 @@ public final class IntrospectionHelper { | |||||
| } | } | ||||
| @Override | @Override | ||||
| Object getRealObject() { | |||||
| Object getRealObject() { | |||||
| return realObject; | return realObject; | ||||
| } | } | ||||
| @Override | @Override | ||||
| void store(final Object parent, final Object child) throws InvocationTargetException, | |||||
| void store(final Object parent, final Object child) throws InvocationTargetException, | |||||
| IllegalAccessException, InstantiationException { | IllegalAccessException, InstantiationException { | ||||
| if (getMethod().getName().endsWith("Configured")) { | if (getMethod().getName().endsWith("Configured")) { | ||||
| getMethod().invoke(parent, new Object[] {realObject}); | getMethod().invoke(parent, new Object[] {realObject}); | ||||
| @@ -157,7 +157,7 @@ public class Main implements AntMain { | |||||
| private final Map<Class<?>, List<String>> extraArguments = new HashMap<Class<?>, List<String>>(); | private final Map<Class<?>, List<String>> extraArguments = new HashMap<Class<?>, List<String>>(); | ||||
| private static final GetProperty NOPROPERTIES = new GetProperty() { | private static final GetProperty NOPROPERTIES = new GetProperty() { | ||||
| public Object getProperty(final String aName) { | |||||
| public Object getProperty(final String aName) { | |||||
| // No existing property takes precedence | // No existing property takes precedence | ||||
| return null; | return null; | ||||
| } | } | ||||
| @@ -207,7 +207,7 @@ public class Main implements AntMain { | |||||
| * | * | ||||
| * @since Ant 1.6 | * @since Ant 1.6 | ||||
| */ | */ | ||||
| public void startAnt(final String[] args, final Properties additionalUserProperties, | |||||
| public void startAnt(final String[] args, final Properties additionalUserProperties, | |||||
| final ClassLoader coreLoader) { | final ClassLoader coreLoader) { | ||||
| try { | try { | ||||
| @@ -305,7 +305,7 @@ public class Main implements AntMain { | |||||
| * @deprecated since 1.6.x | * @deprecated since 1.6.x | ||||
| */ | */ | ||||
| @Deprecated | @Deprecated | ||||
| protected Main(final String[] args) throws BuildException { | |||||
| protected Main(final String[] args) throws BuildException { | |||||
| processArgs(args); | processArgs(args); | ||||
| } | } | ||||
| @@ -684,7 +684,7 @@ public class Main implements AntMain { | |||||
| * @return Parent file or null if none | * @return Parent file or null if none | ||||
| */ | */ | ||||
| @Deprecated | @Deprecated | ||||
| private File getParentFile(final File file) { | |||||
| private File getParentFile(final File file) { | |||||
| final File parent = file.getParentFile(); | final File parent = file.getParentFile(); | ||||
| if (parent != null && msgOutputLevel >= Project.MSG_VERBOSE) { | if (parent != null && msgOutputLevel >= Project.MSG_VERBOSE) { | ||||
| @@ -898,11 +898,9 @@ public class Main implements AntMain { | |||||
| // resolve properties | // resolve properties | ||||
| final PropertyHelper propertyHelper = PropertyHelper.getPropertyHelper(project); | final PropertyHelper propertyHelper = PropertyHelper.getPropertyHelper(project); | ||||
| @SuppressWarnings({ "rawtypes", "unchecked" }) | @SuppressWarnings({ "rawtypes", "unchecked" }) | ||||
| final | |||||
| Map raw = new HashMap(definedProps); | |||||
| final Map raw = new HashMap(definedProps); | |||||
| @SuppressWarnings("unchecked") | @SuppressWarnings("unchecked") | ||||
| final | |||||
| Map<String, Object> props = raw; | |||||
| final Map<String, Object> props = raw; | |||||
| final ResolvePropertyMap resolver = new ResolvePropertyMap(project, | final ResolvePropertyMap resolver = new ResolvePropertyMap(project, | ||||
| NOPROPERTIES, propertyHelper.getExpanders()); | NOPROPERTIES, propertyHelper.getExpanders()); | ||||
| @@ -92,7 +92,7 @@ public class Project implements ResourceFactory { | |||||
| * Use {@link JavaEnvUtils#JAVA_1_0} instead. | * Use {@link JavaEnvUtils#JAVA_1_0} instead. | ||||
| */ | */ | ||||
| @Deprecated | @Deprecated | ||||
| public static final String JAVA_1_0 = JavaEnvUtils.JAVA_1_0; | |||||
| public static final String JAVA_1_0 = JavaEnvUtils.JAVA_1_0; | |||||
| /** | /** | ||||
| * Version constant for Java 1.1 . | * Version constant for Java 1.1 . | ||||
| * | * | ||||
| @@ -100,7 +100,7 @@ public class Project implements ResourceFactory { | |||||
| * Use {@link JavaEnvUtils#JAVA_1_1} instead. | * Use {@link JavaEnvUtils#JAVA_1_1} instead. | ||||
| */ | */ | ||||
| @Deprecated | @Deprecated | ||||
| public static final String JAVA_1_1 = JavaEnvUtils.JAVA_1_1; | |||||
| public static final String JAVA_1_1 = JavaEnvUtils.JAVA_1_1; | |||||
| /** | /** | ||||
| * Version constant for Java 1.2 . | * Version constant for Java 1.2 . | ||||
| * | * | ||||
| @@ -108,7 +108,7 @@ public class Project implements ResourceFactory { | |||||
| * Use {@link JavaEnvUtils#JAVA_1_2} instead. | * Use {@link JavaEnvUtils#JAVA_1_2} instead. | ||||
| */ | */ | ||||
| @Deprecated | @Deprecated | ||||
| public static final String JAVA_1_2 = JavaEnvUtils.JAVA_1_2; | |||||
| public static final String JAVA_1_2 = JavaEnvUtils.JAVA_1_2; | |||||
| /** | /** | ||||
| * Version constant for Java 1.3 . | * Version constant for Java 1.3 . | ||||
| * | * | ||||
| @@ -116,7 +116,7 @@ public class Project implements ResourceFactory { | |||||
| * Use {@link JavaEnvUtils#JAVA_1_3} instead. | * Use {@link JavaEnvUtils#JAVA_1_3} instead. | ||||
| */ | */ | ||||
| @Deprecated | @Deprecated | ||||
| public static final String JAVA_1_3 = JavaEnvUtils.JAVA_1_3; | |||||
| public static final String JAVA_1_3 = JavaEnvUtils.JAVA_1_3; | |||||
| /** | /** | ||||
| * Version constant for Java 1.4 . | * Version constant for Java 1.4 . | ||||
| * | * | ||||
| @@ -124,7 +124,7 @@ public class Project implements ResourceFactory { | |||||
| * Use {@link JavaEnvUtils#JAVA_1_4} instead. | * Use {@link JavaEnvUtils#JAVA_1_4} instead. | ||||
| */ | */ | ||||
| @Deprecated | @Deprecated | ||||
| public static final String JAVA_1_4 = JavaEnvUtils.JAVA_1_4; | |||||
| public static final String JAVA_1_4 = JavaEnvUtils.JAVA_1_4; | |||||
| /** Default filter start token. */ | /** Default filter start token. */ | ||||
| public static final String TOKEN_START = FilterSet.DEFAULT_TOKEN_START; | public static final String TOKEN_START = FilterSet.DEFAULT_TOKEN_START; | ||||
| @@ -179,7 +179,7 @@ public class Project implements ResourceFactory { | |||||
| messageLogged */ | messageLogged */ | ||||
| private final ThreadLocal<Boolean> isLoggingMessage = new ThreadLocal<Boolean>() { | private final ThreadLocal<Boolean> isLoggingMessage = new ThreadLocal<Boolean>() { | ||||
| @Override | @Override | ||||
| protected Boolean initialValue() { | |||||
| protected Boolean initialValue() { | |||||
| return Boolean.FALSE; | return Boolean.FALSE; | ||||
| } | } | ||||
| }; | }; | ||||
| @@ -713,7 +713,7 @@ public class Project implements ResourceFactory { | |||||
| * @see #setDefault(String) | * @see #setDefault(String) | ||||
| */ | */ | ||||
| @Deprecated | @Deprecated | ||||
| public void setDefaultTarget(final String defaultTarget) { | |||||
| public void setDefaultTarget(final String defaultTarget) { | |||||
| setDefault(defaultTarget); | setDefault(defaultTarget); | ||||
| } | } | ||||
| @@ -798,7 +798,7 @@ public class Project implements ResourceFactory { | |||||
| * @see FilterSet#addFilter(String,String) | * @see FilterSet#addFilter(String,String) | ||||
| */ | */ | ||||
| @Deprecated | @Deprecated | ||||
| public void addFilter(final String token, final String value) { | |||||
| public void addFilter(final String token, final String value) { | |||||
| if (token == null) { | if (token == null) { | ||||
| return; | return; | ||||
| } | } | ||||
| @@ -818,7 +818,7 @@ public class Project implements ResourceFactory { | |||||
| * @see FilterSet#getFilterHash() | * @see FilterSet#getFilterHash() | ||||
| */ | */ | ||||
| @Deprecated | @Deprecated | ||||
| public Hashtable<String, String> getFilters() { | |||||
| public Hashtable<String, String> getFilters() { | |||||
| // we need to build the hashtable dynamically | // we need to build the hashtable dynamically | ||||
| return globalFilterSet.getFilterHash(); | return globalFilterSet.getFilterHash(); | ||||
| } | } | ||||
| @@ -910,7 +910,7 @@ public class Project implements ResourceFactory { | |||||
| * Use org.apache.tools.ant.util.JavaEnvUtils instead. | * Use org.apache.tools.ant.util.JavaEnvUtils instead. | ||||
| */ | */ | ||||
| @Deprecated | @Deprecated | ||||
| public static String getJavaVersion() { | |||||
| public static String getJavaVersion() { | |||||
| return JavaEnvUtils.getJavaVersion(); | return JavaEnvUtils.getJavaVersion(); | ||||
| } | } | ||||
| @@ -1461,7 +1461,7 @@ public class Project implements ResourceFactory { | |||||
| * @deprecated since 1.4.x | * @deprecated since 1.4.x | ||||
| */ | */ | ||||
| @Deprecated | @Deprecated | ||||
| public File resolveFile(final String fileName, final File rootDir) { | |||||
| public File resolveFile(final String fileName, final File rootDir) { | |||||
| return FILE_UTILS.resolveFile(rootDir, fileName); | return FILE_UTILS.resolveFile(rootDir, fileName); | ||||
| } | } | ||||
| @@ -1501,7 +1501,7 @@ public class Project implements ResourceFactory { | |||||
| * @see PathTokenizer | * @see PathTokenizer | ||||
| */ | */ | ||||
| @Deprecated | @Deprecated | ||||
| public static String translatePath(final String toProcess) { | |||||
| public static String translatePath(final String toProcess) { | |||||
| return FileUtils.translatePath(toProcess); | return FileUtils.translatePath(toProcess); | ||||
| } | } | ||||
| @@ -1519,7 +1519,7 @@ public class Project implements ResourceFactory { | |||||
| * @deprecated since 1.4.x | * @deprecated since 1.4.x | ||||
| */ | */ | ||||
| @Deprecated | @Deprecated | ||||
| public void copyFile(final String sourceFile, final String destFile) | |||||
| public void copyFile(final String sourceFile, final String destFile) | |||||
| throws IOException { | throws IOException { | ||||
| FILE_UTILS.copyFile(sourceFile, destFile); | FILE_UTILS.copyFile(sourceFile, destFile); | ||||
| } | } | ||||
| @@ -1540,7 +1540,7 @@ public class Project implements ResourceFactory { | |||||
| * @deprecated since 1.4.x | * @deprecated since 1.4.x | ||||
| */ | */ | ||||
| @Deprecated | @Deprecated | ||||
| public void copyFile(final String sourceFile, final String destFile, final boolean filtering) | |||||
| public void copyFile(final String sourceFile, final String destFile, final boolean filtering) | |||||
| throws IOException { | throws IOException { | ||||
| FILE_UTILS.copyFile(sourceFile, destFile, | FILE_UTILS.copyFile(sourceFile, destFile, | ||||
| filtering ? globalFilters : null); | filtering ? globalFilters : null); | ||||
| @@ -1565,7 +1565,7 @@ public class Project implements ResourceFactory { | |||||
| * @deprecated since 1.4.x | * @deprecated since 1.4.x | ||||
| */ | */ | ||||
| @Deprecated | @Deprecated | ||||
| public void copyFile(final String sourceFile, final String destFile, final boolean filtering, | |||||
| public void copyFile(final String sourceFile, final String destFile, final boolean filtering, | |||||
| final boolean overwrite) throws IOException { | final boolean overwrite) throws IOException { | ||||
| FILE_UTILS.copyFile(sourceFile, destFile, | FILE_UTILS.copyFile(sourceFile, destFile, | ||||
| filtering ? globalFilters : null, overwrite); | filtering ? globalFilters : null, overwrite); | ||||
| @@ -1595,7 +1595,7 @@ public class Project implements ResourceFactory { | |||||
| * @deprecated since 1.4.x | * @deprecated since 1.4.x | ||||
| */ | */ | ||||
| @Deprecated | @Deprecated | ||||
| public void copyFile(final String sourceFile, final String destFile, final boolean filtering, | |||||
| public void copyFile(final String sourceFile, final String destFile, final boolean filtering, | |||||
| final boolean overwrite, final boolean preserveLastModified) | final boolean overwrite, final boolean preserveLastModified) | ||||
| throws IOException { | throws IOException { | ||||
| FILE_UTILS.copyFile(sourceFile, destFile, | FILE_UTILS.copyFile(sourceFile, destFile, | ||||
| @@ -1616,7 +1616,7 @@ public class Project implements ResourceFactory { | |||||
| * @deprecated since 1.4.x | * @deprecated since 1.4.x | ||||
| */ | */ | ||||
| @Deprecated | @Deprecated | ||||
| public void copyFile(final File sourceFile, final File destFile) throws IOException { | |||||
| public void copyFile(final File sourceFile, final File destFile) throws IOException { | |||||
| FILE_UTILS.copyFile(sourceFile, destFile); | FILE_UTILS.copyFile(sourceFile, destFile); | ||||
| } | } | ||||
| @@ -1636,7 +1636,7 @@ public class Project implements ResourceFactory { | |||||
| * @deprecated since 1.4.x | * @deprecated since 1.4.x | ||||
| */ | */ | ||||
| @Deprecated | @Deprecated | ||||
| public void copyFile(final File sourceFile, final File destFile, final boolean filtering) | |||||
| public void copyFile(final File sourceFile, final File destFile, final boolean filtering) | |||||
| throws IOException { | throws IOException { | ||||
| FILE_UTILS.copyFile(sourceFile, destFile, | FILE_UTILS.copyFile(sourceFile, destFile, | ||||
| filtering ? globalFilters : null); | filtering ? globalFilters : null); | ||||
| @@ -1661,7 +1661,7 @@ public class Project implements ResourceFactory { | |||||
| * @deprecated since 1.4.x | * @deprecated since 1.4.x | ||||
| */ | */ | ||||
| @Deprecated | @Deprecated | ||||
| public void copyFile(final File sourceFile, final File destFile, final boolean filtering, | |||||
| public void copyFile(final File sourceFile, final File destFile, final boolean filtering, | |||||
| final boolean overwrite) throws IOException { | final boolean overwrite) throws IOException { | ||||
| FILE_UTILS.copyFile(sourceFile, destFile, | FILE_UTILS.copyFile(sourceFile, destFile, | ||||
| filtering ? globalFilters : null, overwrite); | filtering ? globalFilters : null, overwrite); | ||||
| @@ -1691,7 +1691,7 @@ public class Project implements ResourceFactory { | |||||
| * @deprecated since 1.4.x | * @deprecated since 1.4.x | ||||
| */ | */ | ||||
| @Deprecated | @Deprecated | ||||
| public void copyFile(final File sourceFile, final File destFile, final boolean filtering, | |||||
| public void copyFile(final File sourceFile, final File destFile, final boolean filtering, | |||||
| final boolean overwrite, final boolean preserveLastModified) | final boolean overwrite, final boolean preserveLastModified) | ||||
| throws IOException { | throws IOException { | ||||
| FILE_UTILS.copyFile(sourceFile, destFile, | FILE_UTILS.copyFile(sourceFile, destFile, | ||||
| @@ -1714,7 +1714,7 @@ public class Project implements ResourceFactory { | |||||
| * above 1.1. | * above 1.1. | ||||
| */ | */ | ||||
| @Deprecated | @Deprecated | ||||
| public void setFileLastModified(final File file, final long time) | |||||
| public void setFileLastModified(final File file, final long time) | |||||
| throws BuildException { | throws BuildException { | ||||
| FILE_UTILS.setFileLastModified(file, time); | FILE_UTILS.setFileLastModified(file, time); | ||||
| log("Setting modification time for " + file, MSG_VERBOSE); | log("Setting modification time for " + file, MSG_VERBOSE); | ||||
| @@ -2443,7 +2443,7 @@ public class Project implements ResourceFactory { | |||||
| * @return mapped value. | * @return mapped value. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public Object get(final Object key) { | |||||
| public Object get(final Object key) { | |||||
| Object o = getReal(key); | Object o = getReal(key); | ||||
| if (o instanceof UnknownElement) { | if (o instanceof UnknownElement) { | ||||
| // Make sure that | // Make sure that | ||||
| @@ -2487,7 +2487,7 @@ public class Project implements ResourceFactory { | |||||
| * @return the file resource. | * @return the file resource. | ||||
| * @since Ant 1.7 | * @since Ant 1.7 | ||||
| */ | */ | ||||
| public Resource getResource(final String name) { | |||||
| public Resource getResource(final String name) { | |||||
| return new FileResource(getBaseDir(), name); | return new FileResource(getBaseDir(), name); | ||||
| } | } | ||||
| } | } | ||||
| @@ -91,7 +91,7 @@ public final class ConcatFilter extends BaseParamFilterReader | |||||
| * during reading | * during reading | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public int read() throws IOException { | |||||
| public int read() throws IOException { | |||||
| // do the "singleton" initialization | // do the "singleton" initialization | ||||
| if (!getInitialized()) { | if (!getInitialized()) { | ||||
| initialize(); | initialize(); | ||||
| @@ -171,7 +171,7 @@ public final class ConcatFilter extends BaseParamFilterReader | |||||
| * @return a new filter based on this configuration, but filtering | * @return a new filter based on this configuration, but filtering | ||||
| * the specified reader | * the specified reader | ||||
| */ | */ | ||||
| public Reader chain(final Reader rdr) { | |||||
| public Reader chain(final Reader rdr) { | |||||
| final ConcatFilter newFilter = new ConcatFilter(rdr); | final ConcatFilter newFilter = new ConcatFilter(rdr); | ||||
| newFilter.setPrepend(getPrepend()); | newFilter.setPrepend(getPrepend()); | ||||
| newFilter.setAppend(getAppend()); | newFilter.setAppend(getAppend()); | ||||
| @@ -35,8 +35,8 @@ import java.util.StringTokenizer; | |||||
| */ | */ | ||||
| public class Launcher { | public class Launcher { | ||||
| private Launcher() { | |||||
| } | |||||
| private Launcher() { | |||||
| } | |||||
| /** | /** | ||||
| * The Ant Home (installation) Directory property. | * The Ant Home (installation) Directory property. | ||||
| @@ -156,7 +156,7 @@ public class Launcher { | |||||
| final URL url = Locator.fileToURL(element); | final URL url = Locator.fileToURL(element); | ||||
| if (launchDiag) { | if (launchDiag) { | ||||
| System.out.println("adding library URL: " + url); | |||||
| System.out.println("adding library URL: " + url); | |||||
| } | } | ||||
| libPathURLs.add(url); | libPathURLs.add(url); | ||||
| } | } | ||||
| @@ -208,9 +208,9 @@ public class AnsiColorLogger extends DefaultLogger { | |||||
| */ | */ | ||||
| /** {@inheritDoc}. */ | /** {@inheritDoc}. */ | ||||
| @Override | @Override | ||||
| protected void printMessage(final String message, | |||||
| final PrintStream stream, | |||||
| final int priority) { | |||||
| protected void printMessage(final String message, | |||||
| final PrintStream stream, | |||||
| final int priority) { | |||||
| if (message != null && stream != null) { | if (message != null && stream != null) { | ||||
| if (!colorsSet) { | if (!colorsSet) { | ||||
| setColors(); | setColors(); | ||||
| @@ -28,34 +28,34 @@ import org.apache.tools.ant.DefaultLogger; | |||||
| public class SilentLogger extends DefaultLogger { | public class SilentLogger extends DefaultLogger { | ||||
| @Override | @Override | ||||
| public void buildStarted(BuildEvent event) { | |||||
| public void buildStarted(BuildEvent event) { | |||||
| // log nothing | // log nothing | ||||
| } | } | ||||
| @Override | @Override | ||||
| public void buildFinished(BuildEvent event) { | |||||
| public void buildFinished(BuildEvent event) { | |||||
| if (event.getException() != null) { | if (event.getException() != null) { | ||||
| super.buildFinished(event); | super.buildFinished(event); | ||||
| } | } | ||||
| } | } | ||||
| @Override | @Override | ||||
| public void targetStarted(BuildEvent event) { | |||||
| public void targetStarted(BuildEvent event) { | |||||
| // log nothing | // log nothing | ||||
| } | } | ||||
| @Override | @Override | ||||
| public void targetFinished(BuildEvent event) { | |||||
| public void targetFinished(BuildEvent event) { | |||||
| // log nothing | // log nothing | ||||
| } | } | ||||
| @Override | @Override | ||||
| public void taskStarted(BuildEvent event) { | |||||
| public void taskStarted(BuildEvent event) { | |||||
| // log nothing | // log nothing | ||||
| } | } | ||||
| @Override | @Override | ||||
| public void taskFinished(BuildEvent event) { | |||||
| public void taskFinished(BuildEvent event) { | |||||
| // log nothing | // log nothing | ||||
| } | } | ||||
| @@ -76,7 +76,7 @@ public class AntStructure extends Task { | |||||
| * @exception BuildException if the DTD cannot be written. | * @exception BuildException if the DTD cannot be written. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public void execute() throws BuildException { | |||||
| public void execute() throws BuildException { | |||||
| if (output == null) { | if (output == null) { | ||||
| throw new BuildException("output attribute is required", getLocation()); | throw new BuildException("output attribute is required", getLocation()); | ||||
| @@ -182,12 +182,12 @@ public class AntStructure extends Task { | |||||
| private final Hashtable<String, String> visited = new Hashtable<String, String>(); | private final Hashtable<String, String> visited = new Hashtable<String, String>(); | ||||
| public void printTail(final PrintWriter out) { | |||||
| public void printTail(final PrintWriter out) { | |||||
| visited.clear(); | visited.clear(); | ||||
| } | } | ||||
| public void printHead(final PrintWriter out, final Project p, final Hashtable<String, Class<?>> tasks, | |||||
| final Hashtable<String, Class<?>> types) { | |||||
| public void printHead(final PrintWriter out, final Project p, final Hashtable<String, Class<?>> tasks, | |||||
| final Hashtable<String, Class<?>> types) { | |||||
| printHead(out, tasks.keys(), types.keys()); | printHead(out, tasks.keys(), types.keys()); | ||||
| } | } | ||||
| @@ -244,7 +244,7 @@ public class AntStructure extends Task { | |||||
| /** | /** | ||||
| * Prints the definition for the target element. | * Prints the definition for the target element. | ||||
| */ | */ | ||||
| public void printTargetDecl(final PrintWriter out) { | |||||
| public void printTargetDecl(final PrintWriter out) { | |||||
| out.print("<!ELEMENT target ("); | out.print("<!ELEMENT target ("); | ||||
| out.print(TASKS); | out.print(TASKS); | ||||
| out.print(" | "); | out.print(" | "); | ||||
| @@ -277,7 +277,7 @@ public class AntStructure extends Task { | |||||
| /** | /** | ||||
| * Print the definition for a given element. | * Print the definition for a given element. | ||||
| */ | */ | ||||
| public void printElementDecl(final PrintWriter out, final Project p, | |||||
| public void printElementDecl(final PrintWriter out, final Project p, | |||||
| final String name, final Class<?> element) { | final String name, final Class<?> element) { | ||||
| if (visited.containsKey(name)) { | if (visited.containsKey(name)) { | ||||
| @@ -64,7 +64,7 @@ public class BindTargets extends Task { | |||||
| } | } | ||||
| @Override | @Override | ||||
| public void execute() throws BuildException { | |||||
| public void execute() throws BuildException { | |||||
| if (extensionPoint == null) { | if (extensionPoint == null) { | ||||
| throw new BuildException("extensionPoint required", getLocation()); | throw new BuildException("extensionPoint required", getLocation()); | ||||
| } | } | ||||
| @@ -176,7 +176,7 @@ public class Copy extends Task { | |||||
| * consistently let the Introspection mechanism work. | * consistently let the Introspection mechanism work. | ||||
| */ | */ | ||||
| @Deprecated | @Deprecated | ||||
| public void setPreserveLastModified(final String preserve) { | |||||
| public void setPreserveLastModified(final String preserve) { | |||||
| setPreserveLastModified(Project.toBoolean(preserve)); | setPreserveLastModified(Project.toBoolean(preserve)); | ||||
| } | } | ||||
| @@ -285,17 +285,17 @@ public class Copy extends Task { | |||||
| this.includeEmpty = includeEmpty; | this.includeEmpty = includeEmpty; | ||||
| } | } | ||||
| /** | |||||
| * Set quiet mode. Used to hide messages when a file or directory to be | |||||
| * copied does not exist. | |||||
| * | |||||
| * @param quiet | |||||
| * whether or not to display error messages when a file or | |||||
| * directory does not exist. Default is false. | |||||
| */ | |||||
| public void setQuiet(final boolean quiet) { | |||||
| this.quiet = quiet; | |||||
| } | |||||
| /** | |||||
| * Set quiet mode. Used to hide messages when a file or directory to be | |||||
| * copied does not exist. | |||||
| * | |||||
| * @param quiet | |||||
| * whether or not to display error messages when a file or | |||||
| * directory does not exist. Default is false. | |||||
| */ | |||||
| public void setQuiet(final boolean quiet) { | |||||
| this.quiet = quiet; | |||||
| } | |||||
| /** | /** | ||||
| * Set method of handling mappers that return multiple | * Set method of handling mappers that return multiple | ||||
| @@ -429,7 +429,7 @@ public class Copy extends Task { | |||||
| * @exception BuildException if an error occurs. | * @exception BuildException if an error occurs. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public void execute() throws BuildException { | |||||
| public void execute() throws BuildException { | |||||
| final File savedFile = file; // may be altered in validateAttributes | final File savedFile = file; // may be altered in validateAttributes | ||||
| final File savedDestFile = destFile; | final File savedDestFile = destFile; | ||||
| final File savedDestDir = destDir; | final File savedDestDir = destDir; | ||||
| @@ -823,16 +823,14 @@ public class Copy extends Task { | |||||
| toCopy = new Resource[v.size()]; | toCopy = new Resource[v.size()]; | ||||
| v.copyInto(toCopy); | v.copyInto(toCopy); | ||||
| } else { | } else { | ||||
| toCopy = ResourceUtils.selectOutOfDateSources( | |||||
| this, | |||||
| fromResources, | |||||
| mapper, | |||||
| new ResourceFactory() { | |||||
| public Resource getResource(final String name) { | |||||
| return new FileResource(toDir, name); | |||||
| } | |||||
| }, | |||||
| granularity); | |||||
| toCopy = ResourceUtils.selectOutOfDateSources(this, fromResources, | |||||
| mapper, | |||||
| new ResourceFactory() { | |||||
| public Resource getResource(final String name) { | |||||
| return new FileResource(toDir, name); | |||||
| } | |||||
| }, | |||||
| granularity); | |||||
| } | } | ||||
| for (int i = 0; i < toCopy.length; i++) { | for (int i = 0; i < toCopy.length; i++) { | ||||
| final String[] mappedFiles = mapper.mapFileName(toCopy[i].getName()); | final String[] mappedFiles = mapper.mapFileName(toCopy[i].getName()); | ||||
| @@ -116,7 +116,7 @@ public class EchoXML extends XMLFragment { | |||||
| } | } | ||||
| /** {@inheritDoc}. */ | /** {@inheritDoc}. */ | ||||
| @Override | @Override | ||||
| public String[] getValues() { | |||||
| public String[] getValues() { | |||||
| return new String[] {IGNORE, ELEMENTS, ALL}; | return new String[] {IGNORE, ELEMENTS, ALL}; | ||||
| } | } | ||||
| @@ -95,7 +95,7 @@ public class Get extends Task { | |||||
| * @exception BuildException Thrown in unrecoverable error. | * @exception BuildException Thrown in unrecoverable error. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public void execute() throws BuildException { | |||||
| public void execute() throws BuildException { | |||||
| checkAttributes(); | checkAttributes(); | ||||
| for (final Resource r : sources) { | for (final Resource r : sources) { | ||||
| @@ -168,7 +168,7 @@ public class Get extends Task { | |||||
| * @deprecated only gets the first configured resource | * @deprecated only gets the first configured resource | ||||
| */ | */ | ||||
| @Deprecated | @Deprecated | ||||
| public boolean doGet(final int logLevel, final DownloadProgress progress) | |||||
| public boolean doGet(final int logLevel, final DownloadProgress progress) | |||||
| throws IOException { | throws IOException { | ||||
| checkAttributes(); | checkAttributes(); | ||||
| for (final Resource r : sources) { | for (final Resource r : sources) { | ||||
| @@ -520,20 +520,20 @@ public class Get extends Task { | |||||
| /** | /** | ||||
| * begin a download | * begin a download | ||||
| */ | */ | ||||
| public void beginDownload() { | |||||
| public void beginDownload() { | |||||
| } | } | ||||
| /** | /** | ||||
| * tick handler | * tick handler | ||||
| * | * | ||||
| */ | */ | ||||
| public void onTick() { | |||||
| public void onTick() { | |||||
| } | } | ||||
| /** | /** | ||||
| * end a download | * end a download | ||||
| */ | */ | ||||
| public void endDownload() { | |||||
| public void endDownload() { | |||||
| } | } | ||||
| } | } | ||||
| @@ -557,7 +557,7 @@ public class Get extends Task { | |||||
| /** | /** | ||||
| * begin a download | * begin a download | ||||
| */ | */ | ||||
| public void beginDownload() { | |||||
| public void beginDownload() { | |||||
| dots = 0; | dots = 0; | ||||
| } | } | ||||
| @@ -565,7 +565,7 @@ public class Get extends Task { | |||||
| * tick handler | * tick handler | ||||
| * | * | ||||
| */ | */ | ||||
| public void onTick() { | |||||
| public void onTick() { | |||||
| out.print("."); | out.print("."); | ||||
| if (dots++ > DOTS_PER_LINE) { | if (dots++ > DOTS_PER_LINE) { | ||||
| out.flush(); | out.flush(); | ||||
| @@ -576,7 +576,7 @@ public class Get extends Task { | |||||
| /** | /** | ||||
| * end a download | * end a download | ||||
| */ | */ | ||||
| public void endDownload() { | |||||
| public void endDownload() { | |||||
| out.println(); | out.println(); | ||||
| out.flush(); | out.flush(); | ||||
| } | } | ||||
| @@ -612,7 +612,7 @@ public class Get extends Task { | |||||
| } | } | ||||
| @Override | @Override | ||||
| public void run() { | |||||
| public void run() { | |||||
| try { | try { | ||||
| success = get(); | success = get(); | ||||
| } catch (final IOException ioex) { | } catch (final IOException ioex) { | ||||
| @@ -762,12 +762,12 @@ public class Get extends Task { | |||||
| return connection; | return connection; | ||||
| } | } | ||||
| private boolean isMoved(final int responseCode) { | |||||
| return responseCode == HttpURLConnection.HTTP_MOVED_PERM || | |||||
| responseCode == HttpURLConnection.HTTP_MOVED_TEMP || | |||||
| responseCode == HttpURLConnection.HTTP_SEE_OTHER || | |||||
| responseCode == HTTP_MOVED_TEMP; | |||||
| } | |||||
| private boolean isMoved(final int responseCode) { | |||||
| return responseCode == HttpURLConnection.HTTP_MOVED_PERM || | |||||
| responseCode == HttpURLConnection.HTTP_MOVED_TEMP || | |||||
| responseCode == HttpURLConnection.HTTP_SEE_OTHER || | |||||
| responseCode == HTTP_MOVED_TEMP; | |||||
| } | |||||
| private boolean downloadFile() | private boolean downloadFile() | ||||
| throws FileNotFoundException, IOException { | throws FileNotFoundException, IOException { | ||||
| @@ -792,7 +792,7 @@ public class Get extends Task { | |||||
| } | } | ||||
| if (GZIP_CONTENT_ENCODING.equals(connection.getContentEncoding())) { | if (GZIP_CONTENT_ENCODING.equals(connection.getContentEncoding())) { | ||||
| is = new GZIPInputStream(is); | |||||
| is = new GZIPInputStream(is); | |||||
| } | } | ||||
| os = new FileOutputStream(dest); | os = new FileOutputStream(dest); | ||||
| @@ -130,7 +130,7 @@ public class Input extends Task { | |||||
| /** {@inheritDoc} */ | /** {@inheritDoc} */ | ||||
| @Override | @Override | ||||
| public String[] getValues() { | |||||
| public String[] getValues() { | |||||
| return VALUES; | return VALUES; | ||||
| } | } | ||||
| private InputHandler getInputHandler() { | private InputHandler getInputHandler() { | ||||
| @@ -210,7 +210,7 @@ public class Input extends Task { | |||||
| * @throws BuildException on error | * @throws BuildException on error | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public void execute () throws BuildException { | |||||
| public void execute () throws BuildException { | |||||
| if (addproperty != null | if (addproperty != null | ||||
| && getProject().getProperty(addproperty) != null) { | && getProject().getProperty(addproperty) != null) { | ||||
| log("skipping " + getTaskName() + " as property " + addproperty | log("skipping " + getTaskName() + " as property " + addproperty | ||||
| @@ -912,7 +912,7 @@ public class Javac extends MatchingTask { | |||||
| * @exception BuildException if an error occurs | * @exception BuildException if an error occurs | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public void execute() throws BuildException { | |||||
| public void execute() throws BuildException { | |||||
| checkParameters(); | checkParameters(); | ||||
| resetFileLists(); | resetFileLists(); | ||||
| @@ -279,7 +279,7 @@ public class Javadoc extends Task { | |||||
| * @return the package name. | * @return the package name. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public String toString() { | |||||
| public String toString() { | |||||
| return getName(); | return getName(); | ||||
| } | } | ||||
| } | } | ||||
| @@ -364,7 +364,7 @@ public class Javadoc extends Task { | |||||
| * @return the allowed values for the access type. | * @return the allowed values for the access type. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public String[] getValues() { | |||||
| public String[] getValues() { | |||||
| // Protected first so if any GUI tool offers a default | // Protected first so if any GUI tool offers a default | ||||
| // based on enum #0, it will be right. | // based on enum #0, it will be right. | ||||
| return new String[] {"protected", "public", "package", "private"}; | return new String[] {"protected", "public", "package", "private"}; | ||||
| @@ -865,7 +865,7 @@ public class Javadoc extends Task { | |||||
| * Use the {@link #setExtdirs(Path)} version. | * Use the {@link #setExtdirs(Path)} version. | ||||
| */ | */ | ||||
| @Deprecated | @Deprecated | ||||
| public void setExtdirs(final String path) { | |||||
| public void setExtdirs(final String path) { | |||||
| cmd.createArgument().setValue("-extdirs"); | cmd.createArgument().setValue("-extdirs"); | ||||
| cmd.createArgument().setValue(path); | cmd.createArgument().setValue(path); | ||||
| } | } | ||||
| @@ -1702,7 +1702,7 @@ public class Javadoc extends Task { | |||||
| * @throws BuildException on error | * @throws BuildException on error | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public void execute() throws BuildException { | |||||
| public void execute() throws BuildException { | |||||
| checkTaskName(); | checkTaskName(); | ||||
| final Vector<String> packagesToDoc = new Vector<String>(); | final Vector<String> packagesToDoc = new Vector<String>(); | ||||
| @@ -1718,8 +1718,7 @@ public class Javadoc extends Task { | |||||
| checkPackages(packagesToDoc, sourceDirs); | checkPackages(packagesToDoc, sourceDirs); | ||||
| @SuppressWarnings("unchecked") | @SuppressWarnings("unchecked") | ||||
| final | |||||
| Vector<SourceFile> sourceFilesToDoc = (Vector<SourceFile>) sourceFiles.clone(); | |||||
| final Vector<SourceFile> sourceFilesToDoc = (Vector<SourceFile>) sourceFiles.clone(); | |||||
| addSourceFiles(sourceFilesToDoc); | addSourceFiles(sourceFilesToDoc); | ||||
| checkPackagesToDoc(packagesToDoc, sourceFilesToDoc); | checkPackagesToDoc(packagesToDoc, sourceFilesToDoc); | ||||
| @@ -2370,8 +2369,7 @@ public class Javadoc extends Task { | |||||
| private void parsePackages(final Vector<String> pn, final Path sp) { | private void parsePackages(final Vector<String> pn, final Path sp) { | ||||
| final HashSet<String> addedPackages = new HashSet<String>(); | final HashSet<String> addedPackages = new HashSet<String>(); | ||||
| @SuppressWarnings("unchecked") | @SuppressWarnings("unchecked") | ||||
| final | |||||
| Vector<DirSet> dirSets = (Vector<DirSet>) packageSets.clone(); | |||||
| final Vector<DirSet> dirSets = (Vector<DirSet>) packageSets.clone(); | |||||
| // for each sourcePath entry, add a directoryset with includes | // for each sourcePath entry, add a directoryset with includes | ||||
| // taken from packagenames attribute and nested package | // taken from packagenames attribute and nested package | ||||
| @@ -2434,7 +2432,7 @@ public class Javadoc extends Task { | |||||
| // are there any java files in this directory? | // are there any java files in this directory? | ||||
| final File pd = new File(baseDir, dirs[i]); | final File pd = new File(baseDir, dirs[i]); | ||||
| final String[] files = pd.list(new FilenameFilter () { | final String[] files = pd.list(new FilenameFilter () { | ||||
| public boolean accept(final File dir1, final String name) { | |||||
| public boolean accept(final File dir1, final String name) { | |||||
| return name.endsWith(".java") | return name.endsWith(".java") | ||||
| || (includeNoSourcePackages | || (includeNoSourcePackages | ||||
| && name.equals("package.html")); | && name.equals("package.html")); | ||||
| @@ -2576,8 +2574,9 @@ public class Javadoc extends Task { | |||||
| // | // | ||||
| private String queuedLine = null; | private String queuedLine = null; | ||||
| private boolean sawWarnings = false; | private boolean sawWarnings = false; | ||||
| @Override | @Override | ||||
| protected void processLine(final String line, final int messageLevel) { | |||||
| protected void processLine(final String line, final int messageLevel) { | |||||
| if (line.contains("warning")) { | if (line.contains("warning")) { | ||||
| sawWarnings = true; | sawWarnings = true; | ||||
| } | } | ||||
| @@ -235,7 +235,7 @@ public class MakeUrl extends Task { | |||||
| * if something goes wrong with the build | * if something goes wrong with the build | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public void execute() throws BuildException { | |||||
| public void execute() throws BuildException { | |||||
| validate(); | validate(); | ||||
| //now exit here if the property is already set | //now exit here if the property is already set | ||||
| if (getProject().getProperty(property) != null) { | if (getProject().getProperty(property) != null) { | ||||
| @@ -167,7 +167,7 @@ public class Manifest { | |||||
| * @return a hashcode based on the key and values. | * @return a hashcode based on the key and values. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public int hashCode() { | |||||
| public int hashCode() { | |||||
| int hashCode = 0; | int hashCode = 0; | ||||
| if (name != null) { | if (name != null) { | ||||
| @@ -184,7 +184,7 @@ public class Manifest { | |||||
| * @return true if the key and values are the same. | * @return true if the key and values are the same. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public boolean equals(Object rhs) { | |||||
| public boolean equals(Object rhs) { | |||||
| if (rhs == null || rhs.getClass() != getClass()) { | if (rhs == null || rhs.getClass() != getClass()) { | ||||
| return false; | return false; | ||||
| } | } | ||||
| @@ -721,7 +721,7 @@ public class Manifest { | |||||
| * @since Ant 1.5.2 | * @since Ant 1.5.2 | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public Object clone() { | |||||
| public Object clone() { | |||||
| Section cloned = new Section(); | Section cloned = new Section(); | ||||
| cloned.setName(name); | cloned.setName(name); | ||||
| Enumeration<String> e = getAttributeKeys(); | Enumeration<String> e = getAttributeKeys(); | ||||
| @@ -761,7 +761,7 @@ public class Manifest { | |||||
| * @return a hash value based on the attributes. | * @return a hash value based on the attributes. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public int hashCode() { | |||||
| public int hashCode() { | |||||
| return attributes.hashCode(); | return attributes.hashCode(); | ||||
| } | } | ||||
| @@ -771,7 +771,7 @@ public class Manifest { | |||||
| * @return true if the attributes are the same. | * @return true if the attributes are the same. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public boolean equals(Object rhs) { | |||||
| public boolean equals(Object rhs) { | |||||
| if (rhs == null || rhs.getClass() != getClass()) { | if (rhs == null || rhs.getClass() != getClass()) { | ||||
| return false; | return false; | ||||
| } | } | ||||
| @@ -1061,7 +1061,7 @@ public class Manifest { | |||||
| * appears in a Manifest file. | * appears in a Manifest file. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public String toString() { | |||||
| public String toString() { | |||||
| StringWriter sw = new StringWriter(); | StringWriter sw = new StringWriter(); | ||||
| try { | try { | ||||
| write(new PrintWriter(sw)); | write(new PrintWriter(sw)); | ||||
| @@ -1100,7 +1100,7 @@ public class Manifest { | |||||
| * @return a hashcode based on the version, main and sections. | * @return a hashcode based on the version, main and sections. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public int hashCode() { | |||||
| public int hashCode() { | |||||
| int hashCode = 0; | int hashCode = 0; | ||||
| if (manifestVersion != null) { | if (manifestVersion != null) { | ||||
| @@ -1118,7 +1118,7 @@ public class Manifest { | |||||
| * @return true if the version, main and sections are the same. | * @return true if the version, main and sections are the same. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public boolean equals(Object rhs) { | |||||
| public boolean equals(Object rhs) { | |||||
| if (rhs == null || rhs.getClass() != getClass()) { | if (rhs == null || rhs.getClass() != getClass()) { | ||||
| return false; | return false; | ||||
| } | } | ||||
| @@ -169,7 +169,7 @@ public class PathConvert extends Task { | |||||
| * @return the list of values for this enumerated attribute. | * @return the list of values for this enumerated attribute. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public String[] getValues() { | |||||
| public String[] getValues() { | |||||
| return new String[]{"windows", "unix", "netware", "os/2", "tandem"}; | return new String[]{"windows", "unix", "netware", "os/2", "tandem"}; | ||||
| } | } | ||||
| } | } | ||||
| @@ -227,7 +227,7 @@ public class PathConvert extends Task { | |||||
| * @see #setTargetos(PathConvert.TargetOs) | * @see #setTargetos(PathConvert.TargetOs) | ||||
| */ | */ | ||||
| @Deprecated | @Deprecated | ||||
| public void setTargetos(String target) { | |||||
| public void setTargetos(String target) { | |||||
| TargetOs to = new TargetOs(); | TargetOs to = new TargetOs(); | ||||
| to.setValue(target); | to.setValue(target); | ||||
| setTargetos(to); | setTargetos(to); | ||||
| @@ -334,7 +334,7 @@ public class PathConvert extends Task { | |||||
| * @throws BuildException if something is invalid. | * @throws BuildException if something is invalid. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public void execute() throws BuildException { | |||||
| public void execute() throws BuildException { | |||||
| Resources savedPath = path; | Resources savedPath = path; | ||||
| String savedPathSep = pathSep; // may be altered in validateSetup | String savedPathSep = pathSep; // may be altered in validateSetup | ||||
| String savedDirSep = dirSep; // may be altered in validateSetup | String savedDirSep = dirSep; // may be altered in validateSetup | ||||
| @@ -40,7 +40,7 @@ public class ProjectHelperTask extends Task { | |||||
| } | } | ||||
| @Override | @Override | ||||
| public void execute() throws BuildException { | |||||
| public void execute() throws BuildException { | |||||
| ProjectHelperRepository repo = ProjectHelperRepository.getInstance(); | ProjectHelperRepository repo = ProjectHelperRepository.getInstance(); | ||||
| for (Iterator it = projectHelpers.iterator(); it.hasNext();) { | for (Iterator it = projectHelpers.iterator(); it.hasNext();) { | ||||
| ProjectHelper helper = (ProjectHelper) it.next(); | ProjectHelper helper = (ProjectHelper) it.next(); | ||||
| @@ -432,7 +432,7 @@ public class Property extends Task { | |||||
| * @ant.attribute ignore="true" | * @ant.attribute ignore="true" | ||||
| */ | */ | ||||
| @Deprecated | @Deprecated | ||||
| public void setUserProperty(boolean userProperty) { | |||||
| public void setUserProperty(boolean userProperty) { | |||||
| log("DEPRECATED: Ignoring request to set user property in Property" | log("DEPRECATED: Ignoring request to set user property in Property" | ||||
| + " task.", Project.MSG_WARN); | + " task.", Project.MSG_WARN); | ||||
| } | } | ||||
| @@ -442,7 +442,7 @@ public class Property extends Task { | |||||
| * @return the current value or the empty string | * @return the current value or the empty string | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public String toString() { | |||||
| public String toString() { | |||||
| return value == null ? "" : value; | return value == null ? "" : value; | ||||
| } | } | ||||
| @@ -453,7 +453,7 @@ public class Property extends Task { | |||||
| * @throws BuildException on error | * @throws BuildException on error | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public void execute() throws BuildException { | |||||
| public void execute() throws BuildException { | |||||
| if (getProject() == null) { | if (getProject() == null) { | ||||
| throw new IllegalStateException("project has not been set"); | throw new IllegalStateException("project has not been set"); | ||||
| } | } | ||||
| @@ -71,7 +71,7 @@ public class Redirector { | |||||
| } | } | ||||
| @Override | @Override | ||||
| public void close() throws IOException { | |||||
| public void close() throws IOException { | |||||
| synchronized (outMutex) { | synchronized (outMutex) { | ||||
| if (!closed && !(appendOut && appendProperties)) { | if (!closed && !(appendOut && appendProperties)) { | ||||
| setPropertyFromBAOS(this, property); | setPropertyFromBAOS(this, property); | ||||
| @@ -588,7 +588,7 @@ public class Rmic extends MatchingTask { | |||||
| * if there's a problem with baseDir or RMIC | * if there's a problem with baseDir or RMIC | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public void execute() throws BuildException { | |||||
| public void execute() throws BuildException { | |||||
| try { | try { | ||||
| compileList.clear(); | compileList.clear(); | ||||
| @@ -91,7 +91,7 @@ public class SQLExec extends JDBCTask { | |||||
| public static final String NORMAL = "normal", ROW = "row"; | public static final String NORMAL = "normal", ROW = "row"; | ||||
| /** @return the enumerated strings */ | /** @return the enumerated strings */ | ||||
| @Override | @Override | ||||
| public String[] getValues() { | |||||
| public String[] getValues() { | |||||
| return new String[] {NORMAL, ROW}; | return new String[] {NORMAL, ROW}; | ||||
| } | } | ||||
| } | } | ||||
| @@ -591,7 +591,7 @@ public class SQLExec extends JDBCTask { | |||||
| * @throws BuildException on error. | * @throws BuildException on error. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public void execute() throws BuildException { | |||||
| public void execute() throws BuildException { | |||||
| Vector savedTransaction = (Vector) transactions.clone(); | Vector savedTransaction = (Vector) transactions.clone(); | ||||
| String savedSqlCommand = sqlCommand; | String savedSqlCommand = sqlCommand; | ||||
| @@ -853,7 +853,7 @@ public class SQLExec extends JDBCTask { | |||||
| * @throws SQLException on SQL problems. | * @throws SQLException on SQL problems. | ||||
| */ | */ | ||||
| @Deprecated | @Deprecated | ||||
| protected void printResults(PrintStream out) throws SQLException { | |||||
| protected void printResults(PrintStream out) throws SQLException { | |||||
| ResultSet rs = getStatement().getResultSet(); | ResultSet rs = getStatement().getResultSet(); | ||||
| try { | try { | ||||
| printResults(rs, out); | printResults(rs, out); | ||||
| @@ -958,7 +958,7 @@ public class SQLExec extends JDBCTask { | |||||
| * expected RDBMS.</p> | * expected RDBMS.</p> | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| protected Connection getConnection() { | |||||
| protected Connection getConnection() { | |||||
| if (conn == null) { | if (conn == null) { | ||||
| conn = super.getConnection(); | conn = super.getConnection(); | ||||
| if (!isValidRdbms(conn)) { | if (!isValidRdbms(conn)) { | ||||
| @@ -993,7 +993,7 @@ public class SQLExec extends JDBCTask { | |||||
| public static class OnError extends EnumeratedAttribute { | public static class OnError extends EnumeratedAttribute { | ||||
| /** @return the enumerated values */ | /** @return the enumerated values */ | ||||
| @Override | @Override | ||||
| public String[] getValues() { | |||||
| public String[] getValues() { | |||||
| return new String[] {"continue", "stop", "abort"}; | return new String[] {"continue", "stop", "abort"}; | ||||
| } | } | ||||
| } | } | ||||
| @@ -172,7 +172,7 @@ public class Sleep extends Task { | |||||
| * @exception BuildException Description of Exception | * @exception BuildException Description of Exception | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public void execute() | |||||
| public void execute() | |||||
| throws BuildException { | throws BuildException { | ||||
| try { | try { | ||||
| validate(); | validate(); | ||||
| @@ -99,7 +99,7 @@ public class SubAnt extends Task { | |||||
| * @since Ant 1.6.2 | * @since Ant 1.6.2 | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public void handleOutput(String output) { | |||||
| public void handleOutput(String output) { | |||||
| if (ant != null) { | if (ant != null) { | ||||
| ant.handleOutput(output); | ant.handleOutput(output); | ||||
| } else { | } else { | ||||
| @@ -123,7 +123,7 @@ public class SubAnt extends Task { | |||||
| * @since Ant 1.6.2 | * @since Ant 1.6.2 | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public int handleInput(byte[] buffer, int offset, int length) | |||||
| public int handleInput(byte[] buffer, int offset, int length) | |||||
| throws IOException { | throws IOException { | ||||
| if (ant != null) { | if (ant != null) { | ||||
| return ant.handleInput(buffer, offset, length); | return ant.handleInput(buffer, offset, length); | ||||
| @@ -140,7 +140,7 @@ public class SubAnt extends Task { | |||||
| * @since Ant 1.6.2 | * @since Ant 1.6.2 | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public void handleFlush(String output) { | |||||
| public void handleFlush(String output) { | |||||
| if (ant != null) { | if (ant != null) { | ||||
| ant.handleFlush(output); | ant.handleFlush(output); | ||||
| } else { | } else { | ||||
| @@ -156,7 +156,7 @@ public class SubAnt extends Task { | |||||
| * @since Ant 1.6.2 | * @since Ant 1.6.2 | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public void handleErrorOutput(String output) { | |||||
| public void handleErrorOutput(String output) { | |||||
| if (ant != null) { | if (ant != null) { | ||||
| ant.handleErrorOutput(output); | ant.handleErrorOutput(output); | ||||
| } else { | } else { | ||||
| @@ -172,7 +172,7 @@ public class SubAnt extends Task { | |||||
| * @since Ant 1.6.2 | * @since Ant 1.6.2 | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public void handleErrorFlush(String output) { | |||||
| public void handleErrorFlush(String output) { | |||||
| if (ant != null) { | if (ant != null) { | ||||
| ant.handleErrorFlush(output); | ant.handleErrorFlush(output); | ||||
| } else { | } else { | ||||
| @@ -184,7 +184,7 @@ public class SubAnt extends Task { | |||||
| * Runs the various sub-builds. | * Runs the various sub-builds. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public void execute() { | |||||
| public void execute() { | |||||
| if (buildpath == null) { | if (buildpath == null) { | ||||
| throw new BuildException("No buildpath specified"); | throw new BuildException("No buildpath specified"); | ||||
| } | } | ||||
| @@ -73,7 +73,7 @@ public class Sync extends Task { | |||||
| * @see Task#init() | * @see Task#init() | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public void init() | |||||
| public void init() | |||||
| throws BuildException { | throws BuildException { | ||||
| // Instantiate it | // Instantiate it | ||||
| myCopy = new MyCopy(); | myCopy = new MyCopy(); | ||||
| @@ -99,7 +99,7 @@ public class Sync extends Task { | |||||
| * @see Task#execute() | * @see Task#execute() | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public void execute() | |||||
| public void execute() | |||||
| throws BuildException { | throws BuildException { | ||||
| // The destination of the files to copy | // The destination of the files to copy | ||||
| File toDir = myCopy.getToDir(); | File toDir = myCopy.getToDir(); | ||||
| @@ -467,7 +467,7 @@ public class Sync extends Task { | |||||
| */ | */ | ||||
| /** {@inheritDoc} */ | /** {@inheritDoc} */ | ||||
| @Override | @Override | ||||
| protected void scan(File fromDir, File toDir, String[] files, | |||||
| protected void scan(File fromDir, File toDir, String[] files, | |||||
| String[] dirs) { | String[] dirs) { | ||||
| assertTrue("No mapper", mapperElement == null); | assertTrue("No mapper", mapperElement == null); | ||||
| @@ -486,7 +486,7 @@ public class Sync extends Task { | |||||
| */ | */ | ||||
| /** {@inheritDoc} */ | /** {@inheritDoc} */ | ||||
| @Override | @Override | ||||
| protected Map scan(Resource[] resources, File toDir) { | |||||
| protected Map scan(Resource[] resources, File toDir) { | |||||
| assertTrue("No mapper", mapperElement == null); | assertTrue("No mapper", mapperElement == null); | ||||
| for (int i = 0; i < resources.length; i++) { | for (int i = 0; i < resources.length; i++) { | ||||
| @@ -517,7 +517,7 @@ public class Sync extends Task { | |||||
| * @since Ant 1.7 | * @since Ant 1.7 | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| protected boolean supportsNonFileResources() { | |||||
| protected boolean supportsNonFileResources() { | |||||
| return true; | return true; | ||||
| } | } | ||||
| } | } | ||||
| @@ -549,7 +549,7 @@ public class Sync extends Task { | |||||
| * @throws BuildException always | * @throws BuildException always | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public void setDir(File dir) throws BuildException { | |||||
| public void setDir(File dir) throws BuildException { | |||||
| throw new BuildException("preserveintarget doesn't support the dir " | throw new BuildException("preserveintarget doesn't support the dir " | ||||
| + "attribute"); | + "attribute"); | ||||
| } | } | ||||
| @@ -152,7 +152,7 @@ public class War extends Jar { | |||||
| * @throws BuildException if invalid configuration | * @throws BuildException if invalid configuration | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| protected void initZipOutputStream(ZipOutputStream zOut) | |||||
| protected void initZipOutputStream(ZipOutputStream zOut) | |||||
| throws IOException, BuildException { | throws IOException, BuildException { | ||||
| super.initZipOutputStream(zOut); | super.initZipOutputStream(zOut); | ||||
| } | } | ||||
| @@ -173,7 +173,7 @@ public class War extends Jar { | |||||
| * @throws IOException on output error | * @throws IOException on output error | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| protected void zipFile(File file, ZipOutputStream zOut, String vPath, | |||||
| protected void zipFile(File file, ZipOutputStream zOut, String vPath, | |||||
| int mode) | int mode) | ||||
| throws IOException { | throws IOException { | ||||
| // If the file being added is WEB-INF/web.xml, we warn if it's | // If the file being added is WEB-INF/web.xml, we warn if it's | ||||
| @@ -218,7 +218,7 @@ public class War extends Jar { | |||||
| * gets executed. | * gets executed. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| protected void cleanUp() { | |||||
| protected void cleanUp() { | |||||
| if (addedWebXmlFile == null | if (addedWebXmlFile == null | ||||
| && deploymentDescriptor == null | && deploymentDescriptor == null | ||||
| && needxmlfile | && needxmlfile | ||||
| @@ -1234,7 +1234,7 @@ public class XSLTProcess extends MatchingTask implements XSLTLogger { | |||||
| xpathFactory = XPathFactory.newInstance(); | xpathFactory = XPathFactory.newInstance(); | ||||
| xpath = xpathFactory.newXPath(); | xpath = xpathFactory.newXPath(); | ||||
| xpath.setXPathVariableResolver(new XPathVariableResolver() { | xpath.setXPathVariableResolver(new XPathVariableResolver() { | ||||
| public Object resolveVariable(final QName variableName) { | |||||
| public Object resolveVariable(final QName variableName) { | |||||
| return getProject().getProperty(variableName.toString()); | return getProject().getProperty(variableName.toString()); | ||||
| } | } | ||||
| }); | }); | ||||
| @@ -1248,7 +1248,7 @@ public class XSLTProcess extends MatchingTask implements XSLTLogger { | |||||
| * @deprecated since Ant 1.7 | * @deprecated since Ant 1.7 | ||||
| */ | */ | ||||
| @Deprecated | @Deprecated | ||||
| protected void configureLiaison(final File stylesheet) throws BuildException { | |||||
| protected void configureLiaison(final File stylesheet) throws BuildException { | |||||
| final FileResource fr = new FileResource(); | final FileResource fr = new FileResource(); | ||||
| fr.setProject(getProject()); | fr.setProject(getProject()); | ||||
| fr.setFile(stylesheet); | fr.setFile(stylesheet); | ||||
| @@ -1531,7 +1531,7 @@ public class XSLTProcess extends MatchingTask implements XSLTLogger { | |||||
| * @return null | * @return null | ||||
| * @throws BuildException never | * @throws BuildException never | ||||
| */ | */ | ||||
| public Object createDynamicElement(final String name) throws BuildException { | |||||
| public Object createDynamicElement(final String name) throws BuildException { | |||||
| return null; | return null; | ||||
| } | } | ||||
| @@ -1542,7 +1542,7 @@ public class XSLTProcess extends MatchingTask implements XSLTLogger { | |||||
| * @param value the value of the attribute | * @param value the value of the attribute | ||||
| * @throws BuildException on error | * @throws BuildException on error | ||||
| */ | */ | ||||
| public void setDynamicAttribute(final String name, final String value) throws BuildException { | |||||
| public void setDynamicAttribute(final String name, final String value) throws BuildException { | |||||
| // only 'name' and 'value' exist. | // only 'name' and 'value' exist. | ||||
| if ("name".equalsIgnoreCase(name)) { | if ("name".equalsIgnoreCase(name)) { | ||||
| this.name = value; | this.name = value; | ||||
| @@ -1577,11 +1577,11 @@ public class XSLTProcess extends MatchingTask implements XSLTLogger { | |||||
| * @since Ant 1.6.2 | * @since Ant 1.6.2 | ||||
| */ | */ | ||||
| private class StyleMapper implements FileNameMapper { | private class StyleMapper implements FileNameMapper { | ||||
| public void setFrom(final String from) { | |||||
| public void setFrom(final String from) { | |||||
| } | } | ||||
| public void setTo(final String to) { | |||||
| public void setTo(final String to) { | |||||
| } | } | ||||
| public String[] mapFileName(String xmlFile) { | |||||
| public String[] mapFileName(String xmlFile) { | |||||
| final int dotPos = xmlFile.lastIndexOf('.'); | final int dotPos = xmlFile.lastIndexOf('.'); | ||||
| if (dotPos > 0) { | if (dotPos > 0) { | ||||
| xmlFile = xmlFile.substring(0, dotPos); | xmlFile = xmlFile.substring(0, dotPos); | ||||
| @@ -105,14 +105,14 @@ public class Zip extends MatchingTask { | |||||
| private static final ResourceSelector MISSING_SELECTOR = | private static final ResourceSelector MISSING_SELECTOR = | ||||
| new ResourceSelector() { | new ResourceSelector() { | ||||
| public boolean isSelected(final Resource target) { | |||||
| public boolean isSelected(final Resource target) { | |||||
| return !target.isExists(); | return !target.isExists(); | ||||
| } | } | ||||
| }; | }; | ||||
| private static final ResourceUtils.ResourceSelectorProvider | private static final ResourceUtils.ResourceSelectorProvider | ||||
| MISSING_DIR_PROVIDER = new ResourceUtils.ResourceSelectorProvider() { | MISSING_DIR_PROVIDER = new ResourceUtils.ResourceSelectorProvider() { | ||||
| public ResourceSelector | |||||
| public ResourceSelector | |||||
| getTargetSelectorForSource(final Resource sr) { | getTargetSelectorForSource(final Resource sr) { | ||||
| return MISSING_SELECTOR; | return MISSING_SELECTOR; | ||||
| } | } | ||||
| @@ -238,7 +238,7 @@ public class Zip extends MatchingTask { | |||||
| * @ant.attribute ignore="true" | * @ant.attribute ignore="true" | ||||
| */ | */ | ||||
| @Deprecated | @Deprecated | ||||
| public void setZipfile(final File zipFile) { | |||||
| public void setZipfile(final File zipFile) { | |||||
| setDestFile(zipFile); | setDestFile(zipFile); | ||||
| } | } | ||||
| @@ -252,7 +252,7 @@ public class Zip extends MatchingTask { | |||||
| * @ant.attribute ignore="true" | * @ant.attribute ignore="true" | ||||
| */ | */ | ||||
| @Deprecated | @Deprecated | ||||
| public void setFile(final File file) { | |||||
| public void setFile(final File file) { | |||||
| setDestFile(file); | setDestFile(file); | ||||
| } | } | ||||
| @@ -386,7 +386,7 @@ public class Zip extends MatchingTask { | |||||
| * @return the values | * @return the values | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public String[] getValues() { | |||||
| public String[] getValues() { | |||||
| return new String[] {"fail", "skip", "create"}; | return new String[] {"fail", "skip", "create"}; | ||||
| } | } | ||||
| } | } | ||||
| @@ -585,7 +585,7 @@ public class Zip extends MatchingTask { | |||||
| * @throws BuildException on error | * @throws BuildException on error | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public void execute() throws BuildException { | |||||
| public void execute() throws BuildException { | |||||
| if (doubleFilePass) { | if (doubleFilePass) { | ||||
| skipWriting = true; | skipWriting = true; | ||||
| @@ -1290,7 +1290,7 @@ public class Zip extends MatchingTask { | |||||
| */ | */ | ||||
| private static final ThreadLocal<Boolean> HAVE_NON_FILE_SET_RESOURCES_TO_ADD = new ThreadLocal<Boolean>() { | private static final ThreadLocal<Boolean> HAVE_NON_FILE_SET_RESOURCES_TO_ADD = new ThreadLocal<Boolean>() { | ||||
| @Override | @Override | ||||
| protected Boolean initialValue() { | |||||
| protected Boolean initialValue() { | |||||
| return Boolean.FALSE; | return Boolean.FALSE; | ||||
| } | } | ||||
| }; | }; | ||||
| @@ -1635,7 +1635,7 @@ public class Zip extends MatchingTask { | |||||
| // make sure directories are in alpha-order - this also | // make sure directories are in alpha-order - this also | ||||
| // ensures parents come before their children | // ensures parents come before their children | ||||
| Collections.sort(dirs, new Comparator<Resource>() { | Collections.sort(dirs, new Comparator<Resource>() { | ||||
| public int compare(final Resource r1, final Resource r2) { | |||||
| public int compare(final Resource r1, final Resource r2) { | |||||
| return r1.getName().compareTo(r2.getName()); | return r1.getName().compareTo(r2.getName()); | ||||
| } | } | ||||
| }); | }); | ||||
| @@ -2037,7 +2037,7 @@ public class Zip extends MatchingTask { | |||||
| protected Resource[] selectFileResources(final Resource[] orig) { | protected Resource[] selectFileResources(final Resource[] orig) { | ||||
| return selectResources(orig, | return selectResources(orig, | ||||
| new ResourceSelector() { | new ResourceSelector() { | ||||
| public boolean isSelected(final Resource r) { | |||||
| public boolean isSelected(final Resource r) { | |||||
| if (!r.isDirectory()) { | if (!r.isDirectory()) { | ||||
| return true; | return true; | ||||
| } else if (doFilesonly) { | } else if (doFilesonly) { | ||||
| @@ -2061,7 +2061,7 @@ public class Zip extends MatchingTask { | |||||
| protected Resource[] selectDirectoryResources(final Resource[] orig) { | protected Resource[] selectDirectoryResources(final Resource[] orig) { | ||||
| return selectResources(orig, | return selectResources(orig, | ||||
| new ResourceSelector() { | new ResourceSelector() { | ||||
| public boolean isSelected(final Resource r) { | |||||
| public boolean isSelected(final Resource r) { | |||||
| return r.isDirectory(); | return r.isDirectory(); | ||||
| } | } | ||||
| }); | }); | ||||
| @@ -2114,7 +2114,7 @@ public class Zip extends MatchingTask { | |||||
| */ | */ | ||||
| /** {@inheritDoc} */ | /** {@inheritDoc} */ | ||||
| @Override | @Override | ||||
| public String[] getValues() { | |||||
| public String[] getValues() { | |||||
| return new String[] {"add", "preserve", "fail"}; | return new String[] {"add", "preserve", "fail"}; | ||||
| } | } | ||||
| } | } | ||||
| @@ -2191,7 +2191,7 @@ public class Zip extends MatchingTask { | |||||
| } | } | ||||
| @Override | @Override | ||||
| public String[] getValues() { | |||||
| public String[] getValues() { | |||||
| return new String[] {NEVER_KEY, ALWAYS_KEY, N_E_KEY}; | return new String[] {NEVER_KEY, ALWAYS_KEY, N_E_KEY}; | ||||
| } | } | ||||
| @@ -2250,7 +2250,7 @@ public class Zip extends MatchingTask { | |||||
| } | } | ||||
| @Override | @Override | ||||
| public String[] getValues() { | |||||
| public String[] getValues() { | |||||
| return new String[] {NEVER_KEY, ALWAYS_KEY, A_N_KEY}; | return new String[] {NEVER_KEY, ALWAYS_KEY, A_N_KEY}; | ||||
| } | } | ||||
| @@ -157,7 +157,7 @@ public class AptCompilerAdapter extends DefaultCompilerAdapter { | |||||
| * @return true on success. | * @return true on success. | ||||
| * @throws BuildException if the compilation has problems. | * @throws BuildException if the compilation has problems. | ||||
| */ | */ | ||||
| public boolean execute() throws BuildException { | |||||
| public boolean execute() throws BuildException { | |||||
| attributes.log("Using apt compiler", Project.MSG_VERBOSE); | attributes.log("Using apt compiler", Project.MSG_VERBOSE); | ||||
| //set up the javac options | //set up the javac options | ||||
| final Commandline cmd = setupModernJavacCommand(); | final Commandline cmd = setupModernJavacCommand(); | ||||
| @@ -97,7 +97,7 @@ public abstract class DefaultCompilerAdapter | |||||
| * | * | ||||
| * @param attributes a configured Javac task. | * @param attributes a configured Javac task. | ||||
| */ | */ | ||||
| public void setJavac(final Javac attributes) { | |||||
| public void setJavac(final Javac attributes) { | |||||
| this.attributes = attributes; | this.attributes = attributes; | ||||
| src = attributes.getSrcdir(); | src = attributes.getSrcdir(); | ||||
| destDir = attributes.getDestdir(); | destDir = attributes.getDestdir(); | ||||
| @@ -135,7 +135,7 @@ public abstract class DefaultCompilerAdapter | |||||
| * but specialized compilers can recognize multiple kinds | * but specialized compilers can recognize multiple kinds | ||||
| * of files. | * of files. | ||||
| */ | */ | ||||
| public String[] getSupportedFileExtensions() { | |||||
| public String[] getSupportedFileExtensions() { | |||||
| return new String[] {"java"}; | return new String[] {"java"}; | ||||
| } | } | ||||
| @@ -523,7 +523,7 @@ public abstract class DefaultCompilerAdapter | |||||
| * Use org.apache.tools.ant.types.Path#addExtdirs instead. | * Use org.apache.tools.ant.types.Path#addExtdirs instead. | ||||
| */ | */ | ||||
| @Deprecated | @Deprecated | ||||
| protected void addExtdirsToClasspath(final Path classpath) { | |||||
| protected void addExtdirsToClasspath(final Path classpath) { | |||||
| classpath.addExtdirs(extdirs); | classpath.addExtdirs(extdirs); | ||||
| } | } | ||||
| @@ -139,7 +139,7 @@ public class IsReachable extends ProjectComponent implements Condition { | |||||
| * @throws org.apache.tools.ant.BuildException | * @throws org.apache.tools.ant.BuildException | ||||
| * if an error occurs | * if an error occurs | ||||
| */ | */ | ||||
| public boolean eval() throws BuildException { | |||||
| public boolean eval() throws BuildException { | |||||
| if (empty(host) && empty(url)) { | if (empty(host) && empty(url)) { | ||||
| throw new BuildException(ERROR_NO_HOSTNAME); | throw new BuildException(ERROR_NO_HOSTNAME); | ||||
| } | } | ||||
| @@ -168,7 +168,7 @@ public class CvsTagDiff extends AbstractCvsTask { | |||||
| * @param p the name of the package to analyse | * @param p the name of the package to analyse | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public void setPackage(String p) { | |||||
| public void setPackage(String p) { | |||||
| mypackage = p; | mypackage = p; | ||||
| } | } | ||||
| @@ -235,7 +235,7 @@ public class CvsTagDiff extends AbstractCvsTask { | |||||
| * @exception BuildException if an error occurs | * @exception BuildException if an error occurs | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public void execute() throws BuildException { | |||||
| public void execute() throws BuildException { | |||||
| // validate the input parameters | // validate the input parameters | ||||
| validate(); | validate(); | ||||
| @@ -156,7 +156,7 @@ public class PropertyFile extends Task { | |||||
| * @throws BuildException on error. | * @throws BuildException on error. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public void execute() throws BuildException { | |||||
| public void execute() throws BuildException { | |||||
| checkParameters(); | checkParameters(); | ||||
| readFile(); | readFile(); | ||||
| executeOperation(); | executeOperation(); | ||||
| @@ -616,7 +616,7 @@ public class PropertyFile extends Task { | |||||
| /** {@inheritDoc}. */ | /** {@inheritDoc}. */ | ||||
| @Override | @Override | ||||
| public String[] getValues() { | |||||
| public String[] getValues() { | |||||
| return new String[] {"+", "-", "=", "del"}; | return new String[] {"+", "-", "=", "del"}; | ||||
| } | } | ||||
| @@ -652,7 +652,7 @@ public class PropertyFile extends Task { | |||||
| /** {@inheritDoc} */ | /** {@inheritDoc} */ | ||||
| @Override | @Override | ||||
| public String[] getValues() { | |||||
| public String[] getValues() { | |||||
| return new String[] {"int", "date", "string"}; | return new String[] {"int", "date", "string"}; | ||||
| } | } | ||||
| @@ -719,7 +719,7 @@ public class PropertyFile extends Task { | |||||
| /** {@inheritDoc}. */ | /** {@inheritDoc}. */ | ||||
| @Override | @Override | ||||
| public String[] getValues() { | |||||
| public String[] getValues() { | |||||
| return UNITS; | return UNITS; | ||||
| } | } | ||||
| } | } | ||||
| @@ -466,7 +466,7 @@ public class ReplaceRegExp extends Task { | |||||
| * @throws BuildException is there is a problem in the task execution. | * @throws BuildException is there is a problem in the task execution. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public void execute() throws BuildException { | |||||
| public void execute() throws BuildException { | |||||
| if (regex == null) { | if (regex == null) { | ||||
| throw new BuildException("No expression to match."); | throw new BuildException("No expression to match."); | ||||
| } | } | ||||
| @@ -143,7 +143,7 @@ public class TraXLiaison implements XSLTLiaison4, ErrorListener, XSLTLoggerAware | |||||
| * @param stylesheet a <code>File</code> value | * @param stylesheet a <code>File</code> value | ||||
| * @throws Exception on error | * @throws Exception on error | ||||
| */ | */ | ||||
| public void setStylesheet(final File stylesheet) throws Exception { | |||||
| public void setStylesheet(final File stylesheet) throws Exception { | |||||
| final FileResource fr = new FileResource(); | final FileResource fr = new FileResource(); | ||||
| fr.setProject(project); | fr.setProject(project); | ||||
| fr.setFile(stylesheet); | fr.setFile(stylesheet); | ||||
| @@ -155,7 +155,7 @@ public class TraXLiaison implements XSLTLiaison4, ErrorListener, XSLTLoggerAware | |||||
| * @param stylesheet a {@link org.apache.tools.ant.types.Resource} value | * @param stylesheet a {@link org.apache.tools.ant.types.Resource} value | ||||
| * @throws Exception on error | * @throws Exception on error | ||||
| */ | */ | ||||
| public void setStylesheet(final Resource stylesheet) throws Exception { | |||||
| public void setStylesheet(final Resource stylesheet) throws Exception { | |||||
| if (this.stylesheet != null) { | if (this.stylesheet != null) { | ||||
| // resetting the stylesheet - reset transformer | // resetting the stylesheet - reset transformer | ||||
| transformer = null; | transformer = null; | ||||
| @@ -175,7 +175,7 @@ public class TraXLiaison implements XSLTLiaison4, ErrorListener, XSLTLoggerAware | |||||
| * @param outfile the result file | * @param outfile the result file | ||||
| * @throws Exception on error | * @throws Exception on error | ||||
| */ | */ | ||||
| public void transform(final File infile, final File outfile) throws Exception { | |||||
| public void transform(final File infile, final File outfile) throws Exception { | |||||
| if (transformer == null) { | if (transformer == null) { | ||||
| createTransformer(); | createTransformer(); | ||||
| } | } | ||||
| @@ -504,7 +504,7 @@ public class TraXLiaison implements XSLTLiaison4, ErrorListener, XSLTLoggerAware | |||||
| * @param name the name of the parameter | * @param name the name of the parameter | ||||
| * @param value the value of the parameter | * @param value the value of the parameter | ||||
| */ | */ | ||||
| public void addParam(final String name, final String value) { | |||||
| public void addParam(final String name, final String value) { | |||||
| params.put(name, value); | params.put(name, value); | ||||
| } | } | ||||
| @@ -514,7 +514,7 @@ public class TraXLiaison implements XSLTLiaison4, ErrorListener, XSLTLoggerAware | |||||
| * @param value the value of the parameter | * @param value the value of the parameter | ||||
| * @since Ant 1.9.3 | * @since Ant 1.9.3 | ||||
| */ | */ | ||||
| public void addParam(final String name, final Object value) { | |||||
| public void addParam(final String name, final Object value) { | |||||
| params.put(name, value); | params.put(name, value); | ||||
| } | } | ||||
| @@ -522,7 +522,7 @@ public class TraXLiaison implements XSLTLiaison4, ErrorListener, XSLTLoggerAware | |||||
| * Set a logger. | * Set a logger. | ||||
| * @param l a logger. | * @param l a logger. | ||||
| */ | */ | ||||
| public void setLogger(final XSLTLogger l) { | |||||
| public void setLogger(final XSLTLogger l) { | |||||
| logger = l; | logger = l; | ||||
| } | } | ||||
| @@ -530,7 +530,7 @@ public class TraXLiaison implements XSLTLiaison4, ErrorListener, XSLTLoggerAware | |||||
| * Log an error. | * Log an error. | ||||
| * @param e the exception to log. | * @param e the exception to log. | ||||
| */ | */ | ||||
| public void error(final TransformerException e) { | |||||
| public void error(final TransformerException e) { | |||||
| logError(e, "Error"); | logError(e, "Error"); | ||||
| } | } | ||||
| @@ -538,7 +538,7 @@ public class TraXLiaison implements XSLTLiaison4, ErrorListener, XSLTLoggerAware | |||||
| * Log a fatal error. | * Log a fatal error. | ||||
| * @param e the exception to log. | * @param e the exception to log. | ||||
| */ | */ | ||||
| public void fatalError(final TransformerException e) { | |||||
| public void fatalError(final TransformerException e) { | |||||
| logError(e, "Fatal Error"); | logError(e, "Fatal Error"); | ||||
| throw new BuildException("Fatal error during transformation using " + stylesheet + ": " + e.getMessageAndLocation(), e); | throw new BuildException("Fatal error during transformation using " + stylesheet + ": " + e.getMessageAndLocation(), e); | ||||
| } | } | ||||
| @@ -547,7 +547,7 @@ public class TraXLiaison implements XSLTLiaison4, ErrorListener, XSLTLoggerAware | |||||
| * Log a warning. | * Log a warning. | ||||
| * @param e the exception to log. | * @param e the exception to log. | ||||
| */ | */ | ||||
| public void warning(final TransformerException e) { | |||||
| public void warning(final TransformerException e) { | |||||
| if (!suppressWarnings) { | if (!suppressWarnings) { | ||||
| logError(e, "Warning"); | logError(e, "Warning"); | ||||
| } | } | ||||
| @@ -602,7 +602,7 @@ public class TraXLiaison implements XSLTLiaison4, ErrorListener, XSLTLoggerAware | |||||
| * Use org.apache.tools.ant.util.JAXPUtils#getSystemId instead. | * Use org.apache.tools.ant.util.JAXPUtils#getSystemId instead. | ||||
| */ | */ | ||||
| @Deprecated | @Deprecated | ||||
| protected String getSystemId(final File file) { | |||||
| protected String getSystemId(final File file) { | |||||
| return JAXPUtils.getSystemId(file); | return JAXPUtils.getSystemId(file); | ||||
| } | } | ||||
| @@ -612,7 +612,7 @@ public class TraXLiaison implements XSLTLiaison4, ErrorListener, XSLTLoggerAware | |||||
| * @param xsltTask the XSLTProcess task instance from which this liasion | * @param xsltTask the XSLTProcess task instance from which this liasion | ||||
| * is to be configured. | * is to be configured. | ||||
| */ | */ | ||||
| public void configure(final XSLTProcess xsltTask) { | |||||
| public void configure(final XSLTProcess xsltTask) { | |||||
| project = xsltTask.getProject(); | project = xsltTask.getProject(); | ||||
| final XSLTProcess.Factory factory = xsltTask.getFactory(); | final XSLTProcess.Factory factory = xsltTask.getFactory(); | ||||
| if (factory != null) { | if (factory != null) { | ||||
| @@ -28,7 +28,6 @@ import org.apache.tools.ant.taskdefs.XSLTProcess; | |||||
| import org.apache.xalan.trace.PrintTraceListener; | import org.apache.xalan.trace.PrintTraceListener; | ||||
| import org.apache.xalan.transformer.TransformerImpl; | import org.apache.xalan.transformer.TransformerImpl; | ||||
| /** | /** | ||||
| * Sets up trace support for a given transformer. | * Sets up trace support for a given transformer. | ||||
| * | * | ||||
| @@ -44,7 +44,7 @@ public class MethodTypeCPInfo extends ConstantCPInfo { | |||||
| * the stream. | * the stream. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public void read(final DataInputStream cpStream) throws IOException { | |||||
| public void read(final DataInputStream cpStream) throws IOException { | |||||
| methodDescriptorIndex = cpStream.readUnsignedShort(); | methodDescriptorIndex = cpStream.readUnsignedShort(); | ||||
| } | } | ||||
| @@ -56,7 +56,7 @@ public class MethodTypeCPInfo extends ConstantCPInfo { | |||||
| * and against which this entry is to be resolved. | * and against which this entry is to be resolved. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public void resolve(final ConstantPool constantPool) { | |||||
| public void resolve(final ConstantPool constantPool) { | |||||
| final Utf8CPInfo methodClass | final Utf8CPInfo methodClass | ||||
| = (Utf8CPInfo) constantPool.getEntry(methodDescriptorIndex); | = (Utf8CPInfo) constantPool.getEntry(methodDescriptorIndex); | ||||
| methodClass.resolve(constantPool); | methodClass.resolve(constantPool); | ||||
| @@ -69,7 +69,7 @@ public class MethodTypeCPInfo extends ConstantCPInfo { | |||||
| * @return the string representation of this constant pool entry. | * @return the string representation of this constant pool entry. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public String toString() { | |||||
| public String toString() { | |||||
| if (!isResolved()) { | if (!isResolved()) { | ||||
| return "MethodDescriptorIndex: " + methodDescriptorIndex; | return "MethodDescriptorIndex: " + methodDescriptorIndex; | ||||
| } else { | } else { | ||||
| @@ -167,7 +167,7 @@ public class IPlanetDeploymentTool extends GenericDeploymentTool { | |||||
| * ignored. | * ignored. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public void setGenericJarSuffix(String inString) { | |||||
| public void setGenericJarSuffix(String inString) { | |||||
| log("Since a generic JAR file is not created during processing, the " | log("Since a generic JAR file is not created during processing, the " | ||||
| + "iPlanet Deployment Tool does not support the " | + "iPlanet Deployment Tool does not support the " | ||||
| + "\"genericjarsuffix\" attribute. It will be ignored.", | + "\"genericjarsuffix\" attribute. It will be ignored.", | ||||
| @@ -176,7 +176,7 @@ public class IPlanetDeploymentTool extends GenericDeploymentTool { | |||||
| /** {@inheritDoc}. */ | /** {@inheritDoc}. */ | ||||
| @Override | @Override | ||||
| public void processDescriptor(String descriptorName, SAXParser saxParser) { | |||||
| public void processDescriptor(String descriptorName, SAXParser saxParser) { | |||||
| this.descriptorName = descriptorName; | this.descriptorName = descriptorName; | ||||
| this.iasDescriptorName = null; | this.iasDescriptorName = null; | ||||
| @@ -196,7 +196,7 @@ public class IPlanetDeploymentTool extends GenericDeploymentTool { | |||||
| * @throws BuildException If the user selections are invalid. | * @throws BuildException If the user selections are invalid. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| protected void checkConfiguration(String descriptorFileName, | |||||
| protected void checkConfiguration(String descriptorFileName, | |||||
| SAXParser saxParser) throws BuildException { | SAXParser saxParser) throws BuildException { | ||||
| int startOfName = descriptorFileName.lastIndexOf(File.separatorChar) + 1; | int startOfName = descriptorFileName.lastIndexOf(File.separatorChar) + 1; | ||||
| @@ -240,7 +240,7 @@ public class IPlanetDeploymentTool extends GenericDeploymentTool { | |||||
| * exception | * exception | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| protected Hashtable parseEjbFiles(String descriptorFileName, | |||||
| protected Hashtable parseEjbFiles(String descriptorFileName, | |||||
| SAXParser saxParser) throws IOException, SAXException { | SAXParser saxParser) throws IOException, SAXException { | ||||
| Hashtable files; | Hashtable files; | ||||
| @@ -313,7 +313,7 @@ public class IPlanetDeploymentTool extends GenericDeploymentTool { | |||||
| * @param ddPrefix not used | * @param ddPrefix not used | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| protected void addVendorFiles(Hashtable ejbFiles, String ddPrefix) { | |||||
| protected void addVendorFiles(Hashtable ejbFiles, String ddPrefix) { | |||||
| ejbFiles.put(META_DIR + IAS_DD, new File(getConfig().descriptorDir, | ejbFiles.put(META_DIR + IAS_DD, new File(getConfig().descriptorDir, | ||||
| getIasDescriptorName())); | getIasDescriptorName())); | ||||
| } | } | ||||
| @@ -328,7 +328,7 @@ public class IPlanetDeploymentTool extends GenericDeploymentTool { | |||||
| * @return File representing the JAR file which will be written. | * @return File representing the JAR file which will be written. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| File getVendorOutputJarFile(String baseName) { | |||||
| File getVendorOutputJarFile(String baseName) { | |||||
| File jarFile = new File(getDestDir(), baseName + jarSuffix); | File jarFile = new File(getDestDir(), baseName + jarSuffix); | ||||
| log("JAR file name: " + jarFile.toString(), Project.MSG_VERBOSE); | log("JAR file name: " + jarFile.toString(), Project.MSG_VERBOSE); | ||||
| return jarFile; | return jarFile; | ||||
| @@ -342,7 +342,7 @@ public class IPlanetDeploymentTool extends GenericDeploymentTool { | |||||
| * @return <code>null</code>. | * @return <code>null</code>. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| protected String getPublicId() { | |||||
| protected String getPublicId() { | |||||
| return null; | return null; | ||||
| } | } | ||||
| @@ -114,7 +114,7 @@ public class ExtensionSet | |||||
| * @exception BuildException if this instance already has been configured. | * @exception BuildException if this instance already has been configured. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public void setRefid(final Reference reference) | |||||
| public void setRefid(final Reference reference) | |||||
| throws BuildException { | throws BuildException { | ||||
| if (!extensions.isEmpty() || !extensionsFilesets.isEmpty()) { | if (!extensions.isEmpty() || !extensionsFilesets.isEmpty()) { | ||||
| throw tooManyAttributes(); | throw tooManyAttributes(); | ||||
| @@ -123,7 +123,7 @@ public class ExtensionSet | |||||
| } | } | ||||
| @Override | @Override | ||||
| protected synchronized void dieOnCircularReference(Stack stk, Project p) | |||||
| protected synchronized void dieOnCircularReference(Stack stk, Project p) | |||||
| throws BuildException { | throws BuildException { | ||||
| if (isChecked()) { | if (isChecked()) { | ||||
| return; | return; | ||||
| @@ -147,7 +147,7 @@ public class ExtensionSet | |||||
| * @return the extensions in a string. | * @return the extensions in a string. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public String toString() { | |||||
| public String toString() { | |||||
| return "ExtensionSet" + Arrays.asList(toExtensions(getProject())); | return "ExtensionSet" + Arrays.asList(toExtensions(getProject())); | ||||
| } | } | ||||
| } | } | ||||
| @@ -23,8 +23,8 @@ package org.apache.tools.ant.taskdefs.optional.junit; | |||||
| */ | */ | ||||
| public class Constants { | public class Constants { | ||||
| private Constants() { | |||||
| } | |||||
| private Constants() { | |||||
| } | |||||
| static final String METHOD_NAMES = "methods="; | static final String METHOD_NAMES = "methods="; | ||||
| static final String HALT_ON_ERROR = "haltOnError="; | static final String HALT_ON_ERROR = "haltOnError="; | ||||
| @@ -87,7 +87,7 @@ public class JUnit4TestMethodAdapter implements Test { | |||||
| runner = request.getRunner(); | runner = request.getRunner(); | ||||
| } | } | ||||
| public int countTestCases() { | |||||
| public int countTestCases() { | |||||
| return runner.testCount(); | return runner.testCount(); | ||||
| } | } | ||||
| @@ -103,12 +103,12 @@ public class JUnit4TestMethodAdapter implements Test { | |||||
| return testClass; | return testClass; | ||||
| } | } | ||||
| public void run(final TestResult result) { | |||||
| public void run(final TestResult result) { | |||||
| runner.run(cache.getNotifier(result)); | runner.run(cache.getNotifier(result)); | ||||
| } | } | ||||
| @Override | @Override | ||||
| public String toString() { | |||||
| public String toString() { | |||||
| String testClassName = testClass.getName(); | String testClassName = testClass.getName(); | ||||
| StringBuilder buf = new StringBuilder(testClassName.length() | StringBuilder buf = new StringBuilder(testClassName.length() | ||||
| + 12 * methodNames.length) | + 12 * methodNames.length) | ||||
| @@ -146,7 +146,7 @@ public class JUnit4TestMethodAdapter implements Test { | |||||
| } | } | ||||
| @Override | @Override | ||||
| public boolean shouldRun(Description description) { | |||||
| public boolean shouldRun(Description description) { | |||||
| if (methodNames.length == 0) { | if (methodNames.length == 0) { | ||||
| return false; | return false; | ||||
| } | } | ||||
| @@ -171,7 +171,7 @@ public class JUnit4TestMethodAdapter implements Test { | |||||
| } | } | ||||
| @Override | @Override | ||||
| public String describe() { | |||||
| public String describe() { | |||||
| StringBuilder buf = new StringBuilder(40); | StringBuilder buf = new StringBuilder(40); | ||||
| if (methodNames.length == 0) { | if (methodNames.length == 0) { | ||||
| buf.append("No methods"); | buf.append("No methods"); | ||||
| @@ -365,7 +365,7 @@ public class JUnitTask extends Task { | |||||
| * @return array of allowed values | * @return array of allowed values | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public String[] getValues() { | |||||
| public String[] getValues() { | |||||
| return new String[] {"true", "yes", "false", "no", | return new String[] {"true", "yes", "false", "no", | ||||
| "on", "off", "withOutAndErr"}; | "on", "off", "withOutAndErr"}; | ||||
| } | } | ||||
| @@ -457,7 +457,7 @@ public class JUnitTask extends Task { | |||||
| * @param sysp environment variable to add | * @param sysp environment variable to add | ||||
| */ | */ | ||||
| @Deprecated | @Deprecated | ||||
| public void addSysproperty(final Environment.Variable sysp) { | |||||
| public void addSysproperty(final Environment.Variable sysp) { | |||||
| getCommandline().addSysproperty(sysp); | getCommandline().addSysproperty(sysp); | ||||
| } | } | ||||
| @@ -735,7 +735,7 @@ public class JUnitTask extends Task { | |||||
| * @since Ant 1.4 | * @since Ant 1.4 | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public void init() { | |||||
| public void init() { | |||||
| antRuntimeClasses = new Path(getProject()); | antRuntimeClasses = new Path(getProject()); | ||||
| splitJUnit = !addClasspathResource("/junit/framework/TestCase.class"); | splitJUnit = !addClasspathResource("/junit/framework/TestCase.class"); | ||||
| addClasspathEntry("/org/apache/tools/ant/launch/AntMain.class"); | addClasspathEntry("/org/apache/tools/ant/launch/AntMain.class"); | ||||
| @@ -782,7 +782,7 @@ public class JUnitTask extends Task { | |||||
| path.add(extra); | path.add(extra); | ||||
| } | } | ||||
| mirrorLoader = (ClassLoader) AccessController.doPrivileged(new PrivilegedAction() { | mirrorLoader = (ClassLoader) AccessController.doPrivileged(new PrivilegedAction() { | ||||
| public Object run() { | |||||
| public Object run() { | |||||
| return new SplitClassLoader(myLoader, path, getProject(), | return new SplitClassLoader(myLoader, path, getProject(), | ||||
| new String[] { | new String[] { | ||||
| "BriefJUnitResultFormatter", | "BriefJUnitResultFormatter", | ||||
| @@ -816,7 +816,7 @@ public class JUnitTask extends Task { | |||||
| * @since Ant 1.2 | * @since Ant 1.2 | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public void execute() throws BuildException { | |||||
| public void execute() throws BuildException { | |||||
| checkMethodLists(); | checkMethodLists(); | ||||
| setupJUnitDelegate(); | setupJUnitDelegate(); | ||||
| @@ -870,7 +870,7 @@ public class JUnitTask extends Task { | |||||
| this.id = id; | this.id = id; | ||||
| } | } | ||||
| public void run() { | |||||
| public void run() { | |||||
| try { | try { | ||||
| masterTask.oneJunitThread(iterator, id); | masterTask.oneJunitThread(iterator, id); | ||||
| } catch (final BuildException b) { | } catch (final BuildException b) { | ||||
| @@ -1441,7 +1441,7 @@ public class JUnitTask extends Task { | |||||
| * @since Ant 1.5 | * @since Ant 1.5 | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| protected void handleOutput(final String output) { | |||||
| protected void handleOutput(final String output) { | |||||
| if (output.startsWith(TESTLISTENER_PREFIX)) { | if (output.startsWith(TESTLISTENER_PREFIX)) { | ||||
| log(output, Project.MSG_VERBOSE); | log(output, Project.MSG_VERBOSE); | ||||
| } else if (runner != null) { | } else if (runner != null) { | ||||
| @@ -1471,7 +1471,7 @@ public class JUnitTask extends Task { | |||||
| * @since Ant 1.6 | * @since Ant 1.6 | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| protected int handleInput(final byte[] buffer, final int offset, final int length) | |||||
| protected int handleInput(final byte[] buffer, final int offset, final int length) | |||||
| throws IOException { | throws IOException { | ||||
| if (runner != null) { | if (runner != null) { | ||||
| return runner.handleInput(buffer, offset, length); | return runner.handleInput(buffer, offset, length); | ||||
| @@ -1489,7 +1489,7 @@ public class JUnitTask extends Task { | |||||
| * @since Ant 1.5.2 | * @since Ant 1.5.2 | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| protected void handleFlush(final String output) { | |||||
| protected void handleFlush(final String output) { | |||||
| if (runner != null) { | if (runner != null) { | ||||
| runner.handleFlush(output); | runner.handleFlush(output); | ||||
| if (showOutput) { | if (showOutput) { | ||||
| @@ -1508,7 +1508,7 @@ public class JUnitTask extends Task { | |||||
| * @since Ant 1.5 | * @since Ant 1.5 | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public void handleErrorOutput(final String output) { | |||||
| public void handleErrorOutput(final String output) { | |||||
| if (runner != null) { | if (runner != null) { | ||||
| runner.handleErrorOutput(output); | runner.handleErrorOutput(output); | ||||
| if (showOutput) { | if (showOutput) { | ||||
| @@ -1528,7 +1528,7 @@ public class JUnitTask extends Task { | |||||
| * @since Ant 1.5.2 | * @since Ant 1.5.2 | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public void handleErrorFlush(final String output) { | |||||
| public void handleErrorFlush(final String output) { | |||||
| if (runner != null) { | if (runner != null) { | ||||
| runner.handleErrorFlush(output); | runner.handleErrorFlush(output); | ||||
| if (showOutput) { | if (showOutput) { | ||||
| @@ -2009,7 +2009,7 @@ public class JUnitTask extends Task { | |||||
| * @return true if everything is equal | * @return true if everything is equal | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public boolean equals(final Object other) { | |||||
| public boolean equals(final Object other) { | |||||
| if (other == null | if (other == null | ||||
| || other.getClass() != ForkedTestConfiguration.class) { | || other.getClass() != ForkedTestConfiguration.class) { | ||||
| return false; | return false; | ||||
| @@ -2034,7 +2034,7 @@ public class JUnitTask extends Task { | |||||
| * @return hash code value | * @return hash code value | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public int hashCode() { | |||||
| public int hashCode() { | |||||
| // CheckStyle:MagicNumber OFF | // CheckStyle:MagicNumber OFF | ||||
| return (filterTrace ? 1 : 0) | return (filterTrace ? 1 : 0) | ||||
| + (haltOnError ? 2 : 0) | + (haltOnError ? 2 : 0) | ||||
| @@ -2078,7 +2078,7 @@ public class JUnitTask extends Task { | |||||
| /** {@inheritDoc}. */ | /** {@inheritDoc}. */ | ||||
| @Override | @Override | ||||
| public String[] getValues() { | |||||
| public String[] getValues() { | |||||
| return new String[] {ONCE, PER_TEST, PER_BATCH}; | return new String[] {ONCE, PER_TEST, PER_BATCH}; | ||||
| } | } | ||||
| } | } | ||||
| @@ -2216,7 +2216,7 @@ public class JUnitTask extends Task { | |||||
| * @param level the logging level to use. | * @param level the logging level to use. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| protected void processLine(final String line, final int level) { | |||||
| protected void processLine(final String line, final int level) { | |||||
| if (line.startsWith(TESTLISTENER_PREFIX)) { | if (line.startsWith(TESTLISTENER_PREFIX)) { | ||||
| task.log(line, Project.MSG_VERBOSE); | task.log(line, Project.MSG_VERBOSE); | ||||
| } else { | } else { | ||||
| @@ -170,7 +170,7 @@ public class JUnitTest extends BaseTest implements Cloneable { | |||||
| /** | /** | ||||
| * Set the thread id | * Set the thread id | ||||
| * @param thread the Ant id of the thread running this test | * @param thread the Ant id of the thread running this test | ||||
| * (this is not the system process or thread id) | |||||
| * (this is not the system process or thread id) | |||||
| * (this will be 0 in single-threaded mode). | * (this will be 0 in single-threaded mode). | ||||
| * @since Ant 1.9.4 | * @since Ant 1.9.4 | ||||
| */ | */ | ||||
| @@ -528,7 +528,7 @@ public class JUnitTest extends BaseTest implements Cloneable { | |||||
| * @return a clone of this test. | * @return a clone of this test. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public Object clone() { | |||||
| public Object clone() { | |||||
| try { | try { | ||||
| JUnitTest t = (JUnitTest) super.clone(); | JUnitTest t = (JUnitTest) super.clone(); | ||||
| t.props = props == null ? null : (Properties) props.clone(); | t.props = props == null ? null : (Properties) props.clone(); | ||||
| @@ -311,7 +311,7 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR | |||||
| return new PrintStream( | return new PrintStream( | ||||
| new OutputStream() { | new OutputStream() { | ||||
| @Override | @Override | ||||
| public void write(final int b) { | |||||
| public void write(final int b) { | |||||
| } | } | ||||
| }); | }); | ||||
| } | } | ||||
| @@ -355,7 +355,7 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR | |||||
| /** | /** | ||||
| * Run the test. | * Run the test. | ||||
| */ | */ | ||||
| public void run() { | |||||
| public void run() { | |||||
| res = new IgnoredTestResult(); | res = new IgnoredTestResult(); | ||||
| res.addListener(wrapListener(this)); | res.addListener(wrapListener(this)); | ||||
| final int size = formatters.size(); | final int size = formatters.size(); | ||||
| @@ -677,7 +677,7 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR | |||||
| * | * | ||||
| * @return 2 if errors occurred, 1 if tests failed else 0. | * @return 2 if errors occurred, 1 if tests failed else 0. | ||||
| */ | */ | ||||
| public int getRetCode() { | |||||
| public int getRetCode() { | |||||
| return retCode; | return retCode; | ||||
| } | } | ||||
| @@ -687,7 +687,7 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR | |||||
| * <p>A new Test is started. | * <p>A new Test is started. | ||||
| * @param t the test. | * @param t the test. | ||||
| */ | */ | ||||
| public void startTest(final Test t) { | |||||
| public void startTest(final Test t) { | |||||
| final String testName = JUnitVersionHelper.getTestCaseName(t); | final String testName = JUnitVersionHelper.getTestCaseName(t); | ||||
| logTestListenerEvent("startTest(" + testName + ")"); | logTestListenerEvent("startTest(" + testName + ")"); | ||||
| } | } | ||||
| @@ -698,7 +698,7 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR | |||||
| * <p>A Test is finished. | * <p>A Test is finished. | ||||
| * @param test the test. | * @param test the test. | ||||
| */ | */ | ||||
| public void endTest(final Test test) { | |||||
| public void endTest(final Test test) { | |||||
| final String testName = JUnitVersionHelper.getTestCaseName(test); | final String testName = JUnitVersionHelper.getTestCaseName(test); | ||||
| logTestListenerEvent("endTest(" + testName + ")"); | logTestListenerEvent("endTest(" + testName + ")"); | ||||
| } | } | ||||
| @@ -741,7 +741,7 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR | |||||
| * @param test the test. | * @param test the test. | ||||
| * @param t the assertion thrown by the test. | * @param t the assertion thrown by the test. | ||||
| */ | */ | ||||
| public void addFailure(final Test test, final AssertionFailedError t) { | |||||
| public void addFailure(final Test test, final AssertionFailedError t) { | |||||
| addFailure(test, (Throwable) t); | addFailure(test, (Throwable) t); | ||||
| } | } | ||||
| @@ -752,7 +752,7 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR | |||||
| * @param test the test. | * @param test the test. | ||||
| * @param t the error thrown by the test. | * @param t the error thrown by the test. | ||||
| */ | */ | ||||
| public void addError(final Test test, final Throwable t) { | |||||
| public void addError(final Test test, final Throwable t) { | |||||
| final String testName = JUnitVersionHelper.getTestCaseName(test); | final String testName = JUnitVersionHelper.getTestCaseName(test); | ||||
| logTestListenerEvent("addError(" + testName + ", " + t.getMessage() + ")"); | logTestListenerEvent("addError(" + testName + ", " + t.getMessage() + ")"); | ||||
| if (haltOnError) { | if (haltOnError) { | ||||
| @@ -765,7 +765,7 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR | |||||
| * @since Ant 1.6 | * @since Ant 1.6 | ||||
| * @param permissions the permissions to use. | * @param permissions the permissions to use. | ||||
| */ | */ | ||||
| public void setPermissions(final Permissions permissions) { | |||||
| public void setPermissions(final Permissions permissions) { | |||||
| perm = permissions; | perm = permissions; | ||||
| } | } | ||||
| @@ -773,7 +773,7 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR | |||||
| * Handle a string destined for standard output. | * Handle a string destined for standard output. | ||||
| * @param output the string to output | * @param output the string to output | ||||
| */ | */ | ||||
| public void handleOutput(final String output) { | |||||
| public void handleOutput(final String output) { | |||||
| if (!logTestListenerEvents && output.startsWith(JUnitTask.TESTLISTENER_PREFIX)) { | if (!logTestListenerEvents && output.startsWith(JUnitTask.TESTLISTENER_PREFIX)) { | ||||
| // ignore | // ignore | ||||
| } else if (systemOut != null) { | } else if (systemOut != null) { | ||||
| @@ -792,27 +792,27 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR | |||||
| * | * | ||||
| * @since Ant 1.6 | * @since Ant 1.6 | ||||
| */ | */ | ||||
| public int handleInput(final byte[] buffer, final int offset, final int length) | |||||
| public int handleInput(final byte[] buffer, final int offset, final int length) | |||||
| throws IOException { | throws IOException { | ||||
| return -1; | return -1; | ||||
| } | } | ||||
| /** {@inheritDoc}. */ | /** {@inheritDoc}. */ | ||||
| public void handleErrorOutput(final String output) { | |||||
| public void handleErrorOutput(final String output) { | |||||
| if (systemError != null) { | if (systemError != null) { | ||||
| systemError.print(output); | systemError.print(output); | ||||
| } | } | ||||
| } | } | ||||
| /** {@inheritDoc}. */ | /** {@inheritDoc}. */ | ||||
| public void handleFlush(final String output) { | |||||
| public void handleFlush(final String output) { | |||||
| if (systemOut != null) { | if (systemOut != null) { | ||||
| systemOut.print(output); | systemOut.print(output); | ||||
| } | } | ||||
| } | } | ||||
| /** {@inheritDoc}. */ | /** {@inheritDoc}. */ | ||||
| public void handleErrorFlush(final String output) { | |||||
| public void handleErrorFlush(final String output) { | |||||
| if (systemError != null) { | if (systemError != null) { | ||||
| systemError.print(output); | systemError.print(output); | ||||
| } | } | ||||
| @@ -854,7 +854,7 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR | |||||
| } | } | ||||
| /** {@inheritDoc}. */ | /** {@inheritDoc}. */ | ||||
| public void addFormatter(final JUnitTaskMirror.JUnitResultFormatterMirror f) { | |||||
| public void addFormatter(final JUnitTaskMirror.JUnitResultFormatterMirror f) { | |||||
| formatters.addElement(f); | formatters.addElement(f); | ||||
| } | } | ||||
| @@ -1045,31 +1045,31 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR | |||||
| final JUnitTest test) { | final JUnitTest test) { | ||||
| runner.addFormatter(new JUnitResultFormatter() { | runner.addFormatter(new JUnitResultFormatter() { | ||||
| public void startTestSuite(final JUnitTest suite) throws BuildException { | |||||
| public void startTestSuite(final JUnitTest suite) throws BuildException { | |||||
| } | } | ||||
| public void endTestSuite(final JUnitTest suite) throws BuildException { | |||||
| public void endTestSuite(final JUnitTest suite) throws BuildException { | |||||
| } | } | ||||
| public void setOutput(final OutputStream out) { | |||||
| public void setOutput(final OutputStream out) { | |||||
| } | } | ||||
| public void setSystemOutput(final String out) { | |||||
| public void setSystemOutput(final String out) { | |||||
| } | } | ||||
| public void setSystemError(final String err) { | |||||
| public void setSystemError(final String err) { | |||||
| } | } | ||||
| public void addError(final Test arg0, final Throwable arg1) { | |||||
| public void addError(final Test arg0, final Throwable arg1) { | |||||
| } | } | ||||
| public void addFailure(final Test arg0, final AssertionFailedError arg1) { | |||||
| public void addFailure(final Test arg0, final AssertionFailedError arg1) { | |||||
| } | } | ||||
| public void endTest(final Test arg0) { | |||||
| public void endTest(final Test arg0) { | |||||
| } | } | ||||
| public void startTest(final Test arg0) { | |||||
| public void startTest(final Test arg0) { | |||||
| registerTestCase(JUnitVersionHelper.getTestCaseName(arg0)); | registerTestCase(JUnitVersionHelper.getTestCaseName(arg0)); | ||||
| } | } | ||||
| }); | }); | ||||
| @@ -1226,7 +1226,7 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR | |||||
| private TestListenerWrapper wrapListener(final TestListener testListener) { | private TestListenerWrapper wrapListener(final TestListener testListener) { | ||||
| return new TestListenerWrapper(testListener) { | return new TestListenerWrapper(testListener) { | ||||
| @Override | @Override | ||||
| public void addError(final Test test, final Throwable t) { | |||||
| public void addError(final Test test, final Throwable t) { | |||||
| if (junit4 && t instanceof AssertionFailedError) { | if (junit4 && t instanceof AssertionFailedError) { | ||||
| // JUnit 4 does not distinguish between errors and failures | // JUnit 4 does not distinguish between errors and failures | ||||
| // even in the JUnit 3 adapter. | // even in the JUnit 3 adapter. | ||||
| @@ -1247,7 +1247,7 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR | |||||
| } | } | ||||
| } | } | ||||
| @Override | @Override | ||||
| public void addFailure(final Test test, final AssertionFailedError t) { | |||||
| public void addFailure(final Test test, final AssertionFailedError t) { | |||||
| testListener.addFailure(test, t); | testListener.addFailure(test, t); | ||||
| } | } | ||||
| public void addFailure(final Test test, final Throwable t) { // pre-3.4 | public void addFailure(final Test test, final Throwable t) { // pre-3.4 | ||||
| @@ -1258,11 +1258,11 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR | |||||
| } | } | ||||
| } | } | ||||
| @Override | @Override | ||||
| public void endTest(final Test test) { | |||||
| public void endTest(final Test test) { | |||||
| testListener.endTest(test); | testListener.endTest(test); | ||||
| } | } | ||||
| @Override | @Override | ||||
| public void startTest(final Test test) { | |||||
| public void startTest(final Test test) { | |||||
| testListener.startTest(test); | testListener.startTest(test); | ||||
| } | } | ||||
| }; | }; | ||||
| @@ -43,7 +43,7 @@ public class TearDownOnVmCrash implements JUnitResultFormatter { | |||||
| * Records the suite's name to later determine the class to invoke | * Records the suite's name to later determine the class to invoke | ||||
| * tearDown on. | * tearDown on. | ||||
| */ | */ | ||||
| public void startTestSuite(final JUnitTest suite) { | |||||
| public void startTestSuite(final JUnitTest suite) { | |||||
| suiteName = suite.getName(); | suiteName = suite.getName(); | ||||
| if (suiteName != null && | if (suiteName != null && | ||||
| suiteName.endsWith(JUnitTask.NAME_OF_DUMMY_TEST)) { | suiteName.endsWith(JUnitTask.NAME_OF_DUMMY_TEST)) { | ||||
| @@ -57,7 +57,7 @@ public class TearDownOnVmCrash implements JUnitResultFormatter { | |||||
| * test we get when a Batch fails and the error is an actual | * test we get when a Batch fails and the error is an actual | ||||
| * error generated by Ant. | * error generated by Ant. | ||||
| */ | */ | ||||
| public void addError(final Test fakeTest, final Throwable t) { | |||||
| public void addError(final Test fakeTest, final Throwable t) { | |||||
| if (suiteName != null | if (suiteName != null | ||||
| && fakeTest instanceof JUnitTaskMirrorImpl.VmExitErrorTest) { | && fakeTest instanceof JUnitTaskMirrorImpl.VmExitErrorTest) { | ||||
| tearDown(); | tearDown(); | ||||
| @@ -67,19 +67,19 @@ public class TearDownOnVmCrash implements JUnitResultFormatter { | |||||
| // no need to implement the rest | // no need to implement the rest | ||||
| public void addFailure(Test test, Throwable t) {} | public void addFailure(Test test, Throwable t) {} | ||||
| public void addFailure(Test test, AssertionFailedError t) {} | |||||
| public void addFailure(Test test, AssertionFailedError t) {} | |||||
| public void startTest(Test test) {} | |||||
| public void startTest(Test test) {} | |||||
| public void endTest(Test test) {} | |||||
| public void endTest(Test test) {} | |||||
| public void endTestSuite(JUnitTest suite) {} | |||||
| public void endTestSuite(JUnitTest suite) {} | |||||
| public void setOutput(OutputStream out) {} | |||||
| public void setOutput(OutputStream out) {} | |||||
| public void setSystemOutput(String out) {} | |||||
| public void setSystemOutput(String out) {} | |||||
| public void setSystemError(String err) {} | |||||
| public void setSystemError(String err) {} | |||||
| private void tearDown() { | private void tearDown() { | ||||
| try { | try { | ||||
| @@ -91,7 +91,7 @@ public class TearDownOnVmCrash implements JUnitResultFormatter { | |||||
| testClass = Thread.currentThread().getContextClassLoader() | testClass = Thread.currentThread().getContextClassLoader() | ||||
| .loadClass(suiteName); | .loadClass(suiteName); | ||||
| } catch (ClassNotFoundException cnfe) { | } catch (ClassNotFoundException cnfe) { | ||||
| // ignore | |||||
| // ignore | |||||
| } | } | ||||
| } | } | ||||
| if (testClass == null && getClass().getClassLoader() != null) { | if (testClass == null && getClass().getClassLoader() != null) { | ||||
| @@ -99,7 +99,7 @@ public class TearDownOnVmCrash implements JUnitResultFormatter { | |||||
| testClass = | testClass = | ||||
| getClass().getClassLoader().loadClass(suiteName); | getClass().getClassLoader().loadClass(suiteName); | ||||
| } catch (ClassNotFoundException cnfe) { | } catch (ClassNotFoundException cnfe) { | ||||
| // ignore | |||||
| // ignore | |||||
| } | } | ||||
| } | } | ||||
| if (testClass == null) { | if (testClass == null) { | ||||
| @@ -141,4 +141,4 @@ public class TearDownOnVmCrash implements JUnitResultFormatter { | |||||
| + " tearDown: " + t.getMessage()); | + " tearDown: " + t.getMessage()); | ||||
| } | } | ||||
| } | } | ||||
| } | |||||
| } | |||||
| @@ -113,17 +113,17 @@ public class XMLJUnitResultFormatter implements JUnitResultFormatter, XMLConstan | |||||
| } | } | ||||
| /** {@inheritDoc}. */ | /** {@inheritDoc}. */ | ||||
| public void setOutput(final OutputStream out) { | |||||
| public void setOutput(final OutputStream out) { | |||||
| this.out = out; | this.out = out; | ||||
| } | } | ||||
| /** {@inheritDoc}. */ | /** {@inheritDoc}. */ | ||||
| public void setSystemOutput(final String out) { | |||||
| public void setSystemOutput(final String out) { | |||||
| formatOutput(SYSTEM_OUT, out); | formatOutput(SYSTEM_OUT, out); | ||||
| } | } | ||||
| /** {@inheritDoc}. */ | /** {@inheritDoc}. */ | ||||
| public void setSystemError(final String out) { | |||||
| public void setSystemError(final String out) { | |||||
| formatOutput(SYSTEM_ERR, out); | formatOutput(SYSTEM_ERR, out); | ||||
| } | } | ||||
| @@ -131,7 +131,7 @@ public class XMLJUnitResultFormatter implements JUnitResultFormatter, XMLConstan | |||||
| * The whole testsuite started. | * The whole testsuite started. | ||||
| * @param suite the testsuite. | * @param suite the testsuite. | ||||
| */ | */ | ||||
| public void startTestSuite(final JUnitTest suite) { | |||||
| public void startTestSuite(final JUnitTest suite) { | |||||
| doc = getDocumentBuilder().newDocument(); | doc = getDocumentBuilder().newDocument(); | ||||
| rootElement = doc.createElement(TESTSUITE); | rootElement = doc.createElement(TESTSUITE); | ||||
| final String n = suite.getName(); | final String n = suite.getName(); | ||||
| @@ -172,7 +172,7 @@ public class XMLJUnitResultFormatter implements JUnitResultFormatter, XMLConstan | |||||
| hostname = localHost.getHostName(); | hostname = localHost.getHostName(); | ||||
| } | } | ||||
| } catch (final UnknownHostException e) { | } catch (final UnknownHostException e) { | ||||
| // fall back to default 'localhost' | |||||
| // fall back to default 'localhost' | |||||
| } | } | ||||
| return hostname; | return hostname; | ||||
| } | } | ||||
| @@ -182,7 +182,7 @@ public class XMLJUnitResultFormatter implements JUnitResultFormatter, XMLConstan | |||||
| * @param suite the testsuite. | * @param suite the testsuite. | ||||
| * @throws BuildException on error. | * @throws BuildException on error. | ||||
| */ | */ | ||||
| public void endTestSuite(final JUnitTest suite) throws BuildException { | |||||
| public void endTestSuite(final JUnitTest suite) throws BuildException { | |||||
| rootElement.setAttribute(ATTR_TESTS, "" + suite.runCount()); | rootElement.setAttribute(ATTR_TESTS, "" + suite.runCount()); | ||||
| rootElement.setAttribute(ATTR_FAILURES, "" + suite.failureCount()); | rootElement.setAttribute(ATTR_FAILURES, "" + suite.failureCount()); | ||||
| rootElement.setAttribute(ATTR_ERRORS, "" + suite.errorCount()); | rootElement.setAttribute(ATTR_ERRORS, "" + suite.errorCount()); | ||||
| @@ -218,13 +218,13 @@ public class XMLJUnitResultFormatter implements JUnitResultFormatter, XMLConstan | |||||
| * <p>A new Test is started. | * <p>A new Test is started. | ||||
| * @param t the test. | * @param t the test. | ||||
| */ | */ | ||||
| public void startTest(final Test t) { | |||||
| public void startTest(final Test t) { | |||||
| testStarts.put(createDescription(t), System.currentTimeMillis()); | testStarts.put(createDescription(t), System.currentTimeMillis()); | ||||
| } | } | ||||
| private static String createDescription(final Test test) throws BuildException { | private static String createDescription(final Test test) throws BuildException { | ||||
| return JUnitVersionHelper.getTestCaseName(test) + "(" + JUnitVersionHelper.getTestCaseClassName(test) + ")"; | return JUnitVersionHelper.getTestCaseName(test) + "(" + JUnitVersionHelper.getTestCaseClassName(test) + ")"; | ||||
| } | |||||
| } | |||||
| /** | /** | ||||
| * Interface TestListener. | * Interface TestListener. | ||||
| @@ -232,7 +232,7 @@ public class XMLJUnitResultFormatter implements JUnitResultFormatter, XMLConstan | |||||
| * <p>A Test is finished. | * <p>A Test is finished. | ||||
| * @param test the test. | * @param test the test. | ||||
| */ | */ | ||||
| public void endTest(final Test test) { | |||||
| public void endTest(final Test test) { | |||||
| final String testDescription = createDescription(test); | final String testDescription = createDescription(test); | ||||
| // Fix for bug #5637 - if a junit.extensions.TestSetup is | // Fix for bug #5637 - if a junit.extensions.TestSetup is | ||||
| @@ -280,7 +280,7 @@ public class XMLJUnitResultFormatter implements JUnitResultFormatter, XMLConstan | |||||
| * @param test the test. | * @param test the test. | ||||
| * @param t the assertion. | * @param t the assertion. | ||||
| */ | */ | ||||
| public void addFailure(final Test test, final AssertionFailedError t) { | |||||
| public void addFailure(final Test test, final AssertionFailedError t) { | |||||
| addFailure(test, (Throwable) t); | addFailure(test, (Throwable) t); | ||||
| } | } | ||||
| @@ -291,7 +291,7 @@ public class XMLJUnitResultFormatter implements JUnitResultFormatter, XMLConstan | |||||
| * @param test the test. | * @param test the test. | ||||
| * @param t the error. | * @param t the error. | ||||
| */ | */ | ||||
| public void addError(final Test test, final Throwable t) { | |||||
| public void addError(final Test test, final Throwable t) { | |||||
| formatError(ERROR, test, t); | formatError(ERROR, test, t); | ||||
| } | } | ||||
| @@ -328,7 +328,7 @@ public class XMLJUnitResultFormatter implements JUnitResultFormatter, XMLConstan | |||||
| nested.appendChild(doc.createCDATASection(output)); | nested.appendChild(doc.createCDATASection(output)); | ||||
| } | } | ||||
| public void testIgnored(final Test test) { | |||||
| public void testIgnored(final Test test) { | |||||
| formatSkip(test, JUnitVersionHelper.getIgnoreMessage(test)); | formatSkip(test, JUnitVersionHelper.getIgnoreMessage(test)); | ||||
| if (test != null) { | if (test != null) { | ||||
| ignoredTests.put(createDescription(test), test); | ignoredTests.put(createDescription(test), test); | ||||
| @@ -358,7 +358,7 @@ public class XMLJUnitResultFormatter implements JUnitResultFormatter, XMLConstan | |||||
| } | } | ||||
| public void testAssumptionFailure(final Test test, final Throwable failure) { | |||||
| public void testAssumptionFailure(final Test test, final Throwable failure) { | |||||
| formatSkip(test, failure.getMessage()); | formatSkip(test, failure.getMessage()); | ||||
| skippedTests.put(createDescription(test), test); | skippedTests.put(createDescription(test), test); | ||||
| @@ -72,7 +72,7 @@ public class SplashTask extends Task { | |||||
| * Use org.apache.tools.ant.taskdefs.optional.net.SetProxy | * Use org.apache.tools.ant.taskdefs.optional.net.SetProxy | ||||
| */ | */ | ||||
| @Deprecated | @Deprecated | ||||
| public void setUseproxy(boolean useProxy) { | |||||
| public void setUseproxy(boolean useProxy) { | |||||
| this.useProxy = useProxy; | this.useProxy = useProxy; | ||||
| } | } | ||||
| @@ -83,7 +83,7 @@ public class SplashTask extends Task { | |||||
| * Use org.apache.tools.ant.taskdefs.optional.net.SetProxy | * Use org.apache.tools.ant.taskdefs.optional.net.SetProxy | ||||
| */ | */ | ||||
| @Deprecated | @Deprecated | ||||
| public void setProxy(String proxy) { | |||||
| public void setProxy(String proxy) { | |||||
| this.proxy = proxy; | this.proxy = proxy; | ||||
| } | } | ||||
| @@ -94,7 +94,7 @@ public class SplashTask extends Task { | |||||
| * Use org.apache.tools.ant.taskdefs.optional.net.SetProxy | * Use org.apache.tools.ant.taskdefs.optional.net.SetProxy | ||||
| */ | */ | ||||
| @Deprecated | @Deprecated | ||||
| public void setPort(String port) { | |||||
| public void setPort(String port) { | |||||
| this.port = port; | this.port = port; | ||||
| } | } | ||||
| @@ -105,7 +105,7 @@ public class SplashTask extends Task { | |||||
| * Use org.apache.tools.ant.taskdefs.optional.net.SetProxy | * Use org.apache.tools.ant.taskdefs.optional.net.SetProxy | ||||
| */ | */ | ||||
| @Deprecated | @Deprecated | ||||
| public void setUser(String user) { | |||||
| public void setUser(String user) { | |||||
| this.user = user; | this.user = user; | ||||
| } | } | ||||
| @@ -116,7 +116,7 @@ public class SplashTask extends Task { | |||||
| * Use org.apache.tools.ant.taskdefs.optional.net.SetProxy | * Use org.apache.tools.ant.taskdefs.optional.net.SetProxy | ||||
| */ | */ | ||||
| @Deprecated | @Deprecated | ||||
| public void setPassword(String password) { | |||||
| public void setPassword(String password) { | |||||
| this.password = password; | this.password = password; | ||||
| } | } | ||||
| @@ -158,7 +158,7 @@ public class SplashTask extends Task { | |||||
| * @throws BuildException on error | * @throws BuildException on error | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public void execute() throws BuildException { | |||||
| public void execute() throws BuildException { | |||||
| if (splash != null) { | if (splash != null) { | ||||
| splash.setVisible(false); | splash.setVisible(false); | ||||
| getProject().removeBuildListener(splash); | getProject().removeBuildListener(splash); | ||||
| @@ -135,7 +135,7 @@ public class Directory { | |||||
| * @return true if this object has an equal directory field as the other object | * @return true if this object has an equal directory field as the other object | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public boolean equals(Object obj) { | |||||
| public boolean equals(Object obj) { | |||||
| if (obj == this) { | if (obj == this) { | ||||
| return true; | return true; | ||||
| } | } | ||||
| @@ -154,7 +154,7 @@ public class Directory { | |||||
| * @return the hash code of the directory field | * @return the hash code of the directory field | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public int hashCode() { | |||||
| public int hashCode() { | |||||
| return directory.hashCode(); | return directory.hashCode(); | ||||
| } | } | ||||
| @@ -198,15 +198,15 @@ public abstract class SSHBase extends Task implements LogListener { | |||||
| protected Session openSession() throws JSchException { | protected Session openSession() throws JSchException { | ||||
| final JSch jsch = new JSch(); | final JSch jsch = new JSch(); | ||||
| final SSHBase base = this; | final SSHBase base = this; | ||||
| if(verbose) { | |||||
| JSch.setLogger(new com.jcraft.jsch.Logger(){ | |||||
| public boolean isEnabled(final int level){ | |||||
| return true; | |||||
| } | |||||
| public void log(final int level, final String message){ | |||||
| base.log(message, Project.MSG_INFO); | |||||
| } | |||||
| }); | |||||
| if (verbose) { | |||||
| JSch.setLogger(new com.jcraft.jsch.Logger(){ | |||||
| public boolean isEnabled(final int level){ | |||||
| return true; | |||||
| } | |||||
| public void log(final int level, final String message){ | |||||
| base.log(message, Project.MSG_INFO); | |||||
| } | |||||
| }); | |||||
| } | } | ||||
| if (null != userInfo.getKeyfile()) { | if (null != userInfo.getKeyfile()) { | ||||
| jsch.addIdentity(userInfo.getKeyfile()); | jsch.addIdentity(userInfo.getKeyfile()); | ||||
| @@ -275,7 +275,7 @@ public class SSHExec extends SSHBase { | |||||
| * @exception BuildException Most likely a network error or bad parameter. | * @exception BuildException Most likely a network error or bad parameter. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public void execute() throws BuildException { | |||||
| public void execute() throws BuildException { | |||||
| if (getHost() == null) { | if (getHost() == null) { | ||||
| throw new BuildException("Host is required."); | throw new BuildException("Host is required."); | ||||
| @@ -401,7 +401,7 @@ public class SSHExec extends SSHBase { | |||||
| thread = | thread = | ||||
| new Thread() { | new Thread() { | ||||
| @Override | @Override | ||||
| public void run() { | |||||
| public void run() { | |||||
| while (!channel.isClosed()) { | while (!channel.isClosed()) { | ||||
| if (thread == null) { | if (thread == null) { | ||||
| return; | return; | ||||
| @@ -133,7 +133,7 @@ public class SSHSession extends SSHBase { | |||||
| * network error or bad parameter. | * network error or bad parameter. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public void execute() throws BuildException { | |||||
| public void execute() throws BuildException { | |||||
| if (getHost() == null) { | if (getHost() == null) { | ||||
| throw new BuildException("Host is required."); | throw new BuildException("Host is required."); | ||||
| } | } | ||||
| @@ -238,19 +238,19 @@ public class SSHSession extends SSHBase { | |||||
| public void setRPort(final int rport) { this.rport = rport; } | public void setRPort(final int rport) { this.rport = rport; } | ||||
| public int getLPort() { | public int getLPort() { | ||||
| if (lport == 0) { | if (lport == 0) { | ||||
| throw new BuildException("lport is required for LocalTunnel."); | |||||
| throw new BuildException("lport is required for LocalTunnel."); | |||||
| } | } | ||||
| return lport; | return lport; | ||||
| } | } | ||||
| public String getRHost() { | public String getRHost() { | ||||
| if (rhost == null) { | if (rhost == null) { | ||||
| throw new BuildException("rhost is required for LocalTunnel."); | |||||
| throw new BuildException("rhost is required for LocalTunnel."); | |||||
| } | } | ||||
| return rhost; | return rhost; | ||||
| } | } | ||||
| public int getRPort() { | public int getRPort() { | ||||
| if (rport == 0) { | if (rport == 0) { | ||||
| throw new BuildException("rport is required for LocalTunnel."); | |||||
| throw new BuildException("rport is required for LocalTunnel."); | |||||
| } | } | ||||
| return rport; | return rport; | ||||
| } | } | ||||
| @@ -266,28 +266,28 @@ public class SSHSession extends SSHBase { | |||||
| public void setLHost(final String lhost) { this.lhost = lhost; } | public void setLHost(final String lhost) { this.lhost = lhost; } | ||||
| public void setRPort(final int rport) { | public void setRPort(final int rport) { | ||||
| final Integer portKey = new Integer(rport); | final Integer portKey = new Integer(rport); | ||||
| if (remotePortsUsed.contains(portKey)) { | |||||
| throw new BuildException("Multiple remote tunnels defined to" | |||||
| + " use same remote port " + rport); | |||||
| } | |||||
| if (remotePortsUsed.contains(portKey)) { | |||||
| throw new BuildException("Multiple remote tunnels defined to" | |||||
| + " use same remote port " + rport); | |||||
| } | |||||
| remotePortsUsed.add(portKey); | remotePortsUsed.add(portKey); | ||||
| this.rport = rport; | this.rport = rport; | ||||
| } | } | ||||
| public int getLPort() { | public int getLPort() { | ||||
| if (lport == 0) { | if (lport == 0) { | ||||
| throw new BuildException("lport is required for RemoteTunnel."); | |||||
| throw new BuildException("lport is required for RemoteTunnel."); | |||||
| } | } | ||||
| return lport; | return lport; | ||||
| } | } | ||||
| public String getLHost() { | public String getLHost() { | ||||
| if (lhost == null) { | if (lhost == null) { | ||||
| throw new BuildException("lhost is required for RemoteTunnel."); | |||||
| throw new BuildException("lhost is required for RemoteTunnel."); | |||||
| } | } | ||||
| return lhost; | return lhost; | ||||
| } | } | ||||
| public int getRPort() { | public int getRPort() { | ||||
| if (rport == 0) { | if (rport == 0) { | ||||
| throw new BuildException("rport is required for RemoteTunnel."); | |||||
| throw new BuildException("rport is required for RemoteTunnel."); | |||||
| } | } | ||||
| return rport; | return rport; | ||||
| } | } | ||||
| @@ -318,7 +318,7 @@ public class SSHSession extends SSHBase { | |||||
| * | * | ||||
| * @param task an unknown element. | * @param task an unknown element. | ||||
| */ | */ | ||||
| public void addTask(final Task task) { | |||||
| public void addTask(final Task task) { | |||||
| nested.add(task); | nested.add(task); | ||||
| } | } | ||||
| @@ -123,7 +123,7 @@ public class Scp extends SSHBase { | |||||
| * @since Ant 1.8.0 | * @since Ant 1.8.0 | ||||
| */ | */ | ||||
| public void setPreservelastmodified(final boolean yesOrNo) { | public void setPreservelastmodified(final boolean yesOrNo) { | ||||
| this.preserveLastModified = yesOrNo; | |||||
| this.preserveLastModified = yesOrNo; | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -139,13 +139,13 @@ public class Scp extends SSHBase { | |||||
| } | } | ||||
| private static void validateRemoteUri(final String type, final String aToUri) { | private static void validateRemoteUri(final String type, final String aToUri) { | ||||
| if (!isRemoteUri(aToUri)) { | |||||
| if (!isRemoteUri(aToUri)) { | |||||
| throw new BuildException(type + " '" + aToUri + "' is invalid. " | throw new BuildException(type + " '" + aToUri + "' is invalid. " | ||||
| + "The 'remoteToDir' attribute must " | + "The 'remoteToDir' attribute must " | ||||
| + "have syntax like the " | + "have syntax like the " | ||||
| + "following: user:password@host:/path" | + "following: user:password@host:/path" | ||||
| + " - the :password part is optional"); | + " - the :password part is optional"); | ||||
| } | |||||
| } | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -198,7 +198,7 @@ public class Scp extends SSHBase { | |||||
| * @throws BuildException on error | * @throws BuildException on error | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public void init() throws BuildException { | |||||
| public void init() throws BuildException { | |||||
| super.init(); | super.init(); | ||||
| this.toUri = null; | this.toUri = null; | ||||
| this.fromUri = null; | this.fromUri = null; | ||||
| @@ -210,7 +210,7 @@ public class Scp extends SSHBase { | |||||
| * @throws BuildException on error | * @throws BuildException on error | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public void execute() throws BuildException { | |||||
| public void execute() throws BuildException { | |||||
| if (toUri == null) { | if (toUri == null) { | ||||
| throw exactlyOne(TO_ATTRS); | throw exactlyOne(TO_ATTRS); | ||||
| } | } | ||||
| @@ -229,8 +229,8 @@ public class ScpFromMessage extends AbstractSshMessage { | |||||
| } | } | ||||
| private void fetchFile(final File localFile, | private void fetchFile(final File localFile, | ||||
| long filesize, | |||||
| final OutputStream out, | |||||
| long filesize, | |||||
| final OutputStream out, | |||||
| final InputStream in) | final InputStream in) | ||||
| throws IOException, JSchException { | throws IOException, JSchException { | ||||
| final byte[] buf = new byte[BUFFER_SIZE]; | final byte[] buf = new byte[BUFFER_SIZE]; | ||||
| @@ -130,7 +130,7 @@ public class Symlink extends DispatchTask { | |||||
| * @throws BuildException on error. | * @throws BuildException on error. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public void init() throws BuildException { | |||||
| public void init() throws BuildException { | |||||
| super.init(); | super.init(); | ||||
| setDefaults(); | setDefaults(); | ||||
| } | } | ||||
| @@ -140,7 +140,7 @@ public class Symlink extends DispatchTask { | |||||
| * @throws BuildException on error. | * @throws BuildException on error. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public synchronized void execute() throws BuildException { | |||||
| public synchronized void execute() throws BuildException { | |||||
| if (executing) { | if (executing) { | ||||
| throw new BuildException( | throw new BuildException( | ||||
| "Infinite recursion detected in Symlink.execute()"); | "Infinite recursion detected in Symlink.execute()"); | ||||
| @@ -328,7 +328,7 @@ public class Symlink extends DispatchTask { | |||||
| * @param action The action to perform. | * @param action The action to perform. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public void setAction(String action) { | |||||
| public void setAction(String action) { | |||||
| super.setAction(action); | super.setAction(action); | ||||
| } | } | ||||
| @@ -387,7 +387,7 @@ public class Symlink extends DispatchTask { | |||||
| * instead | * instead | ||||
| */ | */ | ||||
| @Deprecated | @Deprecated | ||||
| public static void deleteSymlink(String path) | |||||
| public static void deleteSymlink(String path) | |||||
| throws IOException, FileNotFoundException { | throws IOException, FileNotFoundException { | ||||
| SYMLINK_UTILS.deleteSymbolicLink(new File(path), null); | SYMLINK_UTILS.deleteSymbolicLink(new File(path), null); | ||||
| } | } | ||||
| @@ -421,7 +421,7 @@ public class Symlink extends DispatchTask { | |||||
| * instead | * instead | ||||
| */ | */ | ||||
| @Deprecated | @Deprecated | ||||
| public static void deleteSymlink(File linkfil) | |||||
| public static void deleteSymlink(File linkfil) | |||||
| throws IOException { | throws IOException { | ||||
| SYMLINK_UTILS.deleteSymbolicLink(linkfil, null); | SYMLINK_UTILS.deleteSymbolicLink(linkfil, null); | ||||
| } | } | ||||
| @@ -375,7 +375,7 @@ public class FilterChain extends DataType | |||||
| * @exception BuildException if this instance already has been configured. | * @exception BuildException if this instance already has been configured. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public void setRefid(Reference r) throws BuildException { | |||||
| public void setRefid(Reference r) throws BuildException { | |||||
| if (!filterReaders.isEmpty()) { | if (!filterReaders.isEmpty()) { | ||||
| throw tooManyAttributes(); | throw tooManyAttributes(); | ||||
| } | } | ||||
| @@ -398,7 +398,7 @@ public class FilterChain extends DataType | |||||
| } | } | ||||
| @Override | @Override | ||||
| protected synchronized void dieOnCircularReference(Stack<Object> stk, Project p) | |||||
| protected synchronized void dieOnCircularReference(Stack<Object> stk, Project p) | |||||
| throws BuildException { | throws BuildException { | ||||
| if (isChecked()) { | if (isChecked()) { | ||||
| return; | return; | ||||
| @@ -165,7 +165,7 @@ public class FilterSet extends DataType implements Cloneable { | |||||
| //inherit doc | //inherit doc | ||||
| /** {@inheritDoc}. */ | /** {@inheritDoc}. */ | ||||
| @Override | @Override | ||||
| public String[] getValues() { | |||||
| public String[] getValues() { | |||||
| return VALUES; | return VALUES; | ||||
| } | } | ||||
| } | } | ||||
| @@ -494,7 +494,7 @@ public class FilterSet extends DataType implements Cloneable { | |||||
| * @throws BuildException if the clone cannot be performed. | * @throws BuildException if the clone cannot be performed. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public synchronized Object clone() throws BuildException { | |||||
| public synchronized Object clone() throws BuildException { | |||||
| if (isReference()) { | if (isReference()) { | ||||
| return getRef().clone(); | return getRef().clone(); | ||||
| } | } | ||||
| @@ -186,7 +186,7 @@ public class Permissions { | |||||
| * @param status The exit status requested. | * @param status The exit status requested. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public void checkExit(final int status) { | |||||
| public void checkExit(final int status) { | |||||
| final java.security.Permission perm = new java.lang.RuntimePermission("exitVM", null); | final java.security.Permission perm = new java.lang.RuntimePermission("exitVM", null); | ||||
| try { | try { | ||||
| checkPermission(perm); | checkPermission(perm); | ||||
| @@ -202,7 +202,7 @@ public class Permissions { | |||||
| * @param perm The permission requested. | * @param perm The permission requested. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public void checkPermission(final java.security.Permission perm) { | |||||
| public void checkPermission(final java.security.Permission perm) { | |||||
| if (active) { | if (active) { | ||||
| if (delegateToOldSM && !perm.getName().equals("exitVM")) { | if (delegateToOldSM && !perm.getName().equals("exitVM")) { | ||||
| boolean permOK = false; | boolean permOK = false; | ||||
| @@ -349,7 +349,7 @@ public class Permissions { | |||||
| * @return string description of the permissions. | * @return string description of the permissions. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public String toString() { | |||||
| public String toString() { | |||||
| return ("Permission: " + className + " (\"" + name + "\", \"" + actions + "\")"); | return ("Permission: " + className + " (\"" + name + "\", \"" + actions + "\")"); | ||||
| } | } | ||||
| } | } | ||||
| @@ -46,18 +46,18 @@ public class CutDirsMapper implements FileNameMapper { | |||||
| * Empty implementation. | * Empty implementation. | ||||
| * @param ignore ignored. | * @param ignore ignored. | ||||
| */ | */ | ||||
| public void setFrom(final String ignore) { | |||||
| public void setFrom(final String ignore) { | |||||
| } | } | ||||
| /** | /** | ||||
| * Empty implementation. | * Empty implementation. | ||||
| * @param ignore ignored. | * @param ignore ignored. | ||||
| */ | */ | ||||
| public void setTo(final String ignore) { | |||||
| public void setTo(final String ignore) { | |||||
| } | } | ||||
| /** {@inheritDoc}. */ | /** {@inheritDoc}. */ | ||||
| public String[] mapFileName(final String sourceFileName) { | |||||
| public String[] mapFileName(final String sourceFileName) { | |||||
| if (dirs <= 0) { | if (dirs <= 0) { | ||||
| throw new BuildException("dirs must be set to a positive number"); | throw new BuildException("dirs must be set to a positive number"); | ||||
| } | } | ||||
| @@ -72,7 +72,7 @@ public class Archives extends DataType | |||||
| /** | /** | ||||
| * Sums the sizes of nested archives. | * Sums the sizes of nested archives. | ||||
| */ | */ | ||||
| public int size() { | |||||
| public int size() { | |||||
| if (isReference()) { | if (isReference()) { | ||||
| return ((Archives) getCheckedRef()).size(); | return ((Archives) getCheckedRef()).size(); | ||||
| } | } | ||||
| @@ -87,7 +87,7 @@ public class Archives extends DataType | |||||
| /** | /** | ||||
| * Merges the nested collections. | * Merges the nested collections. | ||||
| */ | */ | ||||
| public Iterator<Resource> iterator() { | |||||
| public Iterator<Resource> iterator() { | |||||
| if (isReference()) { | if (isReference()) { | ||||
| return ((Archives) getCheckedRef()).iterator(); | return ((Archives) getCheckedRef()).iterator(); | ||||
| } | } | ||||
| @@ -103,7 +103,7 @@ public class Archives extends DataType | |||||
| /** | /** | ||||
| * @return false | * @return false | ||||
| */ | */ | ||||
| public boolean isFilesystemOnly() { | |||||
| public boolean isFilesystemOnly() { | |||||
| if (isReference()) { | if (isReference()) { | ||||
| return ((Archives) getCheckedRef()).isFilesystemOnly(); | return ((Archives) getCheckedRef()).isFilesystemOnly(); | ||||
| } | } | ||||
| @@ -116,7 +116,7 @@ public class Archives extends DataType | |||||
| * @param r the Reference to set. | * @param r the Reference to set. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public void setRefid(final Reference r) { | |||||
| public void setRefid(final Reference r) { | |||||
| if (zips.getResourceCollections().size() > 0 | if (zips.getResourceCollections().size() > 0 | ||||
| || tars.getResourceCollections().size() > 0) { | || tars.getResourceCollections().size() > 0) { | ||||
| throw tooManyAttributes(); | throw tooManyAttributes(); | ||||
| @@ -130,7 +130,7 @@ public class Archives extends DataType | |||||
| * @return a cloned instance. | * @return a cloned instance. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public Object clone() { | |||||
| public Object clone() { | |||||
| try { | try { | ||||
| final Archives a = (Archives) super.clone(); | final Archives a = (Archives) super.clone(); | ||||
| a.zips = (Union) zips.clone(); | a.zips = (Union) zips.clone(); | ||||
| @@ -177,7 +177,7 @@ public class Archives extends DataType | |||||
| * @throws BuildException on error. | * @throws BuildException on error. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| protected synchronized void dieOnCircularReference(final Stack<Object> stk, final Project p) | |||||
| protected synchronized void dieOnCircularReference(final Stack<Object> stk, final Project p) | |||||
| throws BuildException { | throws BuildException { | ||||
| if (isChecked()) { | if (isChecked()) { | ||||
| return; | return; | ||||
| @@ -191,4 +191,4 @@ public class Archives extends DataType | |||||
| } | } | ||||
| } | } | ||||
| } | |||||
| } | |||||
| @@ -56,7 +56,7 @@ public abstract class ContentTransformingResource extends ResourceDecorator { | |||||
| * compatibility with java.io.File), or UNKNOWN_SIZE if not known. | * compatibility with java.io.File), or UNKNOWN_SIZE if not known. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public long getSize() { | |||||
| public long getSize() { | |||||
| if (isExists()) { | if (isExists()) { | ||||
| InputStream in = null; | InputStream in = null; | ||||
| try { | try { | ||||
| @@ -88,7 +88,7 @@ public abstract class ContentTransformingResource extends ResourceDecorator { | |||||
| * supported for this Resource type. | * supported for this Resource type. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public InputStream getInputStream() throws IOException { | |||||
| public InputStream getInputStream() throws IOException { | |||||
| InputStream in = getResource().getInputStream(); | InputStream in = getResource().getInputStream(); | ||||
| if (in != null) { | if (in != null) { | ||||
| in = wrapStream(in); | in = wrapStream(in); | ||||
| @@ -105,7 +105,7 @@ public abstract class ContentTransformingResource extends ResourceDecorator { | |||||
| * supported for this Resource type. | * supported for this Resource type. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public OutputStream getOutputStream() throws IOException { | |||||
| public OutputStream getOutputStream() throws IOException { | |||||
| OutputStream out = getResource().getOutputStream(); | OutputStream out = getResource().getOutputStream(); | ||||
| if (out != null) { | if (out != null) { | ||||
| out = wrapStream(out); | out = wrapStream(out); | ||||
| @@ -117,14 +117,14 @@ public abstract class ContentTransformingResource extends ResourceDecorator { | |||||
| * Suppress FileProvider, re-implement Appendable | * Suppress FileProvider, re-implement Appendable | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public <T> T as(final Class<T> clazz) { | |||||
| public <T> T as(final Class<T> clazz) { | |||||
| if (Appendable.class.isAssignableFrom(clazz)) { | if (Appendable.class.isAssignableFrom(clazz)) { | ||||
| if (isAppendSupported()) { | if (isAppendSupported()) { | ||||
| final Appendable a = | final Appendable a = | ||||
| getResource().as(Appendable.class); | getResource().as(Appendable.class); | ||||
| if (a != null) { | if (a != null) { | ||||
| return clazz.cast(new Appendable() { | return clazz.cast(new Appendable() { | ||||
| public OutputStream getAppendOutputStream() | |||||
| public OutputStream getAppendOutputStream() | |||||
| throws IOException { | throws IOException { | ||||
| OutputStream out = a.getAppendOutputStream(); | OutputStream out = a.getAppendOutputStream(); | ||||
| if (out != null) { | if (out != null) { | ||||
| @@ -37,7 +37,7 @@ public class LazyResourceCollectionWrapper extends | |||||
| private FilteringIterator filteringIterator; | private FilteringIterator filteringIterator; | ||||
| @Override | @Override | ||||
| protected Iterator<Resource> createIterator() { | |||||
| protected Iterator<Resource> createIterator() { | |||||
| Iterator<Resource> iterator; | Iterator<Resource> iterator; | ||||
| if (isCache()) { | if (isCache()) { | ||||
| if (filteringIterator == null) { | if (filteringIterator == null) { | ||||
| @@ -53,7 +53,7 @@ public class LazyResourceCollectionWrapper extends | |||||
| } | } | ||||
| @Override | @Override | ||||
| protected int getSize() { | |||||
| protected int getSize() { | |||||
| // to compute the size, just iterate: the iterator will take care of | // to compute the size, just iterate: the iterator will take care of | ||||
| // caching | // caching | ||||
| final Iterator<Resource> it = createIterator(); | final Iterator<Resource> it = createIterator(); | ||||
| @@ -88,7 +88,7 @@ public class LazyResourceCollectionWrapper extends | |||||
| this.it = it; | this.it = it; | ||||
| } | } | ||||
| public boolean hasNext() { | |||||
| public boolean hasNext() { | |||||
| if (ended) { | if (ended) { | ||||
| return false; | return false; | ||||
| } | } | ||||
| @@ -105,7 +105,7 @@ public class LazyResourceCollectionWrapper extends | |||||
| return true; | return true; | ||||
| } | } | ||||
| public Resource next() { | |||||
| public Resource next() { | |||||
| if (!hasNext()) { | if (!hasNext()) { | ||||
| throw new UnsupportedOperationException(); | throw new UnsupportedOperationException(); | ||||
| } | } | ||||
| @@ -114,7 +114,7 @@ public class LazyResourceCollectionWrapper extends | |||||
| return r; | return r; | ||||
| } | } | ||||
| public void remove() { | |||||
| public void remove() { | |||||
| throw new UnsupportedOperationException(); | throw new UnsupportedOperationException(); | ||||
| } | } | ||||
| } | } | ||||
| @@ -140,7 +140,7 @@ public class LazyResourceCollectionWrapper extends | |||||
| this.it = it; | this.it = it; | ||||
| } | } | ||||
| public boolean hasNext() { | |||||
| public boolean hasNext() { | |||||
| synchronized (cachedResources) { | synchronized (cachedResources) { | ||||
| // have we already cached the next entry ? | // have we already cached the next entry ? | ||||
| if (cachedResources.size() > cusrsor) { | if (cachedResources.size() > cusrsor) { | ||||
| @@ -157,7 +157,7 @@ public class LazyResourceCollectionWrapper extends | |||||
| return true; | return true; | ||||
| } | } | ||||
| public Resource next() { | |||||
| public Resource next() { | |||||
| // first check that we have some to deliver | // first check that we have some to deliver | ||||
| if (!hasNext()) { | if (!hasNext()) { | ||||
| throw new NoSuchElementException(); | throw new NoSuchElementException(); | ||||
| @@ -169,7 +169,7 @@ public class LazyResourceCollectionWrapper extends | |||||
| } | } | ||||
| } | } | ||||
| public void remove() { | |||||
| public void remove() { | |||||
| throw new UnsupportedOperationException(); | throw new UnsupportedOperationException(); | ||||
| } | } | ||||
| } | } | ||||
| @@ -47,7 +47,7 @@ public class MappedResource extends ResourceDecorator { | |||||
| * Maps the name. | * Maps the name. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public String getName() { | |||||
| public String getName() { | |||||
| String name = getResource().getName(); | String name = getResource().getName(); | ||||
| if (isReference()) { | if (isReference()) { | ||||
| return name; | return name; | ||||
| @@ -61,7 +61,7 @@ public class MappedResource extends ResourceDecorator { | |||||
| * @param r reference to set | * @param r reference to set | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public void setRefid(Reference r) { | |||||
| public void setRefid(Reference r) { | |||||
| if (mapper != null) { | if (mapper != null) { | ||||
| throw noChildrenAllowed(); | throw noChildrenAllowed(); | ||||
| } | } | ||||
| @@ -73,7 +73,7 @@ public class MappedResource extends ResourceDecorator { | |||||
| * @param clazz the type to implement | * @param clazz the type to implement | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public <T> T as(Class<T> clazz) { | |||||
| public <T> T as(Class<T> clazz) { | |||||
| return FileProvider.class.isAssignableFrom(clazz) | return FileProvider.class.isAssignableFrom(clazz) | ||||
| ? null : getResource().as(clazz); | ? null : getResource().as(clazz); | ||||
| } | } | ||||
| @@ -83,7 +83,7 @@ public class MappedResource extends ResourceDecorator { | |||||
| * @since Ant 1.8.1 | * @since Ant 1.8.1 | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public int hashCode() { | |||||
| public int hashCode() { | |||||
| String n = getName(); | String n = getName(); | ||||
| return n == null ? super.hashCode() : n.hashCode(); | return n == null ? super.hashCode() : n.hashCode(); | ||||
| } | } | ||||
| @@ -94,7 +94,7 @@ public class MappedResource extends ResourceDecorator { | |||||
| * @since Ant 1.8.1 | * @since Ant 1.8.1 | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public boolean equals(Object other) { | |||||
| public boolean equals(Object other) { | |||||
| if (other == null || !other.getClass().equals(getClass())) { | if (other == null || !other.getClass().equals(getClass())) { | ||||
| return false; | return false; | ||||
| } | } | ||||
| @@ -106,7 +106,7 @@ public class MappedResource extends ResourceDecorator { | |||||
| } | } | ||||
| @Override | @Override | ||||
| public String toString() { | |||||
| public String toString() { | |||||
| if (isReference()) { | if (isReference()) { | ||||
| return getCheckedRef().toString(); | return getCheckedRef().toString(); | ||||
| } | } | ||||
| @@ -44,7 +44,7 @@ public class MultiRootFileSet extends AbstractFileSet | |||||
| private Union union; | private Union union; | ||||
| @Override | @Override | ||||
| public void setDir(final File dir) { | |||||
| public void setDir(final File dir) { | |||||
| throw new BuildException(getDataTypeName() | throw new BuildException(getDataTypeName() | ||||
| + " doesn't support the dir attribute"); | + " doesn't support the dir attribute"); | ||||
| } | } | ||||
| @@ -98,7 +98,7 @@ public class MultiRootFileSet extends AbstractFileSet | |||||
| } | } | ||||
| @Override | @Override | ||||
| public void setRefid(final Reference r) { | |||||
| public void setRefid(final Reference r) { | |||||
| if (!baseDirs.isEmpty()) { | if (!baseDirs.isEmpty()) { | ||||
| throw tooManyAttributes(); | throw tooManyAttributes(); | ||||
| } | } | ||||
| @@ -111,7 +111,7 @@ public class MultiRootFileSet extends AbstractFileSet | |||||
| * @return the cloned MultiRootFileSet. | * @return the cloned MultiRootFileSet. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public Object clone() { | |||||
| public Object clone() { | |||||
| if (isReference()) { | if (isReference()) { | ||||
| return ((MultiRootFileSet) getRef(getProject())).clone(); | return ((MultiRootFileSet) getRef(getProject())).clone(); | ||||
| } else { | } else { | ||||
| @@ -126,7 +126,7 @@ public class MultiRootFileSet extends AbstractFileSet | |||||
| * Fulfill the ResourceCollection contract. | * Fulfill the ResourceCollection contract. | ||||
| * @return an Iterator of Resources. | * @return an Iterator of Resources. | ||||
| */ | */ | ||||
| public Iterator<Resource> iterator() { | |||||
| public Iterator<Resource> iterator() { | |||||
| if (isReference()) { | if (isReference()) { | ||||
| return ((MultiRootFileSet) getRef(getProject())).iterator(); | return ((MultiRootFileSet) getRef(getProject())).iterator(); | ||||
| } | } | ||||
| @@ -137,7 +137,7 @@ public class MultiRootFileSet extends AbstractFileSet | |||||
| * Fulfill the ResourceCollection contract. | * Fulfill the ResourceCollection contract. | ||||
| * @return number of elements as int. | * @return number of elements as int. | ||||
| */ | */ | ||||
| public int size() { | |||||
| public int size() { | |||||
| if (isReference()) { | if (isReference()) { | ||||
| return ((MultiRootFileSet) getRef(getProject())).size(); | return ((MultiRootFileSet) getRef(getProject())).size(); | ||||
| } | } | ||||
| @@ -148,7 +148,7 @@ public class MultiRootFileSet extends AbstractFileSet | |||||
| * Always returns true. | * Always returns true. | ||||
| * @return true indicating that all elements will be FileResources. | * @return true indicating that all elements will be FileResources. | ||||
| */ | */ | ||||
| public boolean isFilesystemOnly() { | |||||
| public boolean isFilesystemOnly() { | |||||
| return true; | return true; | ||||
| } | } | ||||
| @@ -158,7 +158,7 @@ public class MultiRootFileSet extends AbstractFileSet | |||||
| * @return a <code>String</code> of included directories. | * @return a <code>String</code> of included directories. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public String toString() { | |||||
| public String toString() { | |||||
| if (isReference()) { | if (isReference()) { | ||||
| return ((MultiRootFileSet) getRef(getProject())).toString(); | return ((MultiRootFileSet) getRef(getProject())).toString(); | ||||
| } | } | ||||
| @@ -201,11 +201,11 @@ public class MultiRootFileSet extends AbstractFileSet | |||||
| setDir(dir); | setDir(dir); | ||||
| } | } | ||||
| public boolean isFilesystemOnly() { | |||||
| public boolean isFilesystemOnly() { | |||||
| return true; | return true; | ||||
| } | } | ||||
| public Iterator<Resource> iterator() { | |||||
| public Iterator<Resource> iterator() { | |||||
| final DirectoryScanner ds = getDirectoryScanner(getProject()); | final DirectoryScanner ds = getDirectoryScanner(getProject()); | ||||
| String[] names = type == SetType.file | String[] names = type == SetType.file | ||||
| ? ds.getIncludedFiles() | ? ds.getIncludedFiles() | ||||
| @@ -221,7 +221,7 @@ public class MultiRootFileSet extends AbstractFileSet | |||||
| names); | names); | ||||
| } | } | ||||
| public int size() { | |||||
| public int size() { | |||||
| final DirectoryScanner ds = getDirectoryScanner(getProject()); | final DirectoryScanner ds = getDirectoryScanner(getProject()); | ||||
| int count = type == SetType.file | int count = type == SetType.file | ||||
| ? ds.getIncludedFilesCount() | ? ds.getIncludedFilesCount() | ||||
| @@ -65,7 +65,7 @@ public class Type implements ResourceSelector { | |||||
| * @return a String array. | * @return a String array. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public String[] getValues() { | |||||
| public String[] getValues() { | |||||
| return VALUES; | return VALUES; | ||||
| } | } | ||||
| } | } | ||||
| @@ -99,7 +99,7 @@ public class Type implements ResourceSelector { | |||||
| * @param r the Resource to check. | * @param r the Resource to check. | ||||
| * @return whether the Resource was selected. | * @return whether the Resource was selected. | ||||
| */ | */ | ||||
| public boolean isSelected(final Resource r) { | |||||
| public boolean isSelected(final Resource r) { | |||||
| if (type == null) { | if (type == null) { | ||||
| throw new BuildException("The type attribute is required."); | throw new BuildException("The type attribute is required."); | ||||
| } | } | ||||
| @@ -94,7 +94,7 @@ public abstract class MappingSelector extends BaseSelector { | |||||
| * means that the dest attribute has been set and we have a mapper. | * means that the dest attribute has been set and we have a mapper. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public void verifySettings() { | |||||
| public void verifySettings() { | |||||
| if (targetdir == null) { | if (targetdir == null) { | ||||
| setError("The targetdir attribute is required."); | setError("The targetdir attribute is required."); | ||||
| } | } | ||||
| @@ -120,7 +120,7 @@ public abstract class MappingSelector extends BaseSelector { | |||||
| * @return whether the file should be selected or not | * @return whether the file should be selected or not | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public boolean isSelected(File basedir, String filename, File file) { | |||||
| public boolean isSelected(File basedir, String filename, File file) { | |||||
| // throw BuildException on error | // throw BuildException on error | ||||
| validate(); | validate(); | ||||
| @@ -52,7 +52,7 @@ public class PresentSelector extends BaseSelector { | |||||
| * @return a string describing this object | * @return a string describing this object | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public String toString() { | |||||
| public String toString() { | |||||
| final StringBuilder buf = new StringBuilder("{presentselector targetdir: "); | final StringBuilder buf = new StringBuilder("{presentselector targetdir: "); | ||||
| if (targetdir == null) { | if (targetdir == null) { | ||||
| buf.append("NOT YET SET"); | buf.append("NOT YET SET"); | ||||
| @@ -133,7 +133,7 @@ public class PresentSelector extends BaseSelector { | |||||
| * means that the targetdir attribute has been set and we have a mapper. | * means that the targetdir attribute has been set and we have a mapper. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public void verifySettings() { | |||||
| public void verifySettings() { | |||||
| if (targetdir == null) { | if (targetdir == null) { | ||||
| setError("The targetdir attribute is required."); | setError("The targetdir attribute is required."); | ||||
| } | } | ||||
| @@ -159,7 +159,7 @@ public class PresentSelector extends BaseSelector { | |||||
| * @return whether the file should be selected or not | * @return whether the file should be selected or not | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public boolean isSelected(final File basedir, final String filename, final File file) { | |||||
| public boolean isSelected(final File basedir, final String filename, final File file) { | |||||
| // throw BuildException on error | // throw BuildException on error | ||||
| validate(); | validate(); | ||||
| @@ -190,7 +190,7 @@ public class PresentSelector extends BaseSelector { | |||||
| * @return the values as an array of strings | * @return the values as an array of strings | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public String[] getValues() { | |||||
| public String[] getValues() { | |||||
| return new String[] {"srconly", "both"}; | return new String[] {"srconly", "both"}; | ||||
| } | } | ||||
| } | } | ||||
| @@ -87,7 +87,7 @@ public class TokenizedPath { | |||||
| * @return The original path String | * @return The original path String | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public String toString() { | |||||
| public String toString() { | |||||
| return path; | return path; | ||||
| } | } | ||||
| @@ -162,13 +162,13 @@ public class TokenizedPath { | |||||
| * true if the original paths are equal. | * true if the original paths are equal. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public boolean equals(Object o) { | |||||
| public boolean equals(Object o) { | |||||
| return o instanceof TokenizedPath | return o instanceof TokenizedPath | ||||
| && path.equals(((TokenizedPath) o).path); | && path.equals(((TokenizedPath) o).path); | ||||
| } | } | ||||
| @Override | @Override | ||||
| public int hashCode() { | |||||
| public int hashCode() { | |||||
| return path.hashCode(); | return path.hashCode(); | ||||
| } | } | ||||
| @@ -139,7 +139,7 @@ public class LayoutPreservingProperties extends Properties { | |||||
| } | } | ||||
| @Override | @Override | ||||
| public void load(final InputStream inStream) throws IOException { | |||||
| public void load(final InputStream inStream) throws IOException { | |||||
| final String s = readLines(inStream); | final String s = readLines(inStream); | ||||
| final byte[] ba = s.getBytes(ResourceUtils.ISO_8859_1); | final byte[] ba = s.getBytes(ResourceUtils.ISO_8859_1); | ||||
| final ByteArrayInputStream bais = new ByteArrayInputStream(ba); | final ByteArrayInputStream bais = new ByteArrayInputStream(ba); | ||||
| @@ -147,7 +147,7 @@ public class LayoutPreservingProperties extends Properties { | |||||
| } | } | ||||
| @Override | @Override | ||||
| public Object put(final Object key, final Object value) throws NullPointerException { | |||||
| public Object put(final Object key, final Object value) throws NullPointerException { | |||||
| final Object obj = super.put(key, value); | final Object obj = super.put(key, value); | ||||
| // the above call will have failed if key or value are null | // the above call will have failed if key or value are null | ||||
| innerSetProperty(key.toString(), value.toString()); | innerSetProperty(key.toString(), value.toString()); | ||||
| @@ -155,7 +155,7 @@ public class LayoutPreservingProperties extends Properties { | |||||
| } | } | ||||
| @Override | @Override | ||||
| public Object setProperty(final String key, final String value) | |||||
| public Object setProperty(final String key, final String value) | |||||
| throws NullPointerException { | throws NullPointerException { | ||||
| final Object obj = super.setProperty(key, value); | final Object obj = super.setProperty(key, value); | ||||
| // the above call will have failed if key or value are null | // the above call will have failed if key or value are null | ||||
| @@ -188,14 +188,14 @@ public class LayoutPreservingProperties extends Properties { | |||||
| } | } | ||||
| @Override | @Override | ||||
| public void clear() { | |||||
| public void clear() { | |||||
| super.clear(); | super.clear(); | ||||
| keyedPairLines.clear(); | keyedPairLines.clear(); | ||||
| logicalLines.clear(); | logicalLines.clear(); | ||||
| } | } | ||||
| @Override | @Override | ||||
| public Object remove(final Object key) { | |||||
| public Object remove(final Object key) { | |||||
| final Object obj = super.remove(key); | final Object obj = super.remove(key); | ||||
| final Integer i = (Integer) keyedPairLines.remove(key); | final Integer i = (Integer) keyedPairLines.remove(key); | ||||
| if (null != i) { | if (null != i) { | ||||
| @@ -208,7 +208,7 @@ public class LayoutPreservingProperties extends Properties { | |||||
| } | } | ||||
| @Override | @Override | ||||
| public Object clone() { | |||||
| public Object clone() { | |||||
| final LayoutPreservingProperties dolly = | final LayoutPreservingProperties dolly = | ||||
| (LayoutPreservingProperties) super.clone(); | (LayoutPreservingProperties) super.clone(); | ||||
| dolly.keyedPairLines = (HashMap) this.keyedPairLines.clone(); | dolly.keyedPairLines = (HashMap) this.keyedPairLines.clone(); | ||||
| @@ -256,7 +256,7 @@ public class LayoutPreservingProperties extends Properties { | |||||
| } | } | ||||
| @Override | @Override | ||||
| public void store(final OutputStream out, final String header) throws IOException { | |||||
| public void store(final OutputStream out, final String header) throws IOException { | |||||
| final OutputStreamWriter osw = new OutputStreamWriter(out, ResourceUtils.ISO_8859_1); | final OutputStreamWriter osw = new OutputStreamWriter(out, ResourceUtils.ISO_8859_1); | ||||
| int skipLines = 0; | int skipLines = 0; | ||||
| @@ -630,7 +630,7 @@ public class LayoutPreservingProperties extends Properties { | |||||
| } | } | ||||
| @Override | @Override | ||||
| public String toString() { | |||||
| public String toString() { | |||||
| return text; | return text; | ||||
| } | } | ||||
| } | } | ||||
| @@ -694,7 +694,7 @@ public class LayoutPreservingProperties extends Properties { | |||||
| } | } | ||||
| @Override | @Override | ||||
| public Object clone() { | |||||
| public Object clone() { | |||||
| Object dolly = null; | Object dolly = null; | ||||
| try { | try { | ||||
| dolly = super.clone(); | dolly = super.clone(); | ||||
| @@ -51,7 +51,7 @@ public abstract class LineOrientedOutputStream extends OutputStream { | |||||
| * @throws IOException if there is an error. | * @throws IOException if there is an error. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public final void write(int cc) throws IOException { | |||||
| public final void write(int cc) throws IOException { | |||||
| final byte c = (byte) cc; | final byte c = (byte) cc; | ||||
| if ((c == LF) || (c == CR)) { | if ((c == LF) || (c == CR)) { | ||||
| if (!skip) { | if (!skip) { | ||||
| @@ -68,7 +68,7 @@ public abstract class LineOrientedOutputStream extends OutputStream { | |||||
| * @throws IOException if there is an error. | * @throws IOException if there is an error. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public void flush() throws IOException { | |||||
| public void flush() throws IOException { | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -114,7 +114,7 @@ public abstract class LineOrientedOutputStream extends OutputStream { | |||||
| * @throws IOException if there is an error. | * @throws IOException if there is an error. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public void close() throws IOException { | |||||
| public void close() throws IOException { | |||||
| if (buffer.size() > 0) { | if (buffer.size() > 0) { | ||||
| processBuffer(); | processBuffer(); | ||||
| } | } | ||||
| @@ -131,7 +131,7 @@ public abstract class LineOrientedOutputStream extends OutputStream { | |||||
| * @throws IOException if the data cannot be written into the stream. | * @throws IOException if the data cannot be written into the stream. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public final void write(byte[] b, int off, int len) throws IOException { | |||||
| public final void write(byte[] b, int off, int len) throws IOException { | |||||
| // find the line breaks and pass other chars through in blocks | // find the line breaks and pass other chars through in blocks | ||||
| int offset = off; | int offset = off; | ||||
| int blockStartOffset = offset; | int blockStartOffset = offset; | ||||
| @@ -44,24 +44,24 @@ public class LineOrientedOutputStreamRedirector | |||||
| } | } | ||||
| @Override | @Override | ||||
| protected void processLine(byte[] b) throws IOException { | |||||
| protected void processLine(byte[] b) throws IOException { | |||||
| stream.write(b); | stream.write(b); | ||||
| stream.write(EOL); | stream.write(EOL); | ||||
| } | } | ||||
| @Override | @Override | ||||
| protected void processLine(String line) throws IOException { | |||||
| protected void processLine(String line) throws IOException { | |||||
| stream.write((line + System.getProperty("line.separator")).getBytes()); | stream.write((line + System.getProperty("line.separator")).getBytes()); | ||||
| } | } | ||||
| @Override | @Override | ||||
| public void close() throws IOException { | |||||
| public void close() throws IOException { | |||||
| super.close(); | super.close(); | ||||
| stream.close(); | stream.close(); | ||||
| } | } | ||||
| @Override | @Override | ||||
| public void flush() throws IOException { | |||||
| public void flush() throws IOException { | |||||
| super.flush(); | super.flush(); | ||||
| stream.flush(); | stream.flush(); | ||||
| } | } | ||||
| @@ -25,10 +25,10 @@ import java.lang.management.ManagementFactory; | |||||
| */ | */ | ||||
| public class ProcessUtil { | public class ProcessUtil { | ||||
| private ProcessUtil() { | |||||
| } | |||||
| private ProcessUtil() { | |||||
| } | |||||
| /** | |||||
| /** | |||||
| * provide id of the current process | * provide id of the current process | ||||
| * @param fallback | * @param fallback | ||||
| * @return current process id | * @return current process id | ||||
| @@ -57,9 +57,9 @@ public class ProcessUtil { | |||||
| public static void main(String [] args) { | public static void main(String [] args) { | ||||
| System.out.println(getProcessId("<PID>")); | System.out.println(getProcessId("<PID>")); | ||||
| try { | try { | ||||
| Thread.sleep(120000); | |||||
| Thread.sleep(120000); | |||||
| } catch (Exception exc) { | } catch (Exception exc) { | ||||
| // ignore | |||||
| // ignore | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -145,10 +145,10 @@ public class ResourceUtils { | |||||
| logFuture(logTo, source, granularity); | logFuture(logTo, source, granularity); | ||||
| final ResourceSelectorProvider p = | final ResourceSelectorProvider p = | ||||
| new ResourceSelectorProvider() { | new ResourceSelectorProvider() { | ||||
| public ResourceSelector | |||||
| public ResourceSelector | |||||
| getTargetSelectorForSource(final Resource sr) { | getTargetSelectorForSource(final Resource sr) { | ||||
| return new ResourceSelector() { | return new ResourceSelector() { | ||||
| public boolean isSelected(final Resource target) { | |||||
| public boolean isSelected(final Resource target) { | |||||
| /* Extra I/O, probably wasted: | /* Extra I/O, probably wasted: | ||||
| if (target.isDirectory()) { | if (target.isDirectory()) { | ||||
| return false; | return false; | ||||
| @@ -842,9 +842,9 @@ public class ResourceUtils { | |||||
| * @since Ant 1.9.4 | * @since Ant 1.9.4 | ||||
| */ | */ | ||||
| public static class ReadOnlyTargetFileException extends IOException { | public static class ReadOnlyTargetFileException extends IOException { | ||||
| private static final long serialVersionUID = 1L; | |||||
| private static final long serialVersionUID = 1L; | |||||
| public ReadOnlyTargetFileException(final File destFile) { | |||||
| public ReadOnlyTargetFileException(final File destFile) { | |||||
| super("can't write to read-only destination file " + destFile); | super("can't write to read-only destination file " + destFile); | ||||
| } | } | ||||
| } | } | ||||
| @@ -177,7 +177,7 @@ public class SymbolicLinkUtils { | |||||
| if (!f.exists()) { | if (!f.exists()) { | ||||
| final String localName = f.getName(); | final String localName = f.getName(); | ||||
| final String[] c = parent.list(new FilenameFilter() { | final String[] c = parent.list(new FilenameFilter() { | ||||
| public boolean accept(final File d, final String n) { | |||||
| public boolean accept(final File d, final String n) { | |||||
| return localName.equals(n); | return localName.equals(n); | ||||
| } | } | ||||
| }); | }); | ||||
| @@ -293,4 +293,4 @@ public class SymbolicLinkUtils { | |||||
| } | } | ||||
| } | } | ||||
| } | |||||
| } | |||||
| @@ -24,23 +24,23 @@ package org.apache.tools.ant.util; | |||||
| */ | */ | ||||
| public class UnicodeUtil { | public class UnicodeUtil { | ||||
| private UnicodeUtil() { | |||||
| } | |||||
| private UnicodeUtil() { | |||||
| } | |||||
| /** | |||||
| * returns the unicode representation of a char without the leading backslash | |||||
| * @param ch | |||||
| * @return unicode representation of a char for property files | |||||
| */ | |||||
| public static StringBuffer EscapeUnicode(char ch) { | |||||
| StringBuffer unicodeBuf = new StringBuffer("u0000"); | |||||
| String s = Integer.toHexString(ch); | |||||
| //replace the last 0s by the chars contained in s | |||||
| for (int i = 0; i < s.length(); i++) { | |||||
| unicodeBuf.setCharAt(unicodeBuf.length() | |||||
| - s.length() + i, | |||||
| s.charAt(i)); | |||||
| } | |||||
| return unicodeBuf; | |||||
| } | |||||
| /** | |||||
| * returns the unicode representation of a char without the leading backslash | |||||
| * @param ch | |||||
| * @return unicode representation of a char for property files | |||||
| */ | |||||
| public static StringBuffer EscapeUnicode(char ch) { | |||||
| StringBuffer unicodeBuf = new StringBuffer("u0000"); | |||||
| String s = Integer.toHexString(ch); | |||||
| //replace the last 0s by the chars contained in s | |||||
| for (int i = 0; i < s.length(); i++) { | |||||
| unicodeBuf.setCharAt(unicodeBuf.length() | |||||
| - s.length() + i, | |||||
| s.charAt(i)); | |||||
| } | |||||
| return unicodeBuf; | |||||
| } | |||||
| } | } | ||||
| @@ -28,8 +28,8 @@ package org.apache.tools.ant.util; | |||||
| public class XmlConstants { | public class XmlConstants { | ||||
| private XmlConstants() { | |||||
| } | |||||
| private XmlConstants() { | |||||
| } | |||||
| /** property for location of xml schema */ | /** property for location of xml schema */ | ||||
| public static final String PROPERTY_SCHEMA_LOCATION = | public static final String PROPERTY_SCHEMA_LOCATION = | ||||
| @@ -912,7 +912,7 @@ public class TarEntry implements TarConstants { | |||||
| int offset = 0; | int offset = 0; | ||||
| name = oldStyle ? TarUtils.parseName(header, offset, NAMELEN) | name = oldStyle ? TarUtils.parseName(header, offset, NAMELEN) | ||||
| : TarUtils.parseName(header, offset, NAMELEN, encoding); | |||||
| : TarUtils.parseName(header, offset, NAMELEN, encoding); | |||||
| offset += NAMELEN; | offset += NAMELEN; | ||||
| mode = (int) TarUtils.parseOctalOrBinary(header, offset, MODELEN); | mode = (int) TarUtils.parseOctalOrBinary(header, offset, MODELEN); | ||||
| offset += MODELEN; | offset += MODELEN; | ||||
| @@ -378,7 +378,7 @@ public class TarOutputStream extends FilterOutputStream { | |||||
| * @throws IOException on error | * @throws IOException on error | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public void write(byte[] wBuf) throws IOException { | |||||
| public void write(byte[] wBuf) throws IOException { | |||||
| write(wBuf, 0, wBuf.length); | write(wBuf, 0, wBuf.length); | ||||
| } | } | ||||
| @@ -46,9 +46,9 @@ public class TarUtils { | |||||
| * Encapsulates the algorithms used up to Ant 1.8 as ZipEncoding. | * Encapsulates the algorithms used up to Ant 1.8 as ZipEncoding. | ||||
| */ | */ | ||||
| static final ZipEncoding FALLBACK_ENCODING = new ZipEncoding() { | static final ZipEncoding FALLBACK_ENCODING = new ZipEncoding() { | ||||
| public boolean canEncode(final String name) { return true; } | |||||
| public boolean canEncode(final String name) { return true; } | |||||
| public ByteBuffer encode(final String name) { | |||||
| public ByteBuffer encode(final String name) { | |||||
| final int length = name.length(); | final int length = name.length(); | ||||
| final byte[] buf = new byte[length]; | final byte[] buf = new byte[length]; | ||||
| @@ -59,7 +59,7 @@ public class TarUtils { | |||||
| return ByteBuffer.wrap(buf); | return ByteBuffer.wrap(buf); | ||||
| } | } | ||||
| public String decode(final byte[] buffer) { | |||||
| public String decode(final byte[] buffer) { | |||||
| final int length = buffer.length; | final int length = buffer.length; | ||||
| final StringBuilder result = new StringBuilder(length); | final StringBuilder result = new StringBuilder(length); | ||||
| @@ -128,7 +128,7 @@ public abstract class AbstractUnicodeExtraField implements ZipExtraField { | |||||
| } | } | ||||
| /** {@inheritDoc} */ | /** {@inheritDoc} */ | ||||
| public byte[] getCentralDirectoryData() { | |||||
| public byte[] getCentralDirectoryData() { | |||||
| if (data == null) { | if (data == null) { | ||||
| this.assembleData(); | this.assembleData(); | ||||
| } | } | ||||
| @@ -141,7 +141,7 @@ public abstract class AbstractUnicodeExtraField implements ZipExtraField { | |||||
| } | } | ||||
| /** {@inheritDoc} */ | /** {@inheritDoc} */ | ||||
| public ZipShort getCentralDirectoryLength() { | |||||
| public ZipShort getCentralDirectoryLength() { | |||||
| if (data == null) { | if (data == null) { | ||||
| assembleData(); | assembleData(); | ||||
| } | } | ||||
| @@ -149,17 +149,17 @@ public abstract class AbstractUnicodeExtraField implements ZipExtraField { | |||||
| } | } | ||||
| /** {@inheritDoc} */ | /** {@inheritDoc} */ | ||||
| public byte[] getLocalFileDataData() { | |||||
| public byte[] getLocalFileDataData() { | |||||
| return getCentralDirectoryData(); | return getCentralDirectoryData(); | ||||
| } | } | ||||
| /** {@inheritDoc} */ | /** {@inheritDoc} */ | ||||
| public ZipShort getLocalFileDataLength() { | |||||
| public ZipShort getLocalFileDataLength() { | |||||
| return getCentralDirectoryLength(); | return getCentralDirectoryLength(); | ||||
| } | } | ||||
| /** {@inheritDoc} */ | /** {@inheritDoc} */ | ||||
| public void parseFromLocalFileData(final byte[] buffer, final int offset, final int length) | |||||
| public void parseFromLocalFileData(final byte[] buffer, final int offset, final int length) | |||||
| throws ZipException { | throws ZipException { | ||||
| if (length < 5) { | if (length < 5) { | ||||
| @@ -64,7 +64,7 @@ class FallbackZipEncoding implements ZipEncoding { | |||||
| * @see | * @see | ||||
| * org.apache.tools.zip.ZipEncoding#canEncode(java.lang.String) | * org.apache.tools.zip.ZipEncoding#canEncode(java.lang.String) | ||||
| */ | */ | ||||
| public boolean canEncode(final String name) { | |||||
| public boolean canEncode(final String name) { | |||||
| return true; | return true; | ||||
| } | } | ||||
| @@ -72,7 +72,7 @@ class FallbackZipEncoding implements ZipEncoding { | |||||
| * @see | * @see | ||||
| * org.apache.tools.zip.ZipEncoding#encode(java.lang.String) | * org.apache.tools.zip.ZipEncoding#encode(java.lang.String) | ||||
| */ | */ | ||||
| public ByteBuffer encode(final String name) throws IOException { | |||||
| public ByteBuffer encode(final String name) throws IOException { | |||||
| if (this.charset == null) { // i.e. use default charset, see no-args constructor | if (this.charset == null) { // i.e. use default charset, see no-args constructor | ||||
| return ByteBuffer.wrap(name.getBytes()); | return ByteBuffer.wrap(name.getBytes()); | ||||
| } else { | } else { | ||||
| @@ -84,7 +84,7 @@ class FallbackZipEncoding implements ZipEncoding { | |||||
| * @see | * @see | ||||
| * org.apache.tools.zip.ZipEncoding#decode(byte[]) | * org.apache.tools.zip.ZipEncoding#decode(byte[]) | ||||
| */ | */ | ||||
| public String decode(final byte[] data) throws IOException { | |||||
| public String decode(final byte[] data) throws IOException { | |||||
| if (this.charset == null) { // i.e. use default charset, see no-args constructor | if (this.charset == null) { // i.e. use default charset, see no-args constructor | ||||
| return new String(data); | return new String(data); | ||||
| } else { | } else { | ||||
| @@ -54,7 +54,7 @@ class NioZipEncoding implements ZipEncoding { | |||||
| * @see | * @see | ||||
| * org.apache.tools.zip.ZipEncoding#canEncode(java.lang.String) | * org.apache.tools.zip.ZipEncoding#canEncode(java.lang.String) | ||||
| */ | */ | ||||
| public boolean canEncode(final String name) { | |||||
| public boolean canEncode(final String name) { | |||||
| final CharsetEncoder enc = this.charset.newEncoder(); | final CharsetEncoder enc = this.charset.newEncoder(); | ||||
| enc.onMalformedInput(CodingErrorAction.REPORT); | enc.onMalformedInput(CodingErrorAction.REPORT); | ||||
| enc.onUnmappableCharacter(CodingErrorAction.REPORT); | enc.onUnmappableCharacter(CodingErrorAction.REPORT); | ||||
| @@ -66,7 +66,7 @@ class NioZipEncoding implements ZipEncoding { | |||||
| * @see | * @see | ||||
| * org.apache.tools.zip.ZipEncoding#encode(java.lang.String) | * org.apache.tools.zip.ZipEncoding#encode(java.lang.String) | ||||
| */ | */ | ||||
| public ByteBuffer encode(final String name) { | |||||
| public ByteBuffer encode(final String name) { | |||||
| final CharsetEncoder enc = this.charset.newEncoder(); | final CharsetEncoder enc = this.charset.newEncoder(); | ||||
| enc.onMalformedInput(CodingErrorAction.REPORT); | enc.onMalformedInput(CodingErrorAction.REPORT); | ||||
| @@ -113,7 +113,7 @@ class NioZipEncoding implements ZipEncoding { | |||||
| * @see | * @see | ||||
| * org.apache.tools.zip.ZipEncoding#decode(byte[]) | * org.apache.tools.zip.ZipEncoding#decode(byte[]) | ||||
| */ | */ | ||||
| public String decode(final byte[] data) throws IOException { | |||||
| public String decode(final byte[] data) throws IOException { | |||||
| return this.charset.newDecoder() | return this.charset.newDecoder() | ||||
| .onMalformedInput(CodingErrorAction.REPORT) | .onMalformedInput(CodingErrorAction.REPORT) | ||||
| .onUnmappableCharacter(CodingErrorAction.REPORT) | .onUnmappableCharacter(CodingErrorAction.REPORT) | ||||
| @@ -58,7 +58,7 @@ class Simple8BitZipEncoding implements ZipEncoding { | |||||
| this.unicode = unicode; | this.unicode = unicode; | ||||
| } | } | ||||
| public int compareTo(final Simple8BitChar a) { | |||||
| public int compareTo(final Simple8BitChar a) { | |||||
| return this.unicode - a.unicode; | return this.unicode - a.unicode; | ||||
| } | } | ||||
| @@ -215,7 +215,7 @@ class Simple8BitZipEncoding implements ZipEncoding { | |||||
| * @see | * @see | ||||
| * org.apache.tools.zip.ZipEncoding#canEncode(java.lang.String) | * org.apache.tools.zip.ZipEncoding#canEncode(java.lang.String) | ||||
| */ | */ | ||||
| public boolean canEncode(final String name) { | |||||
| public boolean canEncode(final String name) { | |||||
| for (int i=0;i<name.length();++i) { | for (int i=0;i<name.length();++i) { | ||||
| @@ -233,7 +233,7 @@ class Simple8BitZipEncoding implements ZipEncoding { | |||||
| * @see | * @see | ||||
| * org.apache.tools.zip.ZipEncoding#encode(java.lang.String) | * org.apache.tools.zip.ZipEncoding#encode(java.lang.String) | ||||
| */ | */ | ||||
| public ByteBuffer encode(final String name) { | |||||
| public ByteBuffer encode(final String name) { | |||||
| ByteBuffer out = ByteBuffer.allocate(name.length() | ByteBuffer out = ByteBuffer.allocate(name.length() | ||||
| + 6 + (name.length() + 1) / 2); | + 6 + (name.length() + 1) / 2); | ||||
| @@ -260,7 +260,7 @@ class Simple8BitZipEncoding implements ZipEncoding { | |||||
| * @see | * @see | ||||
| * org.apache.tools.zip.ZipEncoding#decode(byte[]) | * org.apache.tools.zip.ZipEncoding#decode(byte[]) | ||||
| */ | */ | ||||
| public String decode(final byte[] data) throws IOException { | |||||
| public String decode(final byte[] data) throws IOException { | |||||
| final char [] ret = new char[data.length]; | final char [] ret = new char[data.length]; | ||||
| for (int i=0;i<data.length;++i) { | for (int i=0;i<data.length;++i) { | ||||
| @@ -63,7 +63,7 @@ public class UnicodeCommentExtraField extends AbstractUnicodeExtraField { | |||||
| } | } | ||||
| /** {@inheritDoc} */ | /** {@inheritDoc} */ | ||||
| public ZipShort getHeaderId() { | |||||
| public ZipShort getHeaderId() { | |||||
| return UCOM_ID; | return UCOM_ID; | ||||
| } | } | ||||
| @@ -61,7 +61,7 @@ public class UnicodePathExtraField extends AbstractUnicodeExtraField { | |||||
| } | } | ||||
| /** {@inheritDoc} */ | /** {@inheritDoc} */ | ||||
| public ZipShort getHeaderId() { | |||||
| public ZipShort getHeaderId() { | |||||
| return UPATH_ID; | return UPATH_ID; | ||||
| } | } | ||||
| } | } | ||||
| @@ -507,7 +507,7 @@ public class ZipEntry extends java.util.zip.ZipEntry implements Cloneable { | |||||
| * @since 1.2 | * @since 1.2 | ||||
| */ | */ | ||||
| @Deprecated | @Deprecated | ||||
| public void setComprSize(final long size) { | |||||
| public void setComprSize(final long size) { | |||||
| setCompressedSize(size); | setCompressedSize(size); | ||||
| } | } | ||||
| @@ -992,7 +992,7 @@ public class ZipFile { | |||||
| */ | */ | ||||
| private final Comparator<ZipEntry> OFFSET_COMPARATOR = | private final Comparator<ZipEntry> OFFSET_COMPARATOR = | ||||
| new Comparator<ZipEntry>() { | new Comparator<ZipEntry>() { | ||||
| public int compare(final ZipEntry e1, final ZipEntry e2) { | |||||
| public int compare(final ZipEntry e1, final ZipEntry e2) { | |||||
| if (e1 == e2) { | if (e1 == e2) { | ||||
| return 0; | return 0; | ||||
| } | } | ||||
| @@ -1252,7 +1252,7 @@ public class ZipOutputStream extends FilterOutputStream { | |||||
| * @deprecated use ZipUtil#toDosTime | * @deprecated use ZipUtil#toDosTime | ||||
| */ | */ | ||||
| @Deprecated | @Deprecated | ||||
| protected static ZipLong toDosTime(Date time) { | |||||
| protected static ZipLong toDosTime(Date time) { | |||||
| return ZipUtil.toDosTime(time); | return ZipUtil.toDosTime(time); | ||||
| } | } | ||||
| @@ -1266,7 +1266,7 @@ public class ZipOutputStream extends FilterOutputStream { | |||||
| * @deprecated use ZipUtil#toDosTime | * @deprecated use ZipUtil#toDosTime | ||||
| */ | */ | ||||
| @Deprecated | @Deprecated | ||||
| protected static byte[] toDosTime(long t) { | |||||
| protected static byte[] toDosTime(long t) { | |||||
| return ZipUtil.toDosTime(t); | return ZipUtil.toDosTime(t); | ||||
| } | } | ||||
| @@ -1399,7 +1399,7 @@ public class ZipOutputStream extends FilterOutputStream { | |||||
| * @deprecated use ZipUtil#adjustToLong | * @deprecated use ZipUtil#adjustToLong | ||||
| */ | */ | ||||
| @Deprecated | @Deprecated | ||||
| protected static long adjustToLong(int i) { | |||||
| protected static long adjustToLong(int i) { | |||||
| return ZipUtil.adjustToLong(i); | return ZipUtil.adjustToLong(i); | ||||
| } | } | ||||