git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@274859 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -527,8 +527,8 @@ public class ProjectHelper2 extends ProjectHelper { | |||||
| String dup = project.getProperty(antFileProp); | String dup = project.getProperty(antFileProp); | ||||
| if (dup != null && nameAttributeSet) { | if (dup != null && nameAttributeSet) { | ||||
| File dupFile = new File(dup); | File dupFile = new File(dup); | ||||
| if (context.isIgnoringProjectTag() && | |||||
| !dupFile.equals(context.getBuildFile())) { | |||||
| if (context.isIgnoringProjectTag() | |||||
| && !dupFile.equals(context.getBuildFile())) { | |||||
| project.log("Duplicated project name in import. Project " | project.log("Duplicated project name in import. Project " | ||||
| + context.getCurrentProjectName() + " defined first in " | + context.getCurrentProjectName() + " defined first in " | ||||
| + dup + " and again in " + context.getBuildFile(), | + dup + " and again in " + context.getBuildFile(), | ||||
| @@ -366,7 +366,8 @@ public class ProjectHelperImpl extends ProjectHelper { | |||||
| if (tag.equals("project")) { | if (tag.equals("project")) { | ||||
| new ProjectHandler(helperImpl, this).init(tag, attrs); | new ProjectHandler(helperImpl, this).init(tag, attrs); | ||||
| } else { | } else { | ||||
| throw new SAXParseException("Config file is not of expected XML type", helperImpl.locator); | |||||
| throw new SAXParseException("Config file is not of expected " | |||||
| + "XML type", helperImpl.locator); | |||||
| } | } | ||||
| } | } | ||||
| @@ -462,8 +463,9 @@ public class ProjectHelperImpl extends ProjectHelper { | |||||
| if ((new File(baseDir)).isAbsolute()) { | if ((new File(baseDir)).isAbsolute()) { | ||||
| helperImpl.project.setBasedir(baseDir); | helperImpl.project.setBasedir(baseDir); | ||||
| } else { | } else { | ||||
| helperImpl.project.setBaseDir(helperImpl.project.resolveFile(baseDir, | |||||
| helperImpl.buildFileParent)); | |||||
| File resolvedBaseDir = helperImpl.project.resolveFile(baseDir, | |||||
| helperImpl.buildFileParent); | |||||
| helperImpl.project.setBaseDir(resolvedBaseDir); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -577,7 +579,8 @@ public class ProjectHelperImpl extends ProjectHelper { | |||||
| } else if (key.equals("description")) { | } else if (key.equals("description")) { | ||||
| description = value; | description = value; | ||||
| } else { | } else { | ||||
| throw new SAXParseException("Unexpected attribute \"" + key + "\"", helperImpl.locator); | |||||
| throw new SAXParseException("Unexpected attribute \"" | |||||
| + key + "\"", helperImpl.locator); | |||||
| } | } | ||||
| } | } | ||||
| @@ -731,7 +734,8 @@ public class ProjectHelperImpl extends ProjectHelper { | |||||
| * Must not be <code>null</code>. | * Must not be <code>null</code>. | ||||
| */ | */ | ||||
| public TaskHandler(ProjectHelperImpl helperImpl, DocumentHandler parentHandler, | public TaskHandler(ProjectHelperImpl helperImpl, DocumentHandler parentHandler, | ||||
| TaskContainer container, RuntimeConfigurable parentWrapper, Target target) { | |||||
| TaskContainer container, | |||||
| RuntimeConfigurable parentWrapper, Target target) { | |||||
| super(helperImpl, parentHandler); | super(helperImpl, parentHandler); | ||||
| this.container = container; | this.container = container; | ||||
| this.parentWrapper = parentWrapper; | this.parentWrapper = parentWrapper; | ||||
| @@ -975,7 +979,8 @@ public class ProjectHelperImpl extends ProjectHelper { | |||||
| * @param target The parent target of this element. | * @param target The parent target of this element. | ||||
| * Must not be <code>null</code>. | * Must not be <code>null</code>. | ||||
| */ | */ | ||||
| public DataTypeHandler(ProjectHelperImpl helperImpl, DocumentHandler parentHandler, Target target) { | |||||
| public DataTypeHandler(ProjectHelperImpl helperImpl, | |||||
| DocumentHandler parentHandler, Target target) { | |||||
| super(helperImpl, parentHandler); | super(helperImpl, parentHandler); | ||||
| this.target = target; | this.target = target; | ||||
| } | } | ||||
| @@ -135,6 +135,7 @@ public class MailLogger extends DefaultLogger { | |||||
| try { | try { | ||||
| is.close(); | is.close(); | ||||
| } catch (IOException e) { | } catch (IOException e) { | ||||
| // ignore | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -272,9 +273,11 @@ public class MailLogger extends DefaultLogger { | |||||
| * @param subject mail subject | * @param subject mail subject | ||||
| * @param message mail body | * @param message mail body | ||||
| */ | */ | ||||
| private void sendMimeMail(Project project, String host, int port, String user, String password, boolean ssl, | |||||
| String from, String replyToString, String toString, | |||||
| String subject, String message) { | |||||
| private void sendMimeMail(Project project, String host, int port, | |||||
| String user, String password, boolean ssl, | |||||
| String from, String replyToString, | |||||
| String toString, String subject, | |||||
| String message) { | |||||
| // convert the replyTo string into a vector of emailaddresses | // convert the replyTo string into a vector of emailaddresses | ||||
| Mailer mailer = null; | Mailer mailer = null; | ||||
| try { | try { | ||||
| @@ -706,8 +706,8 @@ public abstract class AbstractCvsTask extends Task { | |||||
| * level, AbstractCvsTask.DEFAULT_COMPRESSION_LEVEL. | * level, AbstractCvsTask.DEFAULT_COMPRESSION_LEVEL. | ||||
| */ | */ | ||||
| public void setCompression(boolean usecomp) { | public void setCompression(boolean usecomp) { | ||||
| setCompressionLevel(usecomp ? | |||||
| AbstractCvsTask.DEFAULT_COMPRESSION_LEVEL : 0); | |||||
| setCompressionLevel(usecomp | |||||
| ? AbstractCvsTask.DEFAULT_COMPRESSION_LEVEL : 0); | |||||
| } | } | ||||
| } | } | ||||
| @@ -373,11 +373,11 @@ public class Ant extends Task { | |||||
| // Are we trying to call the target in which we are defined (or | // Are we trying to call the target in which we are defined (or | ||||
| // the build file if this is a top level task)? | // the build file if this is a top level task)? | ||||
| if (newProject.getBaseDir().equals(getProject().getBaseDir()) && | |||||
| newProject.getProperty("ant.file").equals(getProject().getProperty("ant.file")) | |||||
| if (newProject.getBaseDir().equals(getProject().getBaseDir()) | |||||
| && newProject.getProperty("ant.file").equals(getProject().getProperty("ant.file")) | |||||
| && getOwningTarget() != null | && getOwningTarget() != null | ||||
| && (getOwningTarget().getName().equals("") || | |||||
| getOwningTarget().getName().equals(target))) { | |||||
| && (getOwningTarget().getName().equals("") | |||||
| || getOwningTarget().getName().equals(target))) { | |||||
| throw new BuildException("ant task calling its own parent " | throw new BuildException("ant task calling its own parent " | ||||
| + "target"); | + "target"); | ||||
| } | } | ||||
| @@ -69,6 +69,7 @@ import org.apache.tools.ant.IntrospectionHelper; | |||||
| import org.apache.tools.ant.Task; | import org.apache.tools.ant.Task; | ||||
| import org.apache.tools.ant.TaskContainer; | import org.apache.tools.ant.TaskContainer; | ||||
| import org.apache.tools.ant.types.EnumeratedAttribute; | import org.apache.tools.ant.types.EnumeratedAttribute; | ||||
| import org.apache.tools.ant.types.Reference; | |||||
| /** | /** | ||||
| * Creates a partial DTD for Ant from the currently known tasks. | * Creates a partial DTD for Ant from the currently known tasks. | ||||
| @@ -307,12 +308,12 @@ public class AntStructure extends Task { | |||||
| sb.append(lSep).append(" ").append(attrName).append(" "); | sb.append(lSep).append(" ").append(attrName).append(" "); | ||||
| Class type = ih.getAttributeType(attrName); | Class type = ih.getAttributeType(attrName); | ||||
| if (type.equals(java.lang.Boolean.class) || | |||||
| type.equals(java.lang.Boolean.TYPE)) { | |||||
| if (type.equals(java.lang.Boolean.class) | |||||
| || type.equals(java.lang.Boolean.TYPE)) { | |||||
| sb.append(BOOLEAN).append(" "); | sb.append(BOOLEAN).append(" "); | ||||
| } else if (org.apache.tools.ant.types.Reference.class.isAssignableFrom(type)) { | |||||
| } else if (Reference.class.isAssignableFrom(type)) { | |||||
| sb.append("IDREF "); | sb.append("IDREF "); | ||||
| } else if (org.apache.tools.ant.types.EnumeratedAttribute.class.isAssignableFrom(type)) { | |||||
| } else if (EnumeratedAttribute.class.isAssignableFrom(type)) { | |||||
| try { | try { | ||||
| EnumeratedAttribute ea = | EnumeratedAttribute ea = | ||||
| (EnumeratedAttribute) type.newInstance(); | (EnumeratedAttribute) type.newInstance(); | ||||
| @@ -363,9 +364,8 @@ public class AntStructure extends Task { | |||||
| for (int i = 0; i < length; i++) { | for (int i = 0; i < length; i++) { | ||||
| char c = s.charAt(i); | char c = s.charAt(i); | ||||
| // XXX - we are ommitting CombiningChar and Extender here | // XXX - we are ommitting CombiningChar and Extender here | ||||
| if (!Character.isLetterOrDigit(c) && | |||||
| c != '.' && c != '-' && | |||||
| c != '_' && c != ':') { | |||||
| if (!Character.isLetterOrDigit(c) | |||||
| && c != '.' && c != '-' && c != '_' && c != ':') { | |||||
| return false; | return false; | ||||
| } | } | ||||
| } | } | ||||
| @@ -403,8 +403,8 @@ public class Checksum extends MatchingTask implements Condition { | |||||
| if (file.exists()) { | if (file.exists()) { | ||||
| if (property == null) { | if (property == null) { | ||||
| File checksumFile = getChecksumFile(file); | File checksumFile = getChecksumFile(file); | ||||
| if (forceOverwrite || isCondition || | |||||
| (file.lastModified() > checksumFile.lastModified())) { | |||||
| if (forceOverwrite || isCondition | |||||
| || (file.lastModified() > checksumFile.lastModified())) { | |||||
| includeFileMap.put(file, checksumFile); | includeFileMap.put(file, checksumFile); | ||||
| } else { | } else { | ||||
| log(file + " omitted as " + checksumFile + " is up to date.", | log(file + " omitted as " + checksumFile + " is up to date.", | ||||
| @@ -413,10 +413,12 @@ public class Checksum extends MatchingTask implements Condition { | |||||
| // Read the checksum from disk. | // Read the checksum from disk. | ||||
| String checksum = null; | String checksum = null; | ||||
| try { | try { | ||||
| BufferedReader diskChecksumReader = new BufferedReader(new FileReader(checksumFile)); | |||||
| BufferedReader diskChecksumReader | |||||
| = new BufferedReader(new FileReader(checksumFile)); | |||||
| checksum = diskChecksumReader.readLine(); | checksum = diskChecksumReader.readLine(); | ||||
| } catch (IOException e) { | } catch (IOException e) { | ||||
| throw new BuildException("Couldn't read checksum file " + checksumFile, e); | |||||
| throw new BuildException("Couldn't read checksum file " | |||||
| + checksumFile, e); | |||||
| } | } | ||||
| byte[] digest = decodeHex(checksum.toCharArray()); | byte[] digest = decodeHex(checksum.toCharArray()); | ||||
| allDigests.put(file, digest); | allDigests.put(file, digest); | ||||
| @@ -486,8 +488,8 @@ public class Checksum extends MatchingTask implements Condition { | |||||
| if (destination instanceof java.lang.String) { | if (destination instanceof java.lang.String) { | ||||
| String prop = (String) destination; | String prop = (String) destination; | ||||
| if (isCondition) { | if (isCondition) { | ||||
| checksumMatches = checksumMatches && | |||||
| checksum.equals(property); | |||||
| checksumMatches | |||||
| = checksumMatches && checksum.equals(property); | |||||
| } else { | } else { | ||||
| getProject().setNewProperty(prop, checksum); | getProject().setNewProperty(prop, checksum); | ||||
| } | } | ||||
| @@ -503,8 +505,8 @@ public class Checksum extends MatchingTask implements Condition { | |||||
| fis = null; | fis = null; | ||||
| br.close(); | br.close(); | ||||
| isr.close(); | isr.close(); | ||||
| checksumMatches = checksumMatches && | |||||
| checksum.equals(suppliedChecksum); | |||||
| checksumMatches = checksumMatches | |||||
| && checksum.equals(suppliedChecksum); | |||||
| } else { | } else { | ||||
| checksumMatches = false; | checksumMatches = false; | ||||
| } | } | ||||
| @@ -68,7 +68,8 @@ import org.apache.tools.ant.types.PatternSet; | |||||
| * | * | ||||
| * @author costin@eng.sun.com | * @author costin@eng.sun.com | ||||
| * @author Mariusz Nowostawski (Marni) | * @author Mariusz Nowostawski (Marni) | ||||
| * <a href="mailto:mnowostawski@infoscience.otago.ac.nz">mnowostawski@infoscience.otago.ac.nz</a> | |||||
| * <a href="mailto:mnowostawski@infoscience.otago.ac.nz"> | |||||
| * mnowostawski@infoscience.otago.ac.nz</a> | |||||
| * @author Stefan Bodewig | * @author Stefan Bodewig | ||||
| * | * | ||||
| * @since Ant 1.1 | * @since Ant 1.1 | ||||
| @@ -351,9 +351,8 @@ public class Copy extends Task { | |||||
| destFile = new File(destDir, file.getName()); | destFile = new File(destDir, file.getName()); | ||||
| } | } | ||||
| if (forceOverwrite || | |||||
| !destFile.exists() || | |||||
| (file.lastModified() > destFile.lastModified())) { | |||||
| if (forceOverwrite || !destFile.exists() | |||||
| || (file.lastModified() > destFile.lastModified())) { | |||||
| fileCopyMap.put(file.getAbsolutePath(), | fileCopyMap.put(file.getAbsolutePath(), | ||||
| destFile.getAbsolutePath()); | destFile.getAbsolutePath()); | ||||
| } else { | } else { | ||||
| @@ -161,8 +161,8 @@ public class Copydir extends MatchingTask { | |||||
| } else { | } else { | ||||
| destFile = new File(to, filename); | destFile = new File(to, filename); | ||||
| } | } | ||||
| if (forceOverwrite || | |||||
| (srcFile.lastModified() > destFile.lastModified())) { | |||||
| if (forceOverwrite | |||||
| || (srcFile.lastModified() > destFile.lastModified())) { | |||||
| filecopyList.put(srcFile.getAbsolutePath(), | filecopyList.put(srcFile.getAbsolutePath(), | ||||
| destFile.getAbsolutePath()); | destFile.getAbsolutePath()); | ||||
| } | } | ||||
| @@ -117,7 +117,7 @@ public class DefaultExcludes extends Task { | |||||
| /** | /** | ||||
| * Pattern to remove from the default excludes. | * Pattern to remove from the default excludes. | ||||
| * | * | ||||
| * @param msg Sets the value for the pattern that | |||||
| * @param remove Sets the value for the pattern that | |||||
| * should nolonger be excluded. | * should nolonger be excluded. | ||||
| */ | */ | ||||
| public void setRemove(String remove) { | public void setRemove(String remove) { | ||||
| @@ -478,8 +478,8 @@ public class Delete extends MatchingTask { | |||||
| } | } | ||||
| // delete the directory | // delete the directory | ||||
| if (dir != null && dir.exists() && dir.isDirectory() && | |||||
| !usedMatchingTask) { | |||||
| if (dir != null && dir.exists() && dir.isDirectory() | |||||
| && !usedMatchingTask) { | |||||
| /* | /* | ||||
| If verbosity is MSG_VERBOSE, that mean we are doing | If verbosity is MSG_VERBOSE, that mean we are doing | ||||
| regular logging (backwards as that sounds). In that | regular logging (backwards as that sounds). In that | ||||
| @@ -208,8 +208,8 @@ public class DependSet extends MatchingTask { | |||||
| Project.MSG_WARN); | Project.MSG_WARN); | ||||
| } | } | ||||
| if (oldestTarget == null || | |||||
| dest.lastModified() < oldestTargetTime) { | |||||
| if (oldestTarget == null | |||||
| || dest.lastModified() < oldestTargetTime) { | |||||
| oldestTargetTime = dest.lastModified(); | oldestTargetTime = dest.lastModified(); | ||||
| oldestTarget = dest; | oldestTarget = dest; | ||||
| } | } | ||||
| @@ -241,8 +241,8 @@ public class DependSet extends MatchingTask { | |||||
| Project.MSG_WARN); | Project.MSG_WARN); | ||||
| } | } | ||||
| if (oldestTarget == null || | |||||
| dest.lastModified() < oldestTargetTime) { | |||||
| if (oldestTarget == null | |||||
| || dest.lastModified() < oldestTargetTime) { | |||||
| oldestTargetTime = dest.lastModified(); | oldestTargetTime = dest.lastModified(); | ||||
| oldestTarget = dest; | oldestTarget = dest; | ||||
| } | } | ||||
| @@ -410,7 +410,7 @@ public class ExecuteOn extends ExecTask { | |||||
| * Construct the command line for parallel execution. | * Construct the command line for parallel execution. | ||||
| * | * | ||||
| * @param srcFiles The filenames to add to the commandline | * @param srcFiles The filenames to add to the commandline | ||||
| * @param baseDir filenames are relative to this dir | |||||
| * @param baseDirs filenames are relative to this dir | |||||
| */ | */ | ||||
| protected String[] getCommandline(String[] srcFiles, File[] baseDirs) { | protected String[] getCommandline(String[] srcFiles, File[] baseDirs) { | ||||
| final char fileSeparator = File.separatorChar; | final char fileSeparator = File.separatorChar; | ||||
| @@ -242,7 +242,7 @@ public class FixCRLF extends MatchingTask { | |||||
| /** | /** | ||||
| * Specify how carriage return (CR) characters are to be handled. | * Specify how carriage return (CR) characters are to be handled. | ||||
| * | * | ||||
| * @param option valid values: | |||||
| * @param attr valid values: | |||||
| * <ul> | * <ul> | ||||
| * <li>add: ensure that there is a CR before every LF | * <li>add: ensure that there is a CR before every LF | ||||
| * <li>asis: leave CR characters alone | * <li>asis: leave CR characters alone | ||||
| @@ -294,7 +294,8 @@ public abstract class JDBCTask extends Task { | |||||
| log("Version = " + theVersion, Project.MSG_VERBOSE); | log("Version = " + theVersion, Project.MSG_VERBOSE); | ||||
| if (theVersion == null | if (theVersion == null | ||||
| || !(theVersion.startsWith(version) || theVersion.indexOf(" " + version) >= 0)) { | |||||
| || !(theVersion.startsWith(version) | |||||
| || theVersion.indexOf(" " + version) >= 0)) { | |||||
| log("Not the required version: \"" + version + "\"", Project.MSG_VERBOSE); | log("Not the required version: \"" + version + "\"", Project.MSG_VERBOSE); | ||||
| return false; | return false; | ||||
| } | } | ||||
| @@ -317,10 +318,14 @@ public abstract class JDBCTask extends Task { | |||||
| } | } | ||||
| /** | /** | ||||
| * Creates a new Connection as using the driver, url, userid and password specified. | |||||
| * Creates a new Connection as using the driver, url, userid and password | |||||
| * specified. | |||||
| * | |||||
| * The calling method is responsible for closing the connection. | * The calling method is responsible for closing the connection. | ||||
| * | |||||
| * @return Connection the newly created connection. | * @return Connection the newly created connection. | ||||
| * @throws BuildException if the UserId/Password/Url is not set or there is no suitable driver or the driver fails to load. | |||||
| * @throws BuildException if the UserId/Password/Url is not set or there | |||||
| * is no suitable driver or the driver fails to load. | |||||
| */ | */ | ||||
| protected Connection getConnection() throws BuildException { | protected Connection getConnection() throws BuildException { | ||||
| if (userId == null) { | if (userId == null) { | ||||
| @@ -379,22 +384,23 @@ public abstract class JDBCTask extends Task { | |||||
| loader = (AntClassLoader) loaderMap.get(driver); | loader = (AntClassLoader) loaderMap.get(driver); | ||||
| } | } | ||||
| if (loader == null) { | if (loader == null) { | ||||
| log( | |||||
| "Loading " + driver + " using AntClassLoader with classpath " + classpath, | |||||
| Project.MSG_VERBOSE); | |||||
| log("Loading " + driver | |||||
| + " using AntClassLoader with classpath " | |||||
| + classpath, Project.MSG_VERBOSE); | |||||
| loader = getProject().createClassLoader(classpath); | loader = getProject().createClassLoader(classpath); | ||||
| if (caching) { | if (caching) { | ||||
| loaderMap.put(driver, loader); | loaderMap.put(driver, loader); | ||||
| } | } | ||||
| } else { | } else { | ||||
| log( | |||||
| "Loading " + driver + " using a cached AntClassLoader.", | |||||
| log("Loading " + driver | |||||
| + " using a cached AntClassLoader.", | |||||
| Project.MSG_VERBOSE); | Project.MSG_VERBOSE); | ||||
| } | } | ||||
| } | } | ||||
| dc = loader.loadClass(driver); | dc = loader.loadClass(driver); | ||||
| } else { | } else { | ||||
| log("Loading " + driver + " using system loader.", Project.MSG_VERBOSE); | |||||
| log("Loading " + driver + " using system loader.", | |||||
| Project.MSG_VERBOSE); | |||||
| dc = Class.forName(driver); | dc = Class.forName(driver); | ||||
| } | } | ||||
| driverInstance = (Driver) dc.newInstance(); | driverInstance = (Driver) dc.newInstance(); | ||||
| @@ -525,8 +525,8 @@ public class Jar extends Zip { | |||||
| throw new BuildException("Unsupported encoding while reading " | throw new BuildException("Unsupported encoding while reading " | ||||
| + "manifest: " + e.getMessage(), e); | + "manifest: " + e.getMessage(), e); | ||||
| } | } | ||||
| } else if (filesetManifestConfig != null && | |||||
| !filesetManifestConfig.getValue().equals("skip")) { | |||||
| } else if (filesetManifestConfig != null | |||||
| && !filesetManifestConfig.getValue().equals("skip")) { | |||||
| // we add this to our group of fileset manifests | // we add this to our group of fileset manifests | ||||
| log("Found manifest to merge in file " + file, | log("Found manifest to merge in file " + file, | ||||
| Project.MSG_VERBOSE); | Project.MSG_VERBOSE); | ||||
| @@ -1227,7 +1227,7 @@ public class Javadoc extends Task { | |||||
| /** | /** | ||||
| * Create link to javadoc output at the given URL. | * Create link to javadoc output at the given URL. | ||||
| * | * | ||||
| * @param link argument to configure | |||||
| * @return link argument to configure | |||||
| */ | */ | ||||
| public LinkArgument createLink() { | public LinkArgument createLink() { | ||||
| LinkArgument la = new LinkArgument(); | LinkArgument la = new LinkArgument(); | ||||
| @@ -117,7 +117,9 @@ public class Jikes { | |||||
| && args.length > 250) { | && args.length > 250) { | ||||
| PrintWriter out = null; | PrintWriter out = null; | ||||
| try { | try { | ||||
| tmpFile = new File("jikes" + (new Random(System.currentTimeMillis())).nextLong()); | |||||
| String tempFileName = "jikes" | |||||
| + (new Random(System.currentTimeMillis())).nextLong(); | |||||
| tmpFile = new File(tempFileName); | |||||
| out = new PrintWriter(new FileWriter(tmpFile)); | out = new PrintWriter(new FileWriter(tmpFile)); | ||||
| for (int i = 0; i < args.length; i++) { | for (int i = 0; i < args.length; i++) { | ||||
| out.println(args[i]); | out.println(args[i]); | ||||
| @@ -106,7 +106,8 @@ public final class LoadFile extends Task { | |||||
| * Encoding to use for input, defaults to the platform's default | * Encoding to use for input, defaults to the platform's default | ||||
| * encoding. <p> | * encoding. <p> | ||||
| * | * | ||||
| * For a list of possible values see <a href="http://java.sun.com/products/jdk/1.2/docs/guide/internat/encoding.doc.html"> | |||||
| * For a list of possible values see | |||||
| * <a href="http://java.sun.com/products/jdk/1.2/docs/guide/internat/encoding.doc.html"> | |||||
| * http://java.sun.com/products/jdk/1.2/docs/guide/internat/encoding.doc.html | * http://java.sun.com/products/jdk/1.2/docs/guide/internat/encoding.doc.html | ||||
| * </a>.</p> | * </a>.</p> | ||||
| * | * | ||||
| @@ -106,7 +106,8 @@ public final class LoadProperties extends Task { | |||||
| * Encoding to use for input, defaults to the platform's default | * Encoding to use for input, defaults to the platform's default | ||||
| * encoding. <p> | * encoding. <p> | ||||
| * | * | ||||
| * For a list of possible values see <a href="http://java.sun.com/products/jdk/1.2/docs/guide/internat/encoding.doc.html"> | |||||
| * For a list of possible values see | |||||
| * <a href="http://java.sun.com/products/jdk/1.2/docs/guide/internat/encoding.doc.html"> | |||||
| * http://java.sun.com/products/jdk/1.2/docs/guide/internat/encoding.doc.html | * http://java.sun.com/products/jdk/1.2/docs/guide/internat/encoding.doc.html | ||||
| * </a>.</p> | * </a>.</p> | ||||
| * | * | ||||
| @@ -636,6 +636,7 @@ public class Manifest { | |||||
| /** | /** | ||||
| * Clone this section | * Clone this section | ||||
| * | * | ||||
| * @return the cloned Section | |||||
| * @since Ant 1.5.2 | * @since Ant 1.5.2 | ||||
| */ | */ | ||||
| public Object clone() { | public Object clone() { | ||||
| @@ -115,6 +115,9 @@ public class ManifestTask extends Task { | |||||
| } | } | ||||
| } | } | ||||
| /** | |||||
| * Default constructor | |||||
| */ | |||||
| public ManifestTask() { | public ManifestTask() { | ||||
| mode = new Mode(); | mode = new Mode(); | ||||
| mode.setValue("replace"); | mode.setValue("replace"); | ||||
| @@ -288,8 +288,8 @@ public class Move extends Copy { | |||||
| throws IOException, BuildException { | throws IOException, BuildException { | ||||
| boolean renamed = true; | boolean renamed = true; | ||||
| if ((getFilterSets() != null && getFilterSets().size() > 0) || | |||||
| (getFilterChains() != null && getFilterChains().size() > 0)) { | |||||
| if ((getFilterSets() != null && getFilterSets().size() > 0) | |||||
| || (getFilterChains() != null && getFilterChains().size() > 0)) { | |||||
| renamed = false; | renamed = false; | ||||
| } else { | } else { | ||||
| if (!filtering) { | if (!filtering) { | ||||
| @@ -245,8 +245,8 @@ public class Parallel extends Task | |||||
| if (firstException == null) { | if (firstException == null) { | ||||
| firstException = t; | firstException = t; | ||||
| } | } | ||||
| if (t instanceof BuildException && | |||||
| firstLocation == Location.UNKNOWN_LOCATION) { | |||||
| if (t instanceof BuildException | |||||
| && firstLocation == Location.UNKNOWN_LOCATION) { | |||||
| firstLocation = ((BuildException) t).getLocation(); | firstLocation = ((BuildException) t).getLocation(); | ||||
| } | } | ||||
| exceptionMessage.append(StringUtils.LINE_SEP); | exceptionMessage.append(StringUtils.LINE_SEP); | ||||
| @@ -101,8 +101,8 @@ import org.apache.tools.ant.types.Reference; | |||||
| * @author <a href="mailto:glennm@ca.ibm.com">Glenn McAllister</a> | * @author <a href="mailto:glennm@ca.ibm.com">Glenn McAllister</a> | ||||
| * @since Ant 1.1 | * @since Ant 1.1 | ||||
| * | * | ||||
| * @ant.attribute.group name="name" description="One of these, when using the name attribute" | |||||
| * @ant.attribute.group name="noname" description="One of these, when not using the name attribute" | |||||
| * @ant.attribute.group name="name" description="One of these, when using the name attribute" | |||||
| * @ant.attribute.group name="noname" description="One of these, when not using the name attribute" | |||||
| */ | */ | ||||
| public class Property extends Task { | public class Property extends Task { | ||||
| @@ -172,8 +172,8 @@ public class Replace extends MatchingTask { | |||||
| } | } | ||||
| //Make sure property exists in property file | //Make sure property exists in property file | ||||
| if (properties == null || | |||||
| properties.getProperty(property) == null) { | |||||
| if (properties == null | |||||
| || properties.getProperty(property) == null) { | |||||
| String message = "property \"" + property | String message = "property \"" + property | ||||
| + "\" was not found in " + propertyFile.getPath(); | + "\" was not found in " + propertyFile.getPath(); | ||||
| throw new BuildException(message); | throw new BuildException(message); | ||||
| @@ -79,14 +79,15 @@ import org.apache.tools.ant.util.facade.FacadeTaskHelper; | |||||
| * class and this class is a class nested into another class, you have to | * class and this class is a class nested into another class, you have to | ||||
| * specify the classname in the form <code>Outer$$Inner</code> instead of | * specify the classname in the form <code>Outer$$Inner</code> instead of | ||||
| * <code>Outer.Inner</code>.</p> | * <code>Outer.Inner</code>.</p> | ||||
| * <p>It is possible to refine the set of files that are being rmiced. This can be | |||||
| * done with the <i>includes</i>, <i>includesfile</i>, <i>excludes</i>, | |||||
| * <p>It is possible to refine the set of files that are being rmiced. This can | |||||
| * be done with the <i>includes</i>, <i>includesfile</i>, <i>excludes</i>, | |||||
| * <i>excludesfile</i> and <i>defaultexcludes</i> | * <i>excludesfile</i> and <i>defaultexcludes</i> | ||||
| * attributes. With the <i>includes</i> or <i>includesfile</i> attribute you specify the files you want to | |||||
| * have included by using patterns. The <i>exclude</i> or <i>excludesfile</i> attribute is used to specify | |||||
| * attributes. With the <i>includes</i> or <i>includesfile</i> attribute you | |||||
| * specify the files you want to have included by using patterns. The | |||||
| * <i>exclude</i> or <i>excludesfile</i> attribute is used to specify | |||||
| * the files you want to have excluded. This is also done with patterns. And | * the files you want to have excluded. This is also done with patterns. And | ||||
| * finally with the <i>defaultexcludes</i> attribute, you can specify whether you | |||||
| * want to use default exclusions or not. See the section on | |||||
| * finally with the <i>defaultexcludes</i> attribute, you can specify whether | |||||
| * you want to use default exclusions or not. See the section on | |||||
| * directory based tasks</a>, on how the | * directory based tasks</a>, on how the | ||||
| * inclusion/exclusion of files works, and how to write patterns.</p> | * inclusion/exclusion of files works, and how to write patterns.</p> | ||||
| * <p>This task forms an implicit FileSet and | * <p>This task forms an implicit FileSet and | ||||
| @@ -124,8 +124,7 @@ public class Sync extends Task { | |||||
| // If the destination directory didn't already exist, | // If the destination directory didn't already exist, | ||||
| // or was empty, then no previous file removal is necessary! | // or was empty, then no previous file removal is necessary! | ||||
| boolean noRemovalNecessary = !toDir.exists() || | |||||
| toDir.list().length < 1; | |||||
| boolean noRemovalNecessary = !toDir.exists() || toDir.list().length < 1; | |||||
| // Copy all the necessary out-of-date files | // Copy all the necessary out-of-date files | ||||
| log("PASS#1: Copying files to " + toDir, Project.MSG_DEBUG); | log("PASS#1: Copying files to " + toDir, Project.MSG_DEBUG); | ||||
| @@ -86,8 +86,10 @@ public class TaskOutputStream extends OutputStream { | |||||
| */ | */ | ||||
| TaskOutputStream(Task task, int msgOutputLevel) { | TaskOutputStream(Task task, int msgOutputLevel) { | ||||
| System.err.println("As of Ant 1.2 released in October 2000, the TaskOutputStream class"); | |||||
| System.err.println("is considered to be dead code by the Ant developers and is unmaintained."); | |||||
| System.err.println("As of Ant 1.2 released in October 2000, the " | |||||
| + "TaskOutputStream class"); | |||||
| System.err.println("is considered to be dead code by the Ant " | |||||
| + "developers and is unmaintained."); | |||||
| System.err.println("Don\'t use it!"); | System.err.println("Don\'t use it!"); | ||||
| this.task = task; | this.task = task; | ||||
| @@ -210,8 +210,7 @@ public class Touch extends Task { | |||||
| } | } | ||||
| } | } | ||||
| if (millis >= 0 && | |||||
| JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1)) { | |||||
| if (millis >= 0 && JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1)) { | |||||
| log("modification time of files cannot be set in JDK 1.1", | log("modification time of files cannot be set in JDK 1.1", | ||||
| Project.MSG_WARN); | Project.MSG_WARN); | ||||
| return; | return; | ||||
| @@ -205,15 +205,14 @@ public class UpToDate extends Task implements Condition { | |||||
| if (_sourceFile != null) { | if (_sourceFile != null) { | ||||
| if (mapperElement == null) { | if (mapperElement == null) { | ||||
| upToDate = upToDate && | |||||
| (_targetFile.lastModified() >= _sourceFile.lastModified()); | |||||
| upToDate = upToDate | |||||
| && (_targetFile.lastModified() >= _sourceFile.lastModified()); | |||||
| } else { | } else { | ||||
| SourceFileScanner sfs = new SourceFileScanner(this); | SourceFileScanner sfs = new SourceFileScanner(this); | ||||
| upToDate = upToDate && | |||||
| (sfs.restrict(new String[] {_sourceFile.getAbsolutePath()}, | |||||
| upToDate = upToDate | |||||
| && (sfs.restrict(new String[] {_sourceFile.getAbsolutePath()}, | |||||
| null, null, | null, null, | ||||
| mapperElement.getImplementation()) | |||||
| .length == 0); | |||||
| mapperElement.getImplementation()).length == 0); | |||||
| } | } | ||||
| } | } | ||||
| return upToDate; | return upToDate; | ||||
| @@ -71,7 +71,9 @@ import org.apache.tools.zip.ZipOutputStream; | |||||
| * <p>(The War task is a shortcut for specifying the particular layout of a WAR file. | * <p>(The War task is a shortcut for specifying the particular layout of a WAR file. | ||||
| * The same thing can be accomplished by using the <i>prefix</i> and <i>fullpath</i> | * The same thing can be accomplished by using the <i>prefix</i> and <i>fullpath</i> | ||||
| * attributes of zipfilesets in a Zip or Jar task.)</p> | * attributes of zipfilesets in a Zip or Jar task.)</p> | ||||
| * <p>The extended zipfileset element from the zip task (with attributes <i>prefix</i>, <i>fullpath</i>, and <i>src</i>) is available in the War task.</p> | |||||
| * <p>The extended zipfileset element from the zip task | |||||
| * (with attributes <i>prefix</i>, <i>fullpath</i>, and <i>src</i>) | |||||
| * is available in the War task.</p> | |||||
| * | * | ||||
| * @author Stefan Bodewig | * @author Stefan Bodewig | ||||
| * | * | ||||
| @@ -481,9 +481,9 @@ public class XSLTProcess extends MatchingTask implements XSLTLogger { | |||||
| } else { | } else { | ||||
| outFile = new File(destDir, xmlFile + fileExt); | outFile = new File(destDir, xmlFile + fileExt); | ||||
| } | } | ||||
| if (force || | |||||
| inFile.lastModified() > outFile.lastModified() || | |||||
| styleSheetLastModified > outFile.lastModified()) { | |||||
| if (force | |||||
| || inFile.lastModified() > outFile.lastModified() | |||||
| || styleSheetLastModified > outFile.lastModified()) { | |||||
| ensureDirectoryFor(outFile); | ensureDirectoryFor(outFile); | ||||
| log("Processing " + inFile + " to " + outFile); | log("Processing " + inFile + " to " + outFile); | ||||
| @@ -521,9 +521,8 @@ public class XSLTProcess extends MatchingTask implements XSLTLogger { | |||||
| Project.MSG_DEBUG); | Project.MSG_DEBUG); | ||||
| log("Style file " + xslFile + " time: " + styleSheetLastModified, | log("Style file " + xslFile + " time: " + styleSheetLastModified, | ||||
| Project.MSG_DEBUG); | Project.MSG_DEBUG); | ||||
| if (force || | |||||
| inFile.lastModified() > outFile.lastModified() || | |||||
| styleSheetLastModified > outFile.lastModified()) { | |||||
| if (force || inFile.lastModified() > outFile.lastModified() | |||||
| || styleSheetLastModified > outFile.lastModified()) { | |||||
| ensureDirectoryFor(outFile); | ensureDirectoryFor(outFile); | ||||
| log("Processing " + inFile + " to " + outFile, | log("Processing " + inFile + " to " + outFile, | ||||
| Project.MSG_INFO); | Project.MSG_INFO); | ||||
| @@ -275,7 +275,8 @@ public class XmlProperty extends org.apache.tools.ant.Task { | |||||
| factory.setValidating(validate); | factory.setValidating(validate); | ||||
| factory.setNamespaceAware(false); | factory.setNamespaceAware(false); | ||||
| Element topElement = factory.newDocumentBuilder().parse(configurationStream).getDocumentElement(); | |||||
| Element topElement | |||||
| = factory.newDocumentBuilder().parse(configurationStream).getDocumentElement(); | |||||
| // Keep a hashtable of attributes added by this task. | // Keep a hashtable of attributes added by this task. | ||||
| // This task is allow to override its own properties | // This task is allow to override its own properties | ||||
| @@ -110,9 +110,9 @@ public class CompilerAdapterFactory { | |||||
| if (compilerType.equalsIgnoreCase("extJavac")) { | if (compilerType.equalsIgnoreCase("extJavac")) { | ||||
| return new JavacExternal(); | return new JavacExternal(); | ||||
| } | } | ||||
| if (compilerType.equalsIgnoreCase("classic") || | |||||
| compilerType.equalsIgnoreCase("javac1.1") || | |||||
| compilerType.equalsIgnoreCase("javac1.2")) { | |||||
| if (compilerType.equalsIgnoreCase("classic") | |||||
| || compilerType.equalsIgnoreCase("javac1.1") | |||||
| || compilerType.equalsIgnoreCase("javac1.2")) { | |||||
| if (isClassicCompilerSupported) { | if (isClassicCompilerSupported) { | ||||
| return new Javac12(); | return new Javac12(); | ||||
| } else { | } else { | ||||
| @@ -125,9 +125,9 @@ public class CompilerAdapterFactory { | |||||
| } | } | ||||
| //on java<=1.3 the modern falls back to classic if it is not found | //on java<=1.3 the modern falls back to classic if it is not found | ||||
| //but on java>=1.4 we just bail out early | //but on java>=1.4 we just bail out early | ||||
| if (compilerType.equalsIgnoreCase("modern") || | |||||
| compilerType.equalsIgnoreCase("javac1.3") || | |||||
| compilerType.equalsIgnoreCase("javac1.4")) { | |||||
| if (compilerType.equalsIgnoreCase("modern") | |||||
| || compilerType.equalsIgnoreCase("javac1.3") | |||||
| || compilerType.equalsIgnoreCase("javac1.4")) { | |||||
| // does the modern compiler exist? | // does the modern compiler exist? | ||||
| if (doesModernCompilerExist()) { | if (doesModernCompilerExist()) { | ||||
| return new Javac13(); | return new Javac13(); | ||||
| @@ -148,8 +148,8 @@ public class CompilerAdapterFactory { | |||||
| } | } | ||||
| } | } | ||||
| if (compilerType.equalsIgnoreCase("jvc") || | |||||
| compilerType.equalsIgnoreCase("microsoft")) { | |||||
| if (compilerType.equalsIgnoreCase("jvc") | |||||
| || compilerType.equalsIgnoreCase("microsoft")) { | |||||
| return new Jvc(); | return new Jvc(); | ||||
| } | } | ||||
| if (compilerType.equalsIgnoreCase("kjc")) { | if (compilerType.equalsIgnoreCase("kjc")) { | ||||
| @@ -158,8 +158,8 @@ public class CompilerAdapterFactory { | |||||
| if (compilerType.equalsIgnoreCase("gcj")) { | if (compilerType.equalsIgnoreCase("gcj")) { | ||||
| return new Gcj(); | return new Gcj(); | ||||
| } | } | ||||
| if (compilerType.equalsIgnoreCase("sj") || | |||||
| compilerType.equalsIgnoreCase("symantec")) { | |||||
| if (compilerType.equalsIgnoreCase("sj") | |||||
| || compilerType.equalsIgnoreCase("symantec")) { | |||||
| return new Sj(); | return new Sj(); | ||||
| } | } | ||||
| return resolveClassName(compilerType); | return resolveClassName(compilerType); | ||||
| @@ -514,11 +514,11 @@ public abstract class DefaultCompilerAdapter implements CompilerAdapter { | |||||
| * @since Ant 1.5 | * @since Ant 1.5 | ||||
| */ | */ | ||||
| protected boolean assumeJava11() { | protected boolean assumeJava11() { | ||||
| return "javac1.1".equals(attributes.getCompilerVersion()) || | |||||
| ("classic".equals(attributes.getCompilerVersion()) | |||||
| && JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1)) || | |||||
| ("extJavac".equals(attributes.getCompilerVersion()) | |||||
| && JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1)); | |||||
| return "javac1.1".equals(attributes.getCompilerVersion()) | |||||
| || ("classic".equals(attributes.getCompilerVersion()) | |||||
| && JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1)) | |||||
| || ("extJavac".equals(attributes.getCompilerVersion()) | |||||
| && JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1)); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -526,11 +526,11 @@ public abstract class DefaultCompilerAdapter implements CompilerAdapter { | |||||
| * @since Ant 1.5 | * @since Ant 1.5 | ||||
| */ | */ | ||||
| protected boolean assumeJava12() { | protected boolean assumeJava12() { | ||||
| return "javac1.2".equals(attributes.getCompilerVersion()) || | |||||
| ("classic".equals(attributes.getCompilerVersion()) | |||||
| && JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_2)) || | |||||
| ("extJavac".equals(attributes.getCompilerVersion()) | |||||
| && JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_2)); | |||||
| return "javac1.2".equals(attributes.getCompilerVersion()) | |||||
| || ("classic".equals(attributes.getCompilerVersion()) | |||||
| && JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_2)) | |||||
| || ("extJavac".equals(attributes.getCompilerVersion()) | |||||
| && JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_2)); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -538,13 +538,13 @@ public abstract class DefaultCompilerAdapter implements CompilerAdapter { | |||||
| * @since Ant 1.5 | * @since Ant 1.5 | ||||
| */ | */ | ||||
| protected boolean assumeJava13() { | protected boolean assumeJava13() { | ||||
| return "javac1.3".equals(attributes.getCompilerVersion()) || | |||||
| ("classic".equals(attributes.getCompilerVersion()) | |||||
| && JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_3)) || | |||||
| ("modern".equals(attributes.getCompilerVersion()) | |||||
| && JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_3)) || | |||||
| ("extJavac".equals(attributes.getCompilerVersion()) | |||||
| && JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_3)); | |||||
| return "javac1.3".equals(attributes.getCompilerVersion()) | |||||
| || ("classic".equals(attributes.getCompilerVersion()) | |||||
| && JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_3)) | |||||
| || ("modern".equals(attributes.getCompilerVersion()) | |||||
| && JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_3)) | |||||
| || ("extJavac".equals(attributes.getCompilerVersion()) | |||||
| && JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_3)); | |||||
| } | } | ||||
| } | } | ||||
| @@ -224,11 +224,11 @@ public class Os implements Condition { | |||||
| isFamily = pathSep.equals(":") | isFamily = pathSep.equals(":") | ||||
| && (!isFamily("mac") || osName.endsWith("x")); | && (!isFamily("mac") || osName.endsWith("x")); | ||||
| } else if (family.equals("win9x")) { | } else if (family.equals("win9x")) { | ||||
| isFamily = isFamily("windows") && | |||||
| (osName.indexOf("95") >= 0 || | |||||
| osName.indexOf("98") >= 0 || | |||||
| osName.indexOf("me") >= 0 || | |||||
| osName.indexOf("ce") >= 0); | |||||
| isFamily = isFamily("windows") | |||||
| && (osName.indexOf("95") >= 0 | |||||
| || osName.indexOf("98") >= 0 | |||||
| || osName.indexOf("me") >= 0 | |||||
| || osName.indexOf("ce") >= 0); | |||||
| } else if (family.equals("z/os")) { | } else if (family.equals("z/os")) { | ||||
| isFamily = osName.indexOf("z/os") > -1 | isFamily = osName.indexOf("z/os") > -1 | ||||
| || osName.indexOf("os/390") > -1; | || osName.indexOf("os/390") > -1; | ||||
| @@ -84,7 +84,7 @@ public abstract class Mailer { | |||||
| /** | /** | ||||
| * Sets the mail server | * Sets the mail server | ||||
| * | * | ||||
| * @param host | |||||
| * @param host the mail server name | |||||
| */ | */ | ||||
| public void setHost(String host) { | public void setHost(String host) { | ||||
| this.host = host; | this.host = host; | ||||
| @@ -94,7 +94,7 @@ public abstract class Mailer { | |||||
| /** | /** | ||||
| * Sets the smtp port | * Sets the smtp port | ||||
| * | * | ||||
| * @param port | |||||
| * @param port the SMTP port | |||||
| */ | */ | ||||
| public void setPort(int port) { | public void setPort(int port) { | ||||
| this.port = port; | this.port = port; | ||||
| @@ -103,7 +103,7 @@ public abstract class Mailer { | |||||
| /** | /** | ||||
| * Sets the user for smtp auth | * Sets the user for smtp auth | ||||
| * | * | ||||
| * @param user | |||||
| * @param user the username | |||||
| * @since ant 1.6 | * @since ant 1.6 | ||||
| */ | */ | ||||
| public void setUser(String user) { | public void setUser(String user) { | ||||
| @@ -113,7 +113,7 @@ public abstract class Mailer { | |||||
| /** | /** | ||||
| * Sets the password for smtp auth | * Sets the password for smtp auth | ||||
| * | * | ||||
| * @param password | |||||
| * @param password the authentication password | |||||
| * @since ant 1.6 | * @since ant 1.6 | ||||
| */ | */ | ||||
| public void setPassword(String password) { | public void setPassword(String password) { | ||||
| @@ -123,7 +123,7 @@ public abstract class Mailer { | |||||
| /** | /** | ||||
| * Sets whether the user wants to send the mail through SSL | * Sets whether the user wants to send the mail through SSL | ||||
| * | * | ||||
| * @param SSL | |||||
| * @param SSL if true use SSL transport | |||||
| * @since ant 1.6 | * @since ant 1.6 | ||||
| */ | */ | ||||
| public void setSSL(boolean SSL) { | public void setSSL(boolean SSL) { | ||||
| @@ -133,7 +133,7 @@ public abstract class Mailer { | |||||
| /** | /** | ||||
| * Sets the message | * Sets the message | ||||
| * | * | ||||
| * @param m | |||||
| * @param m the message content | |||||
| */ | */ | ||||
| public void setMessage(Message m) { | public void setMessage(Message m) { | ||||
| this.message = m; | this.message = m; | ||||
| @@ -143,7 +143,7 @@ public abstract class Mailer { | |||||
| /** | /** | ||||
| * Sets the address to send from | * Sets the address to send from | ||||
| * | * | ||||
| * @param from | |||||
| * @param from the sender | |||||
| */ | */ | ||||
| public void setFrom(EmailAddress from) { | public void setFrom(EmailAddress from) { | ||||
| this.from = from; | this.from = from; | ||||
| @@ -153,7 +153,7 @@ public abstract class Mailer { | |||||
| /** | /** | ||||
| * Sets the replyto addresses | * Sets the replyto addresses | ||||
| * | * | ||||
| * @param list | |||||
| * @param list a vector of reployTo addresses | |||||
| * @since ant 1.6 | * @since ant 1.6 | ||||
| */ | */ | ||||
| public void setReplyToList(Vector list) { | public void setReplyToList(Vector list) { | ||||
| @@ -164,7 +164,7 @@ public abstract class Mailer { | |||||
| /** | /** | ||||
| * Set the to addresses | * Set the to addresses | ||||
| * | * | ||||
| * @param list | |||||
| * @param list a vector of recipient addresses | |||||
| */ | */ | ||||
| public void setToList(Vector list) { | public void setToList(Vector list) { | ||||
| this.toList = list; | this.toList = list; | ||||
| @@ -174,7 +174,7 @@ public abstract class Mailer { | |||||
| /** | /** | ||||
| * Sets the cc addresses | * Sets the cc addresses | ||||
| * | * | ||||
| * @param list | |||||
| * @param list a vector of cc addresses | |||||
| */ | */ | ||||
| public void setCcList(Vector list) { | public void setCcList(Vector list) { | ||||
| this.ccList = list; | this.ccList = list; | ||||
| @@ -184,7 +184,7 @@ public abstract class Mailer { | |||||
| /** | /** | ||||
| * Sets the bcc addresses | * Sets the bcc addresses | ||||
| * | * | ||||
| * @param list | |||||
| * @param list a vector of the bcc addresses | |||||
| */ | */ | ||||
| public void setBccList(Vector list) { | public void setBccList(Vector list) { | ||||
| this.bccList = list; | this.bccList = list; | ||||
| @@ -194,7 +194,7 @@ public abstract class Mailer { | |||||
| /** | /** | ||||
| * Sets the files to attach | * Sets the files to attach | ||||
| * | * | ||||
| * @param files | |||||
| * @param files list of files to attach to the email. | |||||
| */ | */ | ||||
| public void setFiles(Vector files) { | public void setFiles(Vector files) { | ||||
| this.files = files; | this.files = files; | ||||
| @@ -204,7 +204,7 @@ public abstract class Mailer { | |||||
| /** | /** | ||||
| * Sets the subject | * Sets the subject | ||||
| * | * | ||||
| * @param subject | |||||
| * @param subject the subject line | |||||
| */ | */ | ||||
| public void setSubject(String subject) { | public void setSubject(String subject) { | ||||
| this.subject = subject; | this.subject = subject; | ||||
| @@ -214,7 +214,7 @@ public abstract class Mailer { | |||||
| /** | /** | ||||
| * Sets the owning task | * Sets the owning task | ||||
| * | * | ||||
| * @param task | |||||
| * @param task the owning task instance | |||||
| */ | */ | ||||
| public void setTask(Task task) { | public void setTask(Task task) { | ||||
| this.task = task; | this.task = task; | ||||
| @@ -224,7 +224,7 @@ public abstract class Mailer { | |||||
| /** | /** | ||||
| * Indicates whether filenames should be listed in the body | * Indicates whether filenames should be listed in the body | ||||
| * | * | ||||
| * @param b | |||||
| * @param b if true list attached file names in the body content. | |||||
| */ | */ | ||||
| public void setIncludeFileNames(boolean b) { | public void setIncludeFileNames(boolean b) { | ||||
| this.includeFileNames = b; | this.includeFileNames = b; | ||||
| @@ -234,7 +234,7 @@ public abstract class Mailer { | |||||
| /** | /** | ||||
| * This method should send the email | * This method should send the email | ||||
| * | * | ||||
| * @throws BuildException | |||||
| * @throws BuildException if the email can't be sent. | |||||
| */ | */ | ||||
| public abstract void send() | public abstract void send() | ||||
| throws BuildException; | throws BuildException; | ||||
| @@ -243,6 +243,8 @@ public abstract class Mailer { | |||||
| * Returns the current Date in a format suitable for a SMTP date | * Returns the current Date in a format suitable for a SMTP date | ||||
| * header. | * header. | ||||
| * | * | ||||
| * @return the current date in SMTP suitable format. | |||||
| * | |||||
| * @since Ant 1.5 | * @since Ant 1.5 | ||||
| */ | */ | ||||
| protected final String getDate() { | protected final String getDate() { | ||||
| @@ -146,7 +146,7 @@ public class Message extends ProjectComponent { | |||||
| /** | /** | ||||
| * Prints the message onto an output stream | * Prints the message onto an output stream | ||||
| * | * | ||||
| * @param out The print stream to write to | |||||
| * @param ps The print stream to write to | |||||
| * @throws IOException if an error occurs | * @throws IOException if an error occurs | ||||
| */ | */ | ||||
| public void print(PrintStream ps) | public void print(PrintStream ps) | ||||
| @@ -798,7 +798,8 @@ public class IContract extends MatchingTask { | |||||
| if (targetPrinter != null) { | if (targetPrinter != null) { | ||||
| targetPrinter.println(srcFile.getAbsolutePath()); | targetPrinter.println(srcFile.getAbsolutePath()); | ||||
| } | } | ||||
| File classFile = new File(buildDir, files[i].substring(0, files[i].indexOf(".java")) + ".class"); | |||||
| File classFile | |||||
| = new File(buildDir, files[i].substring(0, files[i].indexOf(".java")) + ".class"); | |||||
| if (srcFile.lastModified() > now) { | if (srcFile.lastModified() > now) { | ||||
| log("Warning: file modified in the future: " | log("Warning: file modified in the future: " | ||||
| @@ -119,7 +119,8 @@ import org.apache.tools.ant.util.regexp.Regexp; | |||||
| * | * | ||||
| * Attributes: | * Attributes: | ||||
| * | * | ||||
| * file --> A single file to operation on (mutually exclusive with the fileset subelements) | |||||
| * file --> A single file to operation on (mutually exclusive | |||||
| * with the fileset subelements) | |||||
| * match --> The Regular expression to match | * match --> The Regular expression to match | ||||
| * replace --> The Expression replacement string | * replace --> The Expression replacement string | ||||
| * flags --> The options to give to the replacement | * flags --> The options to give to the replacement | ||||
| @@ -305,7 +305,8 @@ public class CCCheckin extends ClearCase { | |||||
| /** | /** | ||||
| * Get the 'comment' command | * Get the 'comment' command | ||||
| * | * | ||||
| * @param cmd containing the command line string with or without the comment flag and string appended | |||||
| * @param cmd containing the command line string with or | |||||
| * without the comment flag and string appended | |||||
| */ | */ | ||||
| private void getCommentCommand(Commandline cmd) { | private void getCommentCommand(Commandline cmd) { | ||||
| if (getComment() != null) { | if (getComment() != null) { | ||||
| @@ -322,7 +323,8 @@ public class CCCheckin extends ClearCase { | |||||
| /** | /** | ||||
| * Get the 'commentfile' command | * Get the 'commentfile' command | ||||
| * | * | ||||
| * @param cmd containing the command line string with or without the commentfile flag and file appended | |||||
| * @param cmd containing the command line string with or | |||||
| * without the commentfile flag and file appended | |||||
| */ | */ | ||||
| private void getCommentFileCommand(Commandline cmd) { | private void getCommentFileCommand(Commandline cmd) { | ||||
| if (getCommentFile() != null) { | if (getCommentFile() != null) { | ||||
| @@ -367,9 +367,11 @@ public class CCCheckout extends ClearCase { | |||||
| /** | /** | ||||
| * Get the 'out' command | * Get the 'out' command | ||||
| * | * | ||||
| * @return the 'out' command if the attribute was specified, otherwise an empty string | |||||
| * @return the 'out' command if the attribute was specified, | |||||
| * otherwise an empty string | |||||
| * | * | ||||
| * @param CommandLine containing the command line string with or without the out flag and path appended | |||||
| * @param CommandLine containing the command line string with or | |||||
| * without the out flag and path appended | |||||
| */ | */ | ||||
| private void getOutCommand(Commandline cmd) { | private void getOutCommand(Commandline cmd) { | ||||
| if (getOut() != null) { | if (getOut() != null) { | ||||
| @@ -386,9 +388,11 @@ public class CCCheckout extends ClearCase { | |||||
| /** | /** | ||||
| * Get the 'branch' command | * Get the 'branch' command | ||||
| * | * | ||||
| * @return the 'branch' command if the attribute was specified, otherwise an empty string | |||||
| * @return the 'branch' command if the attribute was specified, | |||||
| * otherwise an empty string | |||||
| * | * | ||||
| * @param CommandLine containing the command line string with or without the branch flag and name appended | |||||
| * @param CommandLine containing the command line string with or | |||||
| without the branch flag and name appended | |||||
| */ | */ | ||||
| private void getBranchCommand(Commandline cmd) { | private void getBranchCommand(Commandline cmd) { | ||||
| if (getBranch() != null) { | if (getBranch() != null) { | ||||
| @@ -406,9 +410,11 @@ public class CCCheckout extends ClearCase { | |||||
| /** | /** | ||||
| * Get the 'comment' command | * Get the 'comment' command | ||||
| * | * | ||||
| * @return the 'comment' command if the attribute was specified, otherwise an empty string | |||||
| * @return the 'comment' command if the attribute was specified, | |||||
| * otherwise an empty string | |||||
| * | * | ||||
| * @param CommandLine containing the command line string with or without the comment flag and string appended | |||||
| * @param CommandLine containing the command line string with or | |||||
| * without the comment flag and string appended | |||||
| */ | */ | ||||
| private void getCommentCommand(Commandline cmd) { | private void getCommentCommand(Commandline cmd) { | ||||
| if (getComment() != null) { | if (getComment() != null) { | ||||
| @@ -425,9 +431,11 @@ public class CCCheckout extends ClearCase { | |||||
| /** | /** | ||||
| * Get the 'cfile' command | * Get the 'cfile' command | ||||
| * | * | ||||
| * @return the 'cfile' command if the attribute was specified, otherwise an empty string | |||||
| * @return the 'cfile' command if the attribute was specified, | |||||
| * otherwise an empty string | |||||
| * | * | ||||
| * @param CommandLine containing the command line string with or without the cfile flag and file appended | |||||
| * @param CommandLine containing the command line string with or | |||||
| * without the cfile flag and file appended | |||||
| */ | */ | ||||
| private void getCommentFileCommand(Commandline cmd) { | private void getCommentFileCommand(Commandline cmd) { | ||||
| if (getCommentFile() != null) { | if (getCommentFile() != null) { | ||||
| @@ -288,7 +288,8 @@ private void checkOptions(Commandline cmd) { | |||||
| /** | /** | ||||
| * Get the 'nusers' command | * Get the 'nusers' command | ||||
| * | * | ||||
| * @param cmd containing the command line string with or without the nusers flag and value appended | |||||
| * @param cmd containing the command line string with or | |||||
| * without the nusers flag and value appended | |||||
| */ | */ | ||||
| private void getNusersCommand(Commandline cmd) { | private void getNusersCommand(Commandline cmd) { | ||||
| if (getNusers() == null) { | if (getNusers() == null) { | ||||
| @@ -307,7 +308,8 @@ private void checkOptions(Commandline cmd) { | |||||
| /** | /** | ||||
| * Get the 'comment' command | * Get the 'comment' command | ||||
| * | * | ||||
| * @param cmd containing the command line string with or without the comment flag and value appended | |||||
| * @param cmd containing the command line string with or without the | |||||
| * comment flag and value appended | |||||
| */ | */ | ||||
| private void getCommentCommand(Commandline cmd) { | private void getCommentCommand(Commandline cmd) { | ||||
| if (getComment() == null) { | if (getComment() == null) { | ||||
| @@ -326,7 +328,8 @@ private void checkOptions(Commandline cmd) { | |||||
| /** | /** | ||||
| * Get the 'pname' command | * Get the 'pname' command | ||||
| * | * | ||||
| * @param cmd containing the command line string with or without the pname flag and value appended | |||||
| * @param cmd containing the command line string with or | |||||
| * without the pname flag and value appended | |||||
| */ | */ | ||||
| private void getPnameCommand(Commandline cmd) { | private void getPnameCommand(Commandline cmd) { | ||||
| if (getPname() == null) { | if (getPname() == null) { | ||||
| @@ -345,7 +348,8 @@ private void checkOptions(Commandline cmd) { | |||||
| /** | /** | ||||
| * Get the 'pname' command | * Get the 'pname' command | ||||
| * | * | ||||
| * @param cmd containing the command line string with or without the pname flag and value appended | |||||
| * @param cmd containing the command line string with or | |||||
| * without the pname flag and value appended | |||||
| */ | */ | ||||
| private void getObjselectCommand(Commandline cmd) { | private void getObjselectCommand(Commandline cmd) { | ||||
| if (getObjselect() == null) { | if (getObjselect() == null) { | ||||
| @@ -323,9 +323,11 @@ public class CCMkbl extends ClearCase { | |||||
| /** | /** | ||||
| * Get the 'comment' command | * Get the 'comment' command | ||||
| * | * | ||||
| * @return the 'comment' command if the attribute was specified, otherwise an empty string | |||||
| * @return the 'comment' command if the attribute was specified, | |||||
| * otherwise an empty string | |||||
| * | * | ||||
| * @param CommandLine containing the command line string with or without the comment flag and string appended | |||||
| * @param CommandLine containing the command line string with or | |||||
| * without the comment flag and string appended | |||||
| */ | */ | ||||
| private void getCommentCommand(Commandline cmd) { | private void getCommentCommand(Commandline cmd) { | ||||
| if (getComment() != null) { | if (getComment() != null) { | ||||
| @@ -342,9 +344,11 @@ public class CCMkbl extends ClearCase { | |||||
| /** | /** | ||||
| * Get the 'commentfile' command | * Get the 'commentfile' command | ||||
| * | * | ||||
| * @return the 'commentfile' command if the attribute was specified, otherwise an empty string | |||||
| * @return the 'commentfile' command if the attribute was specified, | |||||
| * otherwise an empty string | |||||
| * | * | ||||
| * @param CommandLine containing the command line string with or without the commentfile flag and file appended | |||||
| * @param cmd CommandLine containing the command line string with or | |||||
| * without the commentfile flag and file appended | |||||
| */ | */ | ||||
| private void getCommentFileCommand(Commandline cmd) { | private void getCommentFileCommand(Commandline cmd) { | ||||
| if (getCommentFile() != null) { | if (getCommentFile() != null) { | ||||
| @@ -204,8 +204,8 @@ public class CCMklabel extends ClearCase { | |||||
| * | * | ||||
| * @param replace the status to set the flag to | * @param replace the status to set the flag to | ||||
| */ | */ | ||||
| public void setReplace(boolean repl) { | |||||
| m_Replace = repl; | |||||
| public void setReplace(boolean replace) { | |||||
| m_Replace = replace; | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -240,8 +240,8 @@ public class CCMklabel extends ClearCase { | |||||
| * | * | ||||
| * @param version the status to set the flag to | * @param version the status to set the flag to | ||||
| */ | */ | ||||
| public void setVersion(String ver) { | |||||
| m_Version = ver; | |||||
| public void setVersion(String version) { | |||||
| m_Version = version; | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -328,9 +328,11 @@ public class CCMklabel extends ClearCase { | |||||
| /** | /** | ||||
| * Get the 'version' command | * Get the 'version' command | ||||
| * | * | ||||
| * @return the 'version' command if the attribute was specified, otherwise an empty string | |||||
| * @return the 'version' command if the attribute was specified, | |||||
| * otherwise an empty string | |||||
| * | * | ||||
| * @param CommandLine containing the command line string with or without the version flag and string appended | |||||
| * @param cmd CommandLine containing the command line string with or | |||||
| * without the version flag and string appended | |||||
| */ | */ | ||||
| private void getVersionCommand(Commandline cmd) { | private void getVersionCommand(Commandline cmd) { | ||||
| if (getVersion() != null) { | if (getVersion() != null) { | ||||
| @@ -347,9 +349,11 @@ public class CCMklabel extends ClearCase { | |||||
| /** | /** | ||||
| * Get the 'comment' command | * Get the 'comment' command | ||||
| * | * | ||||
| * @return the 'comment' command if the attribute was specified, otherwise an empty string | |||||
| * @return the 'comment' command if the attribute was | |||||
| * specified, otherwise an empty string | |||||
| * | * | ||||
| * @param CommandLine containing the command line string with or without the comment flag and string appended | |||||
| * @param CommandLine containing the command line string with or | |||||
| * without the comment flag and string appended | |||||
| */ | */ | ||||
| private void getCommentCommand(Commandline cmd) { | private void getCommentCommand(Commandline cmd) { | ||||
| if (getComment() != null) { | if (getComment() != null) { | ||||
| @@ -366,9 +370,11 @@ public class CCMklabel extends ClearCase { | |||||
| /** | /** | ||||
| * Get the 'commentfile' command | * Get the 'commentfile' command | ||||
| * | * | ||||
| * @return the 'commentfile' command if the attribute was specified, otherwise an empty string | |||||
| * @return the 'commentfile' command if the attribute was specified, | |||||
| * otherwise an empty string | |||||
| * | * | ||||
| * @param CommandLine containing the command line string with or without the commentfile flag and file appended | |||||
| * @param CommandLine containing the command line string with or | |||||
| * without the commentfile flag and file appended | |||||
| */ | */ | ||||
| private void getCommentFileCommand(Commandline cmd) { | private void getCommentFileCommand(Commandline cmd) { | ||||
| if (getCommentFile() != null) { | if (getCommentFile() != null) { | ||||
| @@ -385,9 +391,11 @@ public class CCMklabel extends ClearCase { | |||||
| /** | /** | ||||
| * Get the type-name | * Get the type-name | ||||
| * | * | ||||
| * @return the 'type-name-specifier' command if the attribute was specified, otherwise an empty string | |||||
| * @return the 'type-name-specifier' command if the attribute | |||||
| * was specified, otherwise an empty string | |||||
| * | * | ||||
| * @param CommandLine containing the command line string with or without the type-name | |||||
| * @param CommandLine containing the command line string with or | |||||
| * without the type-name | |||||
| */ | */ | ||||
| private void getTypeCommand(Commandline cmd) { | private void getTypeCommand(Commandline cmd) { | ||||
| String typenm = null; | String typenm = null; | ||||
| @@ -85,22 +85,28 @@ import org.apache.tools.ant.types.Commandline; | |||||
| * <tr> | * <tr> | ||||
| * <tr> | * <tr> | ||||
| * <td>global</td> | * <td>global</td> | ||||
| * <td>Either global or ordinary can be specified, not both. Creates a label type that is global to the VOB or to VOBs that use this VOB</td> | |||||
| * <td>Either global or ordinary can be specified, not both. | |||||
| * Creates a label type that is global to the VOB or to | |||||
| * VOBs that use this VOB</td> | |||||
| * <td>No</td> | * <td>No</td> | ||||
| * <tr> | * <tr> | ||||
| * <tr> | * <tr> | ||||
| * <td>ordinary</td> | * <td>ordinary</td> | ||||
| * <td>Either global or ordinary can be specified, not both. Creates a label type that can be used only in the current VOB. <B>Default</B></td> | |||||
| * <td>Either global or ordinary can be specified, not both. | |||||
| * Creates a label type that can be used only in the current | |||||
| * VOB. <B>Default</B></td> | |||||
| * <td>No</td> | * <td>No</td> | ||||
| * <tr> | * <tr> | ||||
| * <tr> | * <tr> | ||||
| * <td>pbranch</td> | * <td>pbranch</td> | ||||
| * <td>Allows the label type to be used once per branch in a given element's version tree</td> | |||||
| * <td>Allows the label type to be used once per branch in a given | |||||
| * element's version tree</td> | |||||
| * <td>No</td> | * <td>No</td> | ||||
| * <tr> | * <tr> | ||||
| * <tr> | * <tr> | ||||
| * <td>shared</td> | * <td>shared</td> | ||||
| * <td>Sets the way mastership is checked by ClearCase. See ClearCase documentation for details</td> | |||||
| * <td>Sets the way mastership is checked by ClearCase. See ClearCase | |||||
| * documentation for details</td> | |||||
| * <td>No</td> | * <td>No</td> | ||||
| * <tr> | * <tr> | ||||
| * <tr> | * <tr> | ||||
| @@ -110,7 +116,8 @@ import org.apache.tools.ant.types.Commandline; | |||||
| * <tr> | * <tr> | ||||
| * <tr> | * <tr> | ||||
| * <td>commentfile</td> | * <td>commentfile</td> | ||||
| * <td>Specify a file containing a comment. Only one of comment or cfile may be used.</td> | |||||
| * <td>Specify a file containing a comment. Only one of comment or | |||||
| * cfile may be used.</td> | |||||
| * <td>No</td> | * <td>No</td> | ||||
| * <tr> | * <tr> | ||||
| * </table> | * </table> | ||||
| @@ -319,8 +326,8 @@ public class CCMklbtype extends ClearCase { | |||||
| * | * | ||||
| * @param shared the status to set the flag to | * @param shared the status to set the flag to | ||||
| */ | */ | ||||
| public void setShared(boolean shar) { | |||||
| m_Shared = shar; | |||||
| public void setShared(boolean shared) { | |||||
| m_Shared = shared; | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -372,9 +379,11 @@ public class CCMklbtype extends ClearCase { | |||||
| /** | /** | ||||
| * Get the 'comment' command | * Get the 'comment' command | ||||
| * | * | ||||
| * @return the 'comment' command if the attribute was specified, otherwise an empty string | |||||
| * @return the 'comment' command if the attribute was specified, | |||||
| * otherwise an empty string | |||||
| * | * | ||||
| * @param CommandLine containing the command line string with or without the comment flag and string appended | |||||
| * @param CommandLine containing the command line string with or | |||||
| * without the comment flag and string appended | |||||
| */ | */ | ||||
| private void getCommentCommand(Commandline cmd) { | private void getCommentCommand(Commandline cmd) { | ||||
| if (getComment() != null) { | if (getComment() != null) { | ||||
| @@ -391,9 +400,11 @@ public class CCMklbtype extends ClearCase { | |||||
| /** | /** | ||||
| * Get the 'commentfile' command | * Get the 'commentfile' command | ||||
| * | * | ||||
| * @return the 'commentfile' command if the attribute was specified, otherwise an empty string | |||||
| * @return the 'commentfile' command if the attribute was specified, | |||||
| * otherwise an empty string | |||||
| * | * | ||||
| * @param CommandLine containing the command line string with or without the commentfile flag and file appended | |||||
| * @param CommandLine containing the command line string with or | |||||
| * without the commentfile flag and file appended | |||||
| */ | */ | ||||
| private void getCommentFileCommand(Commandline cmd) { | private void getCommentFileCommand(Commandline cmd) { | ||||
| if (getCommentFile() != null) { | if (getCommentFile() != null) { | ||||
| @@ -410,9 +421,11 @@ public class CCMklbtype extends ClearCase { | |||||
| /** | /** | ||||
| * Get the type-name specifier | * Get the type-name specifier | ||||
| * | * | ||||
| * @return the 'type-name-specifier' command if the attribute was specified, otherwise an empty string | |||||
| * @return the 'type-name-specifier' command if the attribute was | |||||
| * specified, otherwise an empty string | |||||
| * | * | ||||
| * @param CommandLine containing the command line string with or without the type-name | |||||
| * @param CommandLine containing the command line string with or | |||||
| * without the type-name | |||||
| */ | */ | ||||
| private String getTypeSpecifier() { | private String getTypeSpecifier() { | ||||
| String typenm = null; | String typenm = null; | ||||
| @@ -92,7 +92,8 @@ import org.apache.tools.ant.types.Commandline; | |||||
| * <tr> | * <tr> | ||||
| * <tr> | * <tr> | ||||
| * <td>ignore</td> | * <td>ignore</td> | ||||
| * <td>Used with trigger types only. Forces removal of trigger type even if a pre-operation trigger would prevent its removal</td> | |||||
| * <td>Used with trigger types only. Forces removal of trigger type | |||||
| * even if a pre-operation trigger would prevent its removal</td> | |||||
| * <td>No</td> | * <td>No</td> | ||||
| * <tr> | * <tr> | ||||
| * <tr> | * <tr> | ||||
| @@ -107,7 +108,8 @@ import org.apache.tools.ant.types.Commandline; | |||||
| * <tr> | * <tr> | ||||
| * <tr> | * <tr> | ||||
| * <td>commentfile</td> | * <td>commentfile</td> | ||||
| * <td>Specify a file containing a comment. Only one of comment or cfile may be used.</td> | |||||
| * <td>Specify a file containing a comment. Only one of comment or cfile | |||||
| * may be used.</td> | |||||
| * <td>No</td> | * <td>No</td> | ||||
| * <tr> | * <tr> | ||||
| * </table> | * </table> | ||||
| @@ -336,9 +338,11 @@ public class CCRmtype extends ClearCase { | |||||
| /** | /** | ||||
| * Get the 'comment' command | * Get the 'comment' command | ||||
| * | * | ||||
| * @return the 'comment' command if the attribute was specified, otherwise an empty string | |||||
| * @return the 'comment' command if the attribute was specified, | |||||
| * otherwise an empty string | |||||
| * | * | ||||
| * @param CommandLine containing the command line string with or without the comment flag and string appended | |||||
| * @param CommandLine containing the command line string with or | |||||
| * without the comment flag and string appended | |||||
| */ | */ | ||||
| private void getCommentCommand(Commandline cmd) { | private void getCommentCommand(Commandline cmd) { | ||||
| if (getComment() != null) { | if (getComment() != null) { | ||||
| @@ -355,9 +359,11 @@ public class CCRmtype extends ClearCase { | |||||
| /** | /** | ||||
| * Get the 'commentfile' command | * Get the 'commentfile' command | ||||
| * | * | ||||
| * @return the 'commentfile' command if the attribute was specified, otherwise an empty string | |||||
| * @return the 'commentfile' command if the attribute was specified, | |||||
| * otherwise an empty string | |||||
| * | * | ||||
| * @param CommandLine containing the command line string with or without the commentfile flag and file appended | |||||
| * @param CommandLine containing the command line string with or | |||||
| * without the commentfile flag and file appended | |||||
| */ | */ | ||||
| private void getCommentFileCommand(Commandline cmd) { | private void getCommentFileCommand(Commandline cmd) { | ||||
| if (getCommentFile() != null) { | if (getCommentFile() != null) { | ||||
| @@ -203,7 +203,8 @@ private void checkOptions(Commandline cmd) { | |||||
| /** | /** | ||||
| * Get the 'comment' command | * Get the 'comment' command | ||||
| * | * | ||||
| * @param cmd containing the command line string with or without the comment flag and value appended | |||||
| * @param cmd containing the command line string with or without the | |||||
| * comment flag and value appended | |||||
| */ | */ | ||||
| private void getCommentCommand(Commandline cmd) { | private void getCommentCommand(Commandline cmd) { | ||||
| if (getComment() == null) { | if (getComment() == null) { | ||||
| @@ -222,7 +223,8 @@ private void checkOptions(Commandline cmd) { | |||||
| /** | /** | ||||
| * Get the 'pname' command | * Get the 'pname' command | ||||
| * | * | ||||
| * @param cmd containing the command line string with or without the pname flag and value appended | |||||
| * @param cmd containing the command line string with or without the | |||||
| * pname flag and value appended | |||||
| */ | */ | ||||
| private void getPnameCommand(Commandline cmd) { | private void getPnameCommand(Commandline cmd) { | ||||
| if (getPname() == null) { | if (getPname() == null) { | ||||
| @@ -241,7 +243,8 @@ private void checkOptions(Commandline cmd) { | |||||
| /** | /** | ||||
| * Get the 'pname' command | * Get the 'pname' command | ||||
| * | * | ||||
| * @param cmd containing the command line string with or without the pname flag and value appended | |||||
| * @param cmd containing the command line string with or without | |||||
| * the pname flag and value appended | |||||
| */ | */ | ||||
| private void getObjselectCommand(Commandline cmd) { | private void getObjselectCommand(Commandline cmd) { | ||||
| if (getObjselect() == null) { | if (getObjselect() == null) { | ||||
| @@ -100,12 +100,14 @@ import org.apache.tools.ant.types.Commandline; | |||||
| * <tr> | * <tr> | ||||
| * <tr> | * <tr> | ||||
| * <td>currenttime</td> | * <td>currenttime</td> | ||||
| * <td>Specifies that modification time should be written as the current time. Either currenttime or preservetime can be specified.</td> | |||||
| * <td>Specifies that modification time should be written as the current | |||||
| * time. Either currenttime or preservetime can be specified.</td> | |||||
| * <td>No</td> | * <td>No</td> | ||||
| * <tr> | * <tr> | ||||
| * <tr> | * <tr> | ||||
| * <td>preservetime</td> | * <td>preservetime</td> | ||||
| * <td>Specifies that modification time should preserved from the VOB time. Either currenttime or preservetime can be specified.</td> | |||||
| * <td>Specifies that modification time should preserved from the VOB | |||||
| * time. Either currenttime or preservetime can be specified.</td> | |||||
| * <td>No</td> | * <td>No</td> | ||||
| * <tr> | * <tr> | ||||
| * </table> | * </table> | ||||
| @@ -147,7 +147,8 @@ public abstract class ClearCase extends Task { | |||||
| protected int run(Commandline cmd) { | protected int run(Commandline cmd) { | ||||
| try { | try { | ||||
| Project aProj = getProject(); | Project aProj = getProject(); | ||||
| Execute exe = new Execute(new LogStreamHandler(this, Project.MSG_INFO, Project.MSG_WARN)); | |||||
| Execute exe | |||||
| = new Execute(new LogStreamHandler(this, Project.MSG_INFO, Project.MSG_WARN)); | |||||
| exe.setAntRun(aProj); | exe.setAntRun(aProj); | ||||
| exe.setWorkingDirectory(aProj.getBaseDir()); | exe.setWorkingDirectory(aProj.getBaseDir()); | ||||
| exe.setCommandline(cmd.getCommandline()); | exe.setCommandline(cmd.getCommandline()); | ||||
| @@ -412,7 +412,8 @@ public class Depend extends MatchingTask { | |||||
| if (!dependency.startsWith("java.") | if (!dependency.startsWith("java.") | ||||
| && !dependency.startsWith("javax.")) { | && !dependency.startsWith("javax.")) { | ||||
| URL classURL = loader.getResource(dependency.replace('.', '/') + ".class"); | |||||
| URL classURL | |||||
| = loader.getResource(dependency.replace('.', '/') + ".class"); | |||||
| if (classURL != null) { | if (classURL != null) { | ||||
| if (classURL.getProtocol().equals("jar")) { | if (classURL.getProtocol().equals("jar")) { | ||||
| String jarFilePath = classURL.getFile(); | String jarFilePath = classURL.getFile(); | ||||
| @@ -524,8 +525,8 @@ public class Depend extends MatchingTask { | |||||
| Project.MSG_VERBOSE); | Project.MSG_VERBOSE); | ||||
| ClassFileInfo topLevelClassInfo | ClassFileInfo topLevelClassInfo | ||||
| = (ClassFileInfo) classFileInfoMap.get(topLevelClassName); | = (ClassFileInfo) classFileInfoMap.get(topLevelClassName); | ||||
| if (topLevelClassInfo != null && | |||||
| topLevelClassInfo.absoluteFile.exists()) { | |||||
| if (topLevelClassInfo != null | |||||
| && topLevelClassInfo.absoluteFile.exists()) { | |||||
| log("Deleting file " | log("Deleting file " | ||||
| + topLevelClassInfo.absoluteFile.getPath() | + topLevelClassInfo.absoluteFile.getPath() | ||||
| + " since one of its inner classes was removed", | + " since one of its inner classes was removed", | ||||
| @@ -618,7 +619,8 @@ public class Depend extends MatchingTask { | |||||
| if (classpathFile.lastModified() | if (classpathFile.lastModified() | ||||
| > info.absoluteFile.lastModified()) { | > info.absoluteFile.lastModified()) { | ||||
| log("Class " + className | log("Class " + className | ||||
| + " is out of date with respect to " + classpathFile, Project.MSG_DEBUG); | |||||
| + " is out of date with respect to " | |||||
| + classpathFile, Project.MSG_DEBUG); | |||||
| outOfDateClasses.put(className, className); | outOfDateClasses.put(className, className); | ||||
| break; | break; | ||||
| } | } | ||||
| @@ -82,9 +82,12 @@ import org.apache.tools.ant.types.Path; | |||||
| * whether the produced jar is valid or not. | * whether the produced jar is valid or not. | ||||
| * The supported options are: | * The supported options are: | ||||
| * <ul> | * <ul> | ||||
| * <li>debug (boolean) : turn on the debug mode for generation of stubs and skeletons (default:false)</li> | |||||
| * <li>verify (boolean) : turn on the verification at the end of the jar production (default:true) </li> | |||||
| * <li>verifyargs (String) : add optional argument to verify command (see vbj com.inprise.ejb.util.Verify)</li> | |||||
| * <li>debug (boolean) : turn on the debug mode for generation of | |||||
| * stubs and skeletons (default:false)</li> | |||||
| * <li>verify (boolean) : turn on the verification at the end of the jar | |||||
| * production (default:true) </li> | |||||
| * <li>verifyargs (String) : add optional argument to verify command | |||||
| * (see vbj com.inprise.ejb.util.Verify)</li> | |||||
| * <li>basdtd (String) : location of the BAS DTD </li> | * <li>basdtd (String) : location of the BAS DTD </li> | ||||
| * <li>generateclient (boolean) : turn on the client jar file generation </li> | * <li>generateclient (boolean) : turn on the client jar file generation </li> | ||||
| * <li>version (int) : tell what is the borland appserver version 4 or 5 </li> | * <li>version (int) : tell what is the borland appserver version 4 or 5 </li> | ||||
| @@ -92,7 +95,9 @@ import org.apache.tools.ant.types.Path; | |||||
| * | * | ||||
| *<PRE> | *<PRE> | ||||
| * | * | ||||
| * <ejbjar srcdir="${build.classes}" basejarname="vsmp" descriptordir="${rsc.dir}/hrmanager"> | |||||
| * <ejbjar srcdir="${build.classes}" | |||||
| * basejarname="vsmp" | |||||
| * descriptordir="${rsc.dir}/hrmanager"> | |||||
| * <borland destdir="tstlib"> | * <borland destdir="tstlib"> | ||||
| * <classpath refid="classpath" /> | * <classpath refid="classpath" /> | ||||
| * </borland> | * </borland> | ||||
| @@ -106,7 +111,8 @@ import org.apache.tools.ant.types.Path; | |||||
| * @author <a href="mailto:benoit.moussaud@criltelecom.com">Benoit Moussaud</a> | * @author <a href="mailto:benoit.moussaud@criltelecom.com">Benoit Moussaud</a> | ||||
| * | * | ||||
| */ | */ | ||||
| public class BorlandDeploymentTool extends GenericDeploymentTool implements ExecuteStreamHandler { | |||||
| public class BorlandDeploymentTool extends GenericDeploymentTool | |||||
| implements ExecuteStreamHandler { | |||||
| public static final String PUBLICID_BORLAND_EJB | public static final String PUBLICID_BORLAND_EJB | ||||
| = "-//Inprise Corporation//DTD Enterprise JavaBeans 1.1//EN"; | = "-//Inprise Corporation//DTD Enterprise JavaBeans 1.1//EN"; | ||||
| @@ -150,7 +156,10 @@ public class BorlandDeploymentTool extends GenericDeploymentTool implements Exe | |||||
| private int version = BAS; | private int version = BAS; | ||||
| /** Instance variable that determines whether it is necessary to verify the produced jar */ | |||||
| /** | |||||
| * Instance variable that determines whether it is necessary to verify the | |||||
| * produced jar | |||||
| */ | |||||
| private boolean verify = true; | private boolean verify = true; | ||||
| private String verifyArgs = ""; | private String verifyArgs = ""; | ||||
| @@ -383,7 +392,9 @@ public class BorlandDeploymentTool extends GenericDeploymentTool implements Exe | |||||
| org.apache.tools.ant.taskdefs.optional.ejb.BorlandGenerateClient gentask = null; | org.apache.tools.ant.taskdefs.optional.ejb.BorlandGenerateClient gentask = null; | ||||
| log("generate client for " + sourceJar, Project.MSG_INFO); | log("generate client for " + sourceJar, Project.MSG_INFO); | ||||
| try { | try { | ||||
| gentask = (BorlandGenerateClient) getTask().getProject().createTask("internal_bas_generateclient"); | |||||
| Project project = getTask().getProject(); | |||||
| gentask | |||||
| = (BorlandGenerateClient) project.createTask("internal_bas_generateclient"); | |||||
| gentask.setEjbjar(sourceJar); | gentask.setEjbjar(sourceJar); | ||||
| gentask.setDebug(java2iiopdebug); | gentask.setDebug(java2iiopdebug); | ||||
| Path classpath = getCombinedClasspath(); | Path classpath = getCombinedClasspath(); | ||||
| @@ -101,13 +101,13 @@ public class DDCreator extends MatchingTask { | |||||
| * @exception BuildException if someting goes wrong with the build | * @exception BuildException if someting goes wrong with the build | ||||
| */ | */ | ||||
| public void execute() throws BuildException { | public void execute() throws BuildException { | ||||
| if (descriptorDirectory == null || | |||||
| !descriptorDirectory.isDirectory()) { | |||||
| if (descriptorDirectory == null | |||||
| || !descriptorDirectory.isDirectory()) { | |||||
| throw new BuildException("descriptors directory " | throw new BuildException("descriptors directory " | ||||
| + descriptorDirectory.getPath() + " is not valid"); | + descriptorDirectory.getPath() + " is not valid"); | ||||
| } | } | ||||
| if (generatedFilesDirectory == null || | |||||
| !generatedFilesDirectory.isDirectory()) { | |||||
| if (generatedFilesDirectory == null | |||||
| || !generatedFilesDirectory.isDirectory()) { | |||||
| throw new BuildException("dest directory " | throw new BuildException("dest directory " | ||||
| + generatedFilesDirectory.getPath() + " is not valid"); | + generatedFilesDirectory.getPath() + " is not valid"); | ||||
| } | } | ||||
| @@ -168,7 +168,8 @@ public class DescriptorHandler extends org.xml.sax.HandlerBase { | |||||
| if (fileDTD.exists()) { | if (fileDTD.exists()) { | ||||
| if (publicId != null) { | if (publicId != null) { | ||||
| fileDTDs.put(publicId, fileDTD); | fileDTDs.put(publicId, fileDTD); | ||||
| owningTask.log("Mapped publicId " + publicId + " to file " + fileDTD, Project.MSG_VERBOSE); | |||||
| owningTask.log("Mapped publicId " + publicId + " to file " | |||||
| + fileDTD, Project.MSG_VERBOSE); | |||||
| } | } | ||||
| return; | return; | ||||
| } | } | ||||
| @@ -176,7 +177,8 @@ public class DescriptorHandler extends org.xml.sax.HandlerBase { | |||||
| if (getClass().getResource(location) != null) { | if (getClass().getResource(location) != null) { | ||||
| if (publicId != null) { | if (publicId != null) { | ||||
| resourceDTDs.put(publicId, location); | resourceDTDs.put(publicId, location); | ||||
| owningTask.log("Mapped publicId " + publicId + " to resource " + location, Project.MSG_VERBOSE); | |||||
| owningTask.log("Mapped publicId " + publicId + " to resource " | |||||
| + location, Project.MSG_VERBOSE); | |||||
| } | } | ||||
| } | } | ||||
| @@ -198,7 +200,8 @@ public class DescriptorHandler extends org.xml.sax.HandlerBase { | |||||
| File dtdFile = (File) fileDTDs.get(publicId); | File dtdFile = (File) fileDTDs.get(publicId); | ||||
| if (dtdFile != null) { | if (dtdFile != null) { | ||||
| try { | try { | ||||
| owningTask.log("Resolved " + publicId + " to local file " + dtdFile, Project.MSG_VERBOSE); | |||||
| owningTask.log("Resolved " + publicId + " to local file " | |||||
| + dtdFile, Project.MSG_VERBOSE); | |||||
| return new InputSource(new FileInputStream(dtdFile)); | return new InputSource(new FileInputStream(dtdFile)); | ||||
| } catch (FileNotFoundException ex) { | } catch (FileNotFoundException ex) { | ||||
| // ignore | // ignore | ||||
| @@ -209,7 +212,8 @@ public class DescriptorHandler extends org.xml.sax.HandlerBase { | |||||
| if (dtdResourceName != null) { | if (dtdResourceName != null) { | ||||
| InputStream is = this.getClass().getResourceAsStream(dtdResourceName); | InputStream is = this.getClass().getResourceAsStream(dtdResourceName); | ||||
| if (is != null) { | if (is != null) { | ||||
| owningTask.log("Resolved " + publicId + " to local resource " + dtdResourceName, Project.MSG_VERBOSE); | |||||
| owningTask.log("Resolved " + publicId + " to local resource " | |||||
| + dtdResourceName, Project.MSG_VERBOSE); | |||||
| return new InputSource(is); | return new InputSource(is); | ||||
| } | } | ||||
| } | } | ||||
| @@ -218,15 +222,16 @@ public class DescriptorHandler extends org.xml.sax.HandlerBase { | |||||
| if (dtdUrl != null) { | if (dtdUrl != null) { | ||||
| try { | try { | ||||
| InputStream is = dtdUrl.openStream(); | InputStream is = dtdUrl.openStream(); | ||||
| owningTask.log("Resolved " + publicId + " to url " + dtdUrl, Project.MSG_VERBOSE); | |||||
| owningTask.log("Resolved " + publicId + " to url " | |||||
| + dtdUrl, Project.MSG_VERBOSE); | |||||
| return new InputSource(is); | return new InputSource(is); | ||||
| } catch (IOException ioe) { | } catch (IOException ioe) { | ||||
| //ignore | //ignore | ||||
| } | } | ||||
| } | } | ||||
| owningTask.log("Could not resolve ( publicId: " + publicId + ", systemId: " + systemId + ") to a local entity", | |||||
| Project.MSG_INFO); | |||||
| owningTask.log("Could not resolve ( publicId: " + publicId | |||||
| + ", systemId: " + systemId + ") to a local entity", Project.MSG_INFO); | |||||
| return null; | return null; | ||||
| } | } | ||||
| @@ -341,17 +346,19 @@ public class DescriptorHandler extends org.xml.sax.HandlerBase { | |||||
| protected void processElement() { | protected void processElement() { | ||||
| if (inEJBRef || | |||||
| (parseState != STATE_IN_ENTITY && parseState != STATE_IN_SESSION && parseState != STATE_IN_MESSAGE)) { | |||||
| if (inEJBRef | |||||
| || (parseState != STATE_IN_ENTITY | |||||
| && parseState != STATE_IN_SESSION | |||||
| && parseState != STATE_IN_MESSAGE)) { | |||||
| return; | return; | ||||
| } | } | ||||
| if (currentElement.equals(HOME_INTERFACE) || | |||||
| currentElement.equals(REMOTE_INTERFACE) || | |||||
| currentElement.equals(LOCAL_INTERFACE) || | |||||
| currentElement.equals(LOCAL_HOME_INTERFACE) || | |||||
| currentElement.equals(BEAN_CLASS) || | |||||
| currentElement.equals(PK_CLASS)) { | |||||
| if (currentElement.equals(HOME_INTERFACE) | |||||
| || currentElement.equals(REMOTE_INTERFACE) | |||||
| || currentElement.equals(LOCAL_INTERFACE) | |||||
| || currentElement.equals(LOCAL_HOME_INTERFACE) | |||||
| || currentElement.equals(BEAN_CLASS) | |||||
| || currentElement.equals(PK_CLASS)) { | |||||
| // Get the filename into a String object | // Get the filename into a String object | ||||
| File classFile = null; | File classFile = null; | ||||
| @@ -359,8 +366,8 @@ public class DescriptorHandler extends org.xml.sax.HandlerBase { | |||||
| // If it's a primitive wrapper then we shouldn't try and put | // If it's a primitive wrapper then we shouldn't try and put | ||||
| // it into the jar, so ignore it. | // it into the jar, so ignore it. | ||||
| if (!className.startsWith("java.") && | |||||
| !className.startsWith("javax.")) { | |||||
| if (!className.startsWith("java.") | |||||
| && !className.startsWith("javax.")) { | |||||
| // Translate periods into path separators, add .class to the | // Translate periods into path separators, add .class to the | ||||
| // name, create the File object and add it to the Hashtable. | // name, create the File object and add it to the Hashtable. | ||||
| className = className.replace('.', File.separatorChar); | className = className.replace('.', File.separatorChar); | ||||
| @@ -456,8 +456,8 @@ public class EjbJar extends MatchingTask { | |||||
| */ | */ | ||||
| public void setNaming(NamingScheme namingScheme) { | public void setNaming(NamingScheme namingScheme) { | ||||
| config.namingScheme = namingScheme; | config.namingScheme = namingScheme; | ||||
| if (!config.namingScheme.getValue().equals(NamingScheme.BASEJARNAME) && | |||||
| config.baseJarName != null) { | |||||
| if (!config.namingScheme.getValue().equals(NamingScheme.BASEJARNAME) | |||||
| && config.baseJarName != null) { | |||||
| throw new BuildException("The basejarname attribute is not " | throw new BuildException("The basejarname attribute is not " | ||||
| + "compatible with the " | + "compatible with the " | ||||
| + config.namingScheme.getValue() + " naming scheme"); | + config.namingScheme.getValue() + " naming scheme"); | ||||
| @@ -578,8 +578,8 @@ public class EjbJar extends MatchingTask { | |||||
| if (config.namingScheme == null) { | if (config.namingScheme == null) { | ||||
| config.namingScheme = new NamingScheme(); | config.namingScheme = new NamingScheme(); | ||||
| config.namingScheme.setValue(NamingScheme.DESCRIPTOR); | config.namingScheme.setValue(NamingScheme.DESCRIPTOR); | ||||
| } else if (config.namingScheme.getValue().equals(NamingScheme.BASEJARNAME) && | |||||
| config.baseJarName == null) { | |||||
| } else if (config.namingScheme.getValue().equals(NamingScheme.BASEJARNAME) | |||||
| && config.baseJarName == null) { | |||||
| throw new BuildException("The basejarname attribute must " | throw new BuildException("The basejarname attribute must " | ||||
| + "be specified with the basejarname naming scheme"); | + "be specified with the basejarname naming scheme"); | ||||
| } | } | ||||
| @@ -112,19 +112,19 @@ public class Ejbc extends MatchingTask { | |||||
| * @exception BuildException if someting goes wrong with the build | * @exception BuildException if someting goes wrong with the build | ||||
| */ | */ | ||||
| public void execute() throws BuildException { | public void execute() throws BuildException { | ||||
| if (descriptorDirectory == null || | |||||
| !descriptorDirectory.isDirectory()) { | |||||
| if (descriptorDirectory == null | |||||
| || !descriptorDirectory.isDirectory()) { | |||||
| throw new BuildException("descriptors directory " | throw new BuildException("descriptors directory " | ||||
| + descriptorDirectory.getPath() + " is not valid"); | + descriptorDirectory.getPath() + " is not valid"); | ||||
| } | } | ||||
| if (generatedFilesDirectory == null || | |||||
| !generatedFilesDirectory.isDirectory()) { | |||||
| if (generatedFilesDirectory == null | |||||
| || !generatedFilesDirectory.isDirectory()) { | |||||
| throw new BuildException("dest directory " | throw new BuildException("dest directory " | ||||
| + generatedFilesDirectory.getPath() + " is not valid"); | + generatedFilesDirectory.getPath() + " is not valid"); | ||||
| } | } | ||||
| if (sourceDirectory == null || | |||||
| !sourceDirectory.isDirectory()) { | |||||
| if (sourceDirectory == null | |||||
| || !sourceDirectory.isDirectory()) { | |||||
| throw new BuildException("src directory " | throw new BuildException("src directory " | ||||
| + sourceDirectory.getPath() + " is not valid"); | + sourceDirectory.getPath() + " is not valid"); | ||||
| } | } | ||||
| @@ -171,11 +171,16 @@ public class EjbcHelper { | |||||
| DeploymentDescriptor dd = (DeploymentDescriptor) ois.readObject(); | DeploymentDescriptor dd = (DeploymentDescriptor) ois.readObject(); | ||||
| fis.close(); | fis.close(); | ||||
| String homeInterfacePath = dd.getHomeInterfaceClassName().replace('.', '/') + ".java"; | |||||
| String remoteInterfacePath = dd.getRemoteInterfaceClassName().replace('.', '/') + ".java"; | |||||
| String homeInterfacePath | |||||
| = dd.getHomeInterfaceClassName().replace('.', '/') + ".java"; | |||||
| String remoteInterfacePath | |||||
| = dd.getRemoteInterfaceClassName().replace('.', '/') + ".java"; | |||||
| String primaryKeyClassPath = null; | String primaryKeyClassPath = null; | ||||
| if (dd instanceof EntityDescriptor) { | if (dd instanceof EntityDescriptor) { | ||||
| primaryKeyClassPath = ((EntityDescriptor) dd).getPrimaryKeyClassName().replace('.', '/') + ".java";; | |||||
| primaryKeyClassPath | |||||
| = ((EntityDescriptor) dd).getPrimaryKeyClassName(); | |||||
| primaryKeyClassPath | |||||
| = primaryKeyClassPath.replace('.', '/') + ".java";; | |||||
| } | } | ||||
| File homeInterfaceSource = new File(sourceDirectory, homeInterfacePath); | File homeInterfaceSource = new File(sourceDirectory, homeInterfacePath); | ||||
| @@ -197,8 +202,9 @@ public class EjbcHelper { | |||||
| = new File(generatedFilesDirectory, beanClassBase + "EOImpl_WLStub.class"); | = new File(generatedFilesDirectory, beanClassBase + "EOImpl_WLStub.class"); | ||||
| // if the implementation classes don;t exist regenerate | // if the implementation classes don;t exist regenerate | ||||
| if (!ejbImplentationClass.exists() || !homeImplementationClass.exists() || | |||||
| !beanStubClass.exists()) { | |||||
| if (!ejbImplentationClass.exists() | |||||
| || !homeImplementationClass.exists() | |||||
| || !beanStubClass.exists()) { | |||||
| return true; | return true; | ||||
| } | } | ||||
| @@ -212,18 +218,19 @@ public class EjbcHelper { | |||||
| classModificationTime = beanStubClass.lastModified(); | classModificationTime = beanStubClass.lastModified(); | ||||
| } | } | ||||
| if (descriptorFile.lastModified() > classModificationTime || | |||||
| homeInterfaceSource.lastModified() > classModificationTime || | |||||
| remoteInterfaceSource.lastModified() > classModificationTime) { | |||||
| if (descriptorFile.lastModified() > classModificationTime | |||||
| || homeInterfaceSource.lastModified() > classModificationTime | |||||
| || remoteInterfaceSource.lastModified() > classModificationTime) { | |||||
| return true; | return true; | ||||
| } | } | ||||
| if (primaryKeyClassSource != null && | |||||
| primaryKeyClassSource.lastModified() > classModificationTime) { | |||||
| if (primaryKeyClassSource != null | |||||
| && primaryKeyClassSource.lastModified() > classModificationTime) { | |||||
| return true; | return true; | ||||
| } | } | ||||
| } catch (Throwable descriptorLoadException) { | } catch (Throwable descriptorLoadException) { | ||||
| System.out.println("Exception occurred reading " + descriptorFile.getName() + " - continuing"); | |||||
| System.out.println("Exception occurred reading " | |||||
| + descriptorFile.getName() + " - continuing"); | |||||
| // any problems - just regenerate | // any problems - just regenerate | ||||
| return true; | return true; | ||||
| } finally { | } finally { | ||||
| @@ -251,7 +258,8 @@ public class EjbcHelper { | |||||
| } else { | } else { | ||||
| System.out.println(descriptorFile.getName() + " is up to date"); | System.out.println(descriptorFile.getName() + " is up to date"); | ||||
| } | } | ||||
| manifest += "Name: " + descriptorName.replace('\\', '/') + "\nEnterprise-Bean: True\n\n"; | |||||
| manifest += "Name: " + descriptorName.replace('\\', '/') | |||||
| + "\nEnterprise-Bean: True\n\n"; | |||||
| } | } | ||||
| FileWriter fw = new FileWriter(manifestFile); | FileWriter fw = new FileWriter(manifestFile); | ||||
| @@ -549,7 +549,8 @@ public class GenericDeploymentTool implements EJBDeploymentTool { | |||||
| * look like much, we use a SAXParser and an inner class to | * look like much, we use a SAXParser and an inner class to | ||||
| * get hold of all the classfile names for the descriptor. | * get hold of all the classfile names for the descriptor. | ||||
| */ | */ | ||||
| descriptorStream = new FileInputStream(new File(config.descriptorDir, descriptorFileName)); | |||||
| descriptorStream | |||||
| = new FileInputStream(new File(config.descriptorDir, descriptorFileName)); | |||||
| saxParser.parse(new InputSource(descriptorStream), handler); | saxParser.parse(new InputSource(descriptorStream), handler); | ||||
| ejbFiles = handler.getFiles(); | ejbFiles = handler.getFiles(); | ||||
| @@ -660,9 +661,9 @@ public class GenericDeploymentTool implements EJBDeploymentTool { | |||||
| if (config.namingScheme.getValue().equals(EjbJar.NamingScheme.DESCRIPTOR)) { | if (config.namingScheme.getValue().equals(EjbJar.NamingScheme.DESCRIPTOR)) { | ||||
| ddPrefix = baseName + config.baseNameTerminator; | ddPrefix = baseName + config.baseNameTerminator; | ||||
| } else if (config.namingScheme.getValue().equals(EjbJar.NamingScheme.BASEJARNAME) || | |||||
| config.namingScheme.getValue().equals(EjbJar.NamingScheme.EJB_NAME) || | |||||
| config.namingScheme.getValue().equals(EjbJar.NamingScheme.DIRECTORY)) { | |||||
| } else if (config.namingScheme.getValue().equals(EjbJar.NamingScheme.BASEJARNAME) | |||||
| || config.namingScheme.getValue().equals(EjbJar.NamingScheme.EJB_NAME) | |||||
| || config.namingScheme.getValue().equals(EjbJar.NamingScheme.DIRECTORY)) { | |||||
| String canonicalDescriptor = descriptorFileName.replace('\\', '/'); | String canonicalDescriptor = descriptorFileName.replace('\\', '/'); | ||||
| int index = canonicalDescriptor.lastIndexOf('/'); | int index = canonicalDescriptor.lastIndexOf('/'); | ||||
| if (index == -1) { | if (index == -1) { | ||||
| @@ -797,8 +798,8 @@ public class GenericDeploymentTool implements EJBDeploymentTool { | |||||
| String defaultManifest = "/org/apache/tools/ant/defaultManifest.mf"; | String defaultManifest = "/org/apache/tools/ant/defaultManifest.mf"; | ||||
| in = this.getClass().getResourceAsStream(defaultManifest); | in = this.getClass().getResourceAsStream(defaultManifest); | ||||
| if (in == null) { | if (in == null) { | ||||
| throw new BuildException("Could not find default manifest: " + defaultManifest, | |||||
| getLocation()); | |||||
| throw new BuildException("Could not find " | |||||
| + "default manifest: " + defaultManifest); | |||||
| } | } | ||||
| } | } | ||||
| @@ -842,7 +843,8 @@ public class GenericDeploymentTool implements EJBDeploymentTool { | |||||
| if (entryIndex < 0) { | if (entryIndex < 0) { | ||||
| entryName = innerfiles[i]; | entryName = innerfiles[i]; | ||||
| } else { | } else { | ||||
| entryName = entryName.substring(0, entryIndex) + File.separatorChar + innerfiles[i]; | |||||
| entryName = entryName.substring(0, entryIndex) | |||||
| + File.separatorChar + innerfiles[i]; | |||||
| } | } | ||||
| // link the file | // link the file | ||||
| entryFile = new File(config.srcDir, entryName); | entryFile = new File(config.srcDir, entryName); | ||||
| @@ -93,7 +93,9 @@ public class JbossDeploymentTool extends GenericDeploymentTool { | |||||
| if (jbossDD.exists()) { | if (jbossDD.exists()) { | ||||
| ejbFiles.put(META_DIR + JBOSS_DD, jbossDD); | ejbFiles.put(META_DIR + JBOSS_DD, jbossDD); | ||||
| } else { | } else { | ||||
| log("Unable to locate jboss deployment descriptor. It was expected to be in " + jbossDD.getPath(), Project.MSG_WARN); | |||||
| log("Unable to locate jboss deployment descriptor. " | |||||
| + "It was expected to be in " + jbossDD.getPath(), | |||||
| Project.MSG_WARN); | |||||
| return; | return; | ||||
| } | } | ||||
| String descriptorFileName = JBOSS_CMP10D; | String descriptorFileName = JBOSS_CMP10D; | ||||
| @@ -62,8 +62,9 @@ import org.apache.tools.ant.types.Path; | |||||
| /** | /** | ||||
| * Starts a WebLogic server. | * Starts a WebLogic server. | ||||
| * A number of parameters are used to control the operation of the weblogic instance. Note that the task, | |||||
| * and hence ant, will not complete until the weblogic instance is stopped.</p> | |||||
| * A number of parameters are used to control the operation of the weblogic | |||||
| * instance. Note that the task, and hence ant, will not complete until the | |||||
| * weblogic instance is stopped.</p> | |||||
| * | * | ||||
| * @author Conor MacNeill, Cortex ebusiness Pty Limited | * @author Conor MacNeill, Cortex ebusiness Pty Limited | ||||
| */ | */ | ||||
| @@ -73,8 +74,9 @@ public class WLRun extends Task { | |||||
| protected static final String DEFAULT_PROPERTIES_FILE = "weblogic.properties"; | protected static final String DEFAULT_PROPERTIES_FILE = "weblogic.properties"; | ||||
| /** | /** | ||||
| * The classpath to be used when running the Java VM. It must contain the weblogic | |||||
| * classes <b>and</b> the implementation classes of the home and remote interfaces. | |||||
| * The classpath to be used when running the Java VM. It must contain the | |||||
| * weblogic classes <b>and</b> the implementation classes of the home and | |||||
| * remote interfaces. | |||||
| */ | */ | ||||
| private Path classpath; | private Path classpath; | ||||
| @@ -487,7 +487,8 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool { | |||||
| saxParserFactory.setValidating(true); | saxParserFactory.setValidating(true); | ||||
| SAXParser saxParser = saxParserFactory.newSAXParser(); | SAXParser saxParser = saxParserFactory.newSAXParser(); | ||||
| DescriptorHandler handler = getWeblogicDescriptorHandler(ejbDescriptor.getParentFile()); | |||||
| DescriptorHandler handler | |||||
| = getWeblogicDescriptorHandler(ejbDescriptor.getParentFile()); | |||||
| saxParser.parse(new InputSource | saxParser.parse(new InputSource | ||||
| (new FileInputStream(weblogicDD)), | (new FileInputStream(weblogicDD)), | ||||
| @@ -570,7 +571,8 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool { | |||||
| } else if (PUBLICID_EJB20.equals(publicId)) { | } else if (PUBLICID_EJB20.equals(publicId)) { | ||||
| ejbcClassName = COMPILER_EJB20; | ejbcClassName = COMPILER_EJB20; | ||||
| } else { | } else { | ||||
| log("Unrecognized publicId " + publicId + " - using EJB 1.1 compiler", Project.MSG_WARN); | |||||
| log("Unrecognized publicId " + publicId | |||||
| + " - using EJB 1.1 compiler", Project.MSG_WARN); | |||||
| ejbcClassName = COMPILER_EJB11; | ejbcClassName = COMPILER_EJB11; | ||||
| } | } | ||||
| } | } | ||||
| @@ -747,7 +749,8 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool { | |||||
| if (genericEntry.getName().endsWith(".class")) { | if (genericEntry.getName().endsWith(".class")) { | ||||
| //File are different see if its an object or an interface | //File are different see if its an object or an interface | ||||
| String classname = genericEntry.getName().replace(File.separatorChar, '.'); | |||||
| String classname | |||||
| = genericEntry.getName().replace(File.separatorChar, '.'); | |||||
| classname = classname.substring(0, classname.lastIndexOf(".class")); | classname = classname.substring(0, classname.lastIndexOf(".class")); | ||||
| @@ -755,7 +758,8 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool { | |||||
| if (genclass.isInterface()) { | if (genclass.isInterface()) { | ||||
| //Interface changed rebuild jar. | //Interface changed rebuild jar. | ||||
| log("Interface " + genclass.getName() + " has changed", Project.MSG_VERBOSE); | |||||
| log("Interface " + genclass.getName() | |||||
| + " has changed", Project.MSG_VERBOSE); | |||||
| rebuild = true; | rebuild = true; | ||||
| break; | break; | ||||
| } else { | } else { | ||||
| @@ -766,7 +770,8 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool { | |||||
| // is it the manifest. If so ignore it | // is it the manifest. If so ignore it | ||||
| if (!genericEntry.getName().equals("META-INF/MANIFEST.MF")) { | if (!genericEntry.getName().equals("META-INF/MANIFEST.MF")) { | ||||
| //File other then class changed rebuild | //File other then class changed rebuild | ||||
| log("Non class file " + genericEntry.getName() + " has changed", Project.MSG_VERBOSE); | |||||
| log("Non class file " + genericEntry.getName() | |||||
| + " has changed", Project.MSG_VERBOSE); | |||||
| rebuild = true; | rebuild = true; | ||||
| break; | break; | ||||
| } | } | ||||
| @@ -775,7 +780,8 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool { | |||||
| } else { | } else { | ||||
| // a file doesnt exist rebuild | // a file doesnt exist rebuild | ||||
| log("File " + filepath + " not present in weblogic jar", Project.MSG_VERBOSE); | |||||
| log("File " + filepath + " not present in weblogic jar", | |||||
| Project.MSG_VERBOSE); | |||||
| rebuild = true; | rebuild = true; | ||||
| break; | break; | ||||
| } | } | ||||
| @@ -798,8 +804,8 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool { | |||||
| InputStream is; | InputStream is; | ||||
| JarEntry je = (JarEntry) e.nextElement(); | JarEntry je = (JarEntry) e.nextElement(); | ||||
| if (je.getCompressedSize() == -1 || | |||||
| je.getCompressedSize() == je.getSize()) { | |||||
| if (je.getCompressedSize() == -1 | |||||
| || je.getCompressedSize() == je.getSize()) { | |||||
| newJarStream.setLevel(0); | newJarStream.setLevel(0); | ||||
| } else { | } else { | ||||
| newJarStream.setLevel(9); | newJarStream.setLevel(9); | ||||
| @@ -807,7 +813,8 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool { | |||||
| // Update with changed Bean class | // Update with changed Bean class | ||||
| if (replaceEntries.containsKey(je.getName())) { | if (replaceEntries.containsKey(je.getName())) { | ||||
| log("Updating Bean class from generic Jar " + je.getName(), Project.MSG_VERBOSE); | |||||
| log("Updating Bean class from generic Jar " | |||||
| + je.getName(), Project.MSG_VERBOSE); | |||||
| // Use the entry from the generic jar | // Use the entry from the generic jar | ||||
| je = (JarEntry) replaceEntries.get(je.getName()); | je = (JarEntry) replaceEntries.get(je.getName()); | ||||
| is = genericJar.getInputStream(je); | is = genericJar.getInputStream(je); | ||||
| @@ -61,7 +61,8 @@ import org.apache.tools.ant.Project; | |||||
| public class WeblogicTOPLinkDeploymentTool extends WeblogicDeploymentTool { | public class WeblogicTOPLinkDeploymentTool extends WeblogicDeploymentTool { | ||||
| private static final String TL_DTD_LOC = "http://www.objectpeople.com/tlwl/dtd/toplink-cmp_2_5_1.dtd"; | |||||
| private static final String TL_DTD_LOC | |||||
| = "http://www.objectpeople.com/tlwl/dtd/toplink-cmp_2_5_1.dtd"; | |||||
| private String toplinkDescriptor; | private String toplinkDescriptor; | ||||
| private String toplinkDTD; | private String toplinkDTD; | ||||
| @@ -76,9 +77,12 @@ public class WeblogicTOPLinkDeploymentTool extends WeblogicDeploymentTool { | |||||
| /** | /** | ||||
| * Setter used to store the location of the toplink DTD file. | * Setter used to store the location of the toplink DTD file. | ||||
| * This is expected to be an URL (file or otherwise). If running this on NT using a file URL, the safest | |||||
| * thing would be to not use a drive spec in the URL and make sure the file resides on the drive that | |||||
| * ANT is running from. This will keep the setting in the build XML platform independent. | |||||
| * This is expected to be an URL (file or otherwise). If running | |||||
| * this on NT using a file URL, the safest thing would be to not use a | |||||
| * drive spec in the URL and make sure the file resides on the drive that | |||||
| * ANT is running from. This will keep the setting in the build XML | |||||
| * platform independent. | |||||
| * | |||||
| * @param inString the string to use as the DTD location. | * @param inString the string to use as the DTD location. | ||||
| */ | */ | ||||
| public void setToplinkdtd(String inString) { | public void setToplinkdtd(String inString) { | ||||
| @@ -88,11 +92,11 @@ public class WeblogicTOPLinkDeploymentTool extends WeblogicDeploymentTool { | |||||
| protected DescriptorHandler getDescriptorHandler(File srcDir) { | protected DescriptorHandler getDescriptorHandler(File srcDir) { | ||||
| DescriptorHandler handler = super.getDescriptorHandler(srcDir); | DescriptorHandler handler = super.getDescriptorHandler(srcDir); | ||||
| if (toplinkDTD != null) { | if (toplinkDTD != null) { | ||||
| handler.registerDTD("-//The Object People, Inc.//DTD TOPLink for WebLogic CMP 2.5.1//EN", | |||||
| toplinkDTD); | |||||
| handler.registerDTD("-//The Object People, Inc.//" | |||||
| + "DTD TOPLink for WebLogic CMP 2.5.1//EN", toplinkDTD); | |||||
| } else { | } else { | ||||
| handler.registerDTD("-//The Object People, Inc.//DTD TOPLink for WebLogic CMP 2.5.1//EN", | |||||
| TL_DTD_LOC); | |||||
| handler.registerDTD("-//The Object People, Inc.//" | |||||
| + "DTD TOPLink for WebLogic CMP 2.5.1//EN", TL_DTD_LOC); | |||||
| } | } | ||||
| return handler; | return handler; | ||||
| } | } | ||||
| @@ -85,11 +85,13 @@ import org.apache.tools.ant.util.FileUtils; | |||||
| * <li>Map.mapxmi</li> | * <li>Map.mapxmi</li> | ||||
| * <li>Schema.dbxmi</li> | * <li>Schema.dbxmi</li> | ||||
| * </ul> | * </ul> | ||||
| * In terms of WebSphere, the generation of container code and stubs is called <code>deployment</code>. | |||||
| * This step can be performed by the websphere element as part of the jar generation process. If the | |||||
| * switch <code>ejbdeploy</code> is on, the ejbdeploy tool from the websphere toolset is called for | |||||
| * every ejb-jar. Unfortunately, this step only works, if you use the ibm jdk. Otherwise, the rmic | |||||
| * (called by ejbdeploy) throws a ClassFormatError. Be sure to switch ejbdeploy off, if run ant with | |||||
| * In terms of WebSphere, the generation of container code and stubs is | |||||
| * called <code>deployment</code>. This step can be performed by the websphere | |||||
| * element as part of the jar generation process. If the switch | |||||
| * <code>ejbdeploy</code> is on, the ejbdeploy tool from the websphere toolset | |||||
| * is called for every ejb-jar. Unfortunately, this step only works, if you | |||||
| * use the ibm jdk. Otherwise, the rmic (called by ejbdeploy) throws a | |||||
| * ClassFormatError. Be sure to switch ejbdeploy off, if run ant with | |||||
| * sun jdk. | * sun jdk. | ||||
| * | * | ||||
| * @author <a href="mailto:msahu@interkeel.com">Maneesh Sahu</a> | * @author <a href="mailto:msahu@interkeel.com">Maneesh Sahu</a> | ||||
| @@ -98,7 +100,6 @@ public class WebsphereDeploymentTool extends GenericDeploymentTool { | |||||
| /** | /** | ||||
| * Enumerated attribute with the values for the database vendor types | * Enumerated attribute with the values for the database vendor types | ||||
| * | * | ||||
| * @author Conor MacNeill | |||||
| */ | */ | ||||
| public static class DBVendor extends EnumeratedAttribute { | public static class DBVendor extends EnumeratedAttribute { | ||||
| public String[] getValues() { | public String[] getValues() { | ||||
| @@ -600,7 +601,8 @@ public class WebsphereDeploymentTool extends GenericDeploymentTool { | |||||
| javaTask.createArg().setValue(tempdir); | javaTask.createArg().setValue(tempdir); | ||||
| javaTask.createArg().setValue(destJar.getPath()); | javaTask.createArg().setValue(destJar.getPath()); | ||||
| javaTask.createArg().setLine(getOptions()); | javaTask.createArg().setLine(getOptions()); | ||||
| if (getCombinedClasspath() != null && getCombinedClasspath().toString().length() > 0) { | |||||
| if (getCombinedClasspath() != null | |||||
| && getCombinedClasspath().toString().length() > 0) { | |||||
| javaTask.createArg().setValue("-cp"); | javaTask.createArg().setValue("-cp"); | ||||
| javaTask.createArg().setValue(getCombinedClasspath().toString()); | javaTask.createArg().setValue(getCombinedClasspath().toString()); | ||||
| } | } | ||||
| @@ -669,7 +671,8 @@ public class WebsphereDeploymentTool extends GenericDeploymentTool { | |||||
| if (ejbdeploy) { | if (ejbdeploy) { | ||||
| String home = getTask().getProject().getProperty("websphere.home"); | String home = getTask().getProject().getProperty("websphere.home"); | ||||
| if (home == null) { | if (home == null) { | ||||
| throw new BuildException("The 'websphere.home' property must be set when 'ejbdeploy=true'"); | |||||
| throw new BuildException("The 'websphere.home' property must " | |||||
| + "be set when 'ejbdeploy=true'"); | |||||
| } | } | ||||
| websphereHome = getTask().getProject().resolveFile(home); | websphereHome = getTask().getProject().resolveFile(home); | ||||
| } | } | ||||
| @@ -709,8 +712,8 @@ public class WebsphereDeploymentTool extends GenericDeploymentTool { | |||||
| JarOutputStream newJarStream = null; | JarOutputStream newJarStream = null; | ||||
| try { | try { | ||||
| log("Checking if websphere Jar needs to be rebuilt for jar " + websphereJarFile.getName(), | |||||
| Project.MSG_VERBOSE); | |||||
| log("Checking if websphere Jar needs to be rebuilt for jar " | |||||
| + websphereJarFile.getName(), Project.MSG_VERBOSE); | |||||
| // Only go forward if the generic and the websphere file both exist | // Only go forward if the generic and the websphere file both exist | ||||
| if (genericJarFile.exists() && genericJarFile.isFile() | if (genericJarFile.exists() && genericJarFile.isFile() | ||||
| && websphereJarFile.exists() && websphereJarFile.isFile()) { | && websphereJarFile.exists() && websphereJarFile.isFile()) { | ||||
| @@ -747,12 +750,13 @@ public class WebsphereDeploymentTool extends GenericDeploymentTool { | |||||
| JarEntry genericEntry = (JarEntry) genericEntries.get(filepath); | JarEntry genericEntry = (JarEntry) genericEntries.get(filepath); | ||||
| JarEntry wasEntry = (JarEntry) wasEntries.get(filepath); | JarEntry wasEntry = (JarEntry) wasEntries.get(filepath); | ||||
| if ((genericEntry.getCrc() != wasEntry.getCrc()) || | |||||
| (genericEntry.getSize() != wasEntry.getSize())) { | |||||
| if ((genericEntry.getCrc() != wasEntry.getCrc()) | |||||
| || (genericEntry.getSize() != wasEntry.getSize())) { | |||||
| if (genericEntry.getName().endsWith(".class")) { | if (genericEntry.getName().endsWith(".class")) { | ||||
| //File are different see if its an object or an interface | //File are different see if its an object or an interface | ||||
| String classname = genericEntry.getName().replace(File.separatorChar, '.'); | |||||
| String classname | |||||
| = genericEntry.getName().replace(File.separatorChar, '.'); | |||||
| classname = classname.substring(0, classname.lastIndexOf(".class")); | classname = classname.substring(0, classname.lastIndexOf(".class")); | ||||
| @@ -760,7 +764,8 @@ public class WebsphereDeploymentTool extends GenericDeploymentTool { | |||||
| if (genclass.isInterface()) { | if (genclass.isInterface()) { | ||||
| //Interface changed rebuild jar. | //Interface changed rebuild jar. | ||||
| log("Interface " + genclass.getName() + " has changed", Project.MSG_VERBOSE); | |||||
| log("Interface " + genclass.getName() | |||||
| + " has changed", Project.MSG_VERBOSE); | |||||
| rebuild = true; | rebuild = true; | ||||
| break; | break; | ||||
| } else { | } else { | ||||
| @@ -771,7 +776,8 @@ public class WebsphereDeploymentTool extends GenericDeploymentTool { | |||||
| // is it the manifest. If so ignore it | // is it the manifest. If so ignore it | ||||
| if (!genericEntry.getName().equals("META-INF/MANIFEST.MF")) { | if (!genericEntry.getName().equals("META-INF/MANIFEST.MF")) { | ||||
| //File other then class changed rebuild | //File other then class changed rebuild | ||||
| log("Non class file " + genericEntry.getName() + " has changed", Project.MSG_VERBOSE); | |||||
| log("Non class file " + genericEntry.getName() | |||||
| + " has changed", Project.MSG_VERBOSE); | |||||
| rebuild = true; | rebuild = true; | ||||
| } | } | ||||
| break; | break; | ||||
| @@ -780,7 +786,8 @@ public class WebsphereDeploymentTool extends GenericDeploymentTool { | |||||
| } else { | } else { | ||||
| // a file doesn't exist rebuild | // a file doesn't exist rebuild | ||||
| log("File " + filepath + " not present in websphere jar", Project.MSG_VERBOSE); | |||||
| log("File " + filepath + " not present in websphere jar", | |||||
| Project.MSG_VERBOSE); | |||||
| rebuild = true; | rebuild = true; | ||||
| break; | break; | ||||
| } | } | ||||
| @@ -803,8 +810,8 @@ public class WebsphereDeploymentTool extends GenericDeploymentTool { | |||||
| InputStream is; | InputStream is; | ||||
| JarEntry je = (JarEntry) e.nextElement(); | JarEntry je = (JarEntry) e.nextElement(); | ||||
| if (je.getCompressedSize() == -1 || | |||||
| je.getCompressedSize() == je.getSize()) { | |||||
| if (je.getCompressedSize() == -1 | |||||
| || je.getCompressedSize() == je.getSize()) { | |||||
| newJarStream.setLevel(0); | newJarStream.setLevel(0); | ||||
| } else { | } else { | ||||
| newJarStream.setLevel(9); | newJarStream.setLevel(9); | ||||
| @@ -830,7 +837,8 @@ public class WebsphereDeploymentTool extends GenericDeploymentTool { | |||||
| is.close(); | is.close(); | ||||
| } | } | ||||
| } else { | } else { | ||||
| log("websphere Jar rebuild needed due to changed interface or XML", Project.MSG_VERBOSE); | |||||
| log("websphere Jar rebuild needed due to changed " | |||||
| + "interface or XML", Project.MSG_VERBOSE); | |||||
| } | } | ||||
| } else { | } else { | ||||
| rebuild = true; | rebuild = true; | ||||
| @@ -344,15 +344,12 @@ public class Translate extends MatchingTask { | |||||
| Locale locale = new Locale(bundleLanguage, | Locale locale = new Locale(bundleLanguage, | ||||
| bundleCountry, | bundleCountry, | ||||
| bundleVariant); | bundleVariant); | ||||
| String language = locale.getLanguage().length() > 0 ? | |||||
| "_" + locale.getLanguage() : | |||||
| ""; | |||||
| String country = locale.getCountry().length() > 0 ? | |||||
| "_" + locale.getCountry() : | |||||
| ""; | |||||
| String variant = locale.getVariant().length() > 0 ? | |||||
| "_" + locale.getVariant() : | |||||
| ""; | |||||
| String language = locale.getLanguage().length() > 0 | |||||
| ? "_" + locale.getLanguage() : ""; | |||||
| String country = locale.getCountry().length() > 0 | |||||
| ? "_" + locale.getCountry() : ""; | |||||
| String variant = locale.getVariant().length() > 0 | |||||
| ? "_" + locale.getVariant() : ""; | |||||
| String bundleFile = bundle + language + country + variant; | String bundleFile = bundle + language + country + variant; | ||||
| processBundle(bundleFile, 0, false); | processBundle(bundleFile, 0, false); | ||||
| @@ -369,15 +366,12 @@ public class Translate extends MatchingTask { | |||||
| //using default file encoding scheme. | //using default file encoding scheme. | ||||
| locale = Locale.getDefault(); | locale = Locale.getDefault(); | ||||
| language = locale.getLanguage().length() > 0 ? | |||||
| "_" + locale.getLanguage() : | |||||
| ""; | |||||
| country = locale.getCountry().length() > 0 ? | |||||
| "_" + locale.getCountry() : | |||||
| ""; | |||||
| variant = locale.getVariant().length() > 0 ? | |||||
| "_" + locale.getVariant() : | |||||
| ""; | |||||
| language = locale.getLanguage().length() > 0 | |||||
| ? "_" + locale.getLanguage() : ""; | |||||
| country = locale.getCountry().length() > 0 | |||||
| ? "_" + locale.getCountry() : ""; | |||||
| variant = locale.getVariant().length() > 0 | |||||
| ? "_" + locale.getVariant() : ""; | |||||
| bundleEncoding = System.getProperty("file.encoding"); | bundleEncoding = System.getProperty("file.encoding"); | ||||
| bundleFile = bundle + language + country + variant; | bundleFile = bundle + language + country + variant; | ||||
| @@ -530,20 +524,23 @@ public class Translate extends MatchingTask { | |||||
| // is there a startToken | // is there a startToken | ||||
| // and there is still stuff following the startToken | // and there is still stuff following the startToken | ||||
| int startIndex = line.indexOf(startToken); | int startIndex = line.indexOf(startToken); | ||||
| while (startIndex >= 0 && (startIndex + startToken.length()) <= line.length()) { | |||||
| while (startIndex >= 0 | |||||
| && (startIndex + startToken.length()) <= line.length()) { | |||||
| // the new value, this needs to be here | // the new value, this needs to be here | ||||
| // because it is required to calculate the next position to search from | // because it is required to calculate the next position to search from | ||||
| // at the end of the loop | // at the end of the loop | ||||
| String replace = null; | String replace = null; | ||||
| // we found a starttoken, is there an endtoken following? | // we found a starttoken, is there an endtoken following? | ||||
| // start at token+tokenlength because start and end token may be indentical | |||||
| // start at token+tokenlength because start and end | |||||
| // token may be indentical | |||||
| int endIndex = line.indexOf(endToken, startIndex + startToken.length()); | int endIndex = line.indexOf(endToken, startIndex + startToken.length()); | ||||
| if (endIndex < 0) { | if (endIndex < 0) { | ||||
| startIndex += 1; | startIndex += 1; | ||||
| } else { | } else { | ||||
| // grab the token | // grab the token | ||||
| String token = line.substring(startIndex + startToken.length(), endIndex); | |||||
| String token | |||||
| = line.substring(startIndex + startToken.length(), endIndex); | |||||
| // If there is a white space or = or :, then | // If there is a white space or = or :, then | ||||
| // it isn't to be treated as a valid key. | // it isn't to be treated as a valid key. | ||||
| @@ -317,7 +317,8 @@ public class VAJAntToolGUI extends Frame { | |||||
| getFileDialog().setFile("*.xml"); | getFileDialog().setFile("*.xml"); | ||||
| getFileDialog().show(); | getFileDialog().show(); | ||||
| if (!getFileDialog().getFile().equals("")) { | if (!getFileDialog().getFile().equals("")) { | ||||
| getBuildFileTextField().setText(getFileDialog().getDirectory() + getFileDialog().getFile()); | |||||
| getBuildFileTextField().setText(getFileDialog().getDirectory() | |||||
| + getFileDialog().getFile()); | |||||
| } | } | ||||
| } | } | ||||
| // dispose and exit application | // dispose and exit application | ||||
| @@ -394,10 +395,12 @@ public class VAJAntToolGUI extends Frame { | |||||
| * PropertyChangeListener method | * PropertyChangeListener method | ||||
| */ | */ | ||||
| public void propertyChange(java.beans.PropertyChangeEvent evt) { | public void propertyChange(java.beans.PropertyChangeEvent evt) { | ||||
| if (evt.getSource() == VAJAntToolGUI.this.getBuildInfo() && (evt.getPropertyName().equals("projectName"))) { | |||||
| if (evt.getSource() == VAJAntToolGUI.this.getBuildInfo() | |||||
| && (evt.getPropertyName().equals("projectName"))) { | |||||
| connectProjectNameToLabel(); | connectProjectNameToLabel(); | ||||
| } | } | ||||
| if (evt.getSource() == VAJAntToolGUI.this.getBuildInfo() && (evt.getPropertyName().equals("buildFileName"))) { | |||||
| if (evt.getSource() == VAJAntToolGUI.this.getBuildInfo() | |||||
| && (evt.getPropertyName().equals("buildFileName"))) { | |||||
| connectBuildFileNameToTextField(); | connectBuildFileNameToTextField(); | ||||
| } | } | ||||
| } | } | ||||
| @@ -453,9 +456,8 @@ public class VAJAntToolGUI extends Frame { | |||||
| } | } | ||||
| /** | /** | ||||
| * AntMake constructor called by VAJAntTool integration. | * AntMake constructor called by VAJAntTool integration. | ||||
| * @param buildInfo VAJBuildInfo | |||||
| * @param newBuildInfo VAJBuildInfo | |||||
| */ | */ | ||||
| public VAJAntToolGUI(VAJBuildInfo newBuildInfo) { | public VAJAntToolGUI(VAJBuildInfo newBuildInfo) { | ||||
| super(); | super(); | ||||
| setBuildInfo(newBuildInfo); | setBuildInfo(newBuildInfo); | ||||
| @@ -570,7 +572,8 @@ public class VAJAntToolGUI extends Frame { | |||||
| iAboutContactLabel = new Label(); | iAboutContactLabel = new Label(); | ||||
| iAboutContactLabel.setName("AboutContactLabel"); | iAboutContactLabel.setName("AboutContactLabel"); | ||||
| iAboutContactLabel.setAlignment(java.awt.Label.CENTER); | iAboutContactLabel.setAlignment(java.awt.Label.CENTER); | ||||
| iAboutContactLabel.setText("contact: wolf.siberski@tui.de or christoph.wilhelms@tui.de"); | |||||
| iAboutContactLabel.setText("contact: wolf.siberski@tui.de or " | |||||
| + "christoph.wilhelms@tui.de"); | |||||
| } catch (Throwable iExc) { | } catch (Throwable iExc) { | ||||
| handleException(iExc); | handleException(iExc); | ||||
| } | } | ||||
| @@ -971,8 +974,10 @@ public class VAJAntToolGUI extends Frame { | |||||
| iMessageCommandPanel = new Panel(); | iMessageCommandPanel = new Panel(); | ||||
| iMessageCommandPanel.setName("MessageCommandPanel"); | iMessageCommandPanel.setName("MessageCommandPanel"); | ||||
| iMessageCommandPanel.setLayout(new FlowLayout()); | iMessageCommandPanel.setLayout(new FlowLayout()); | ||||
| getMessageCommandPanel().add(getMessageClearLogButton(), getMessageClearLogButton().getName()); | |||||
| getMessageCommandPanel().add(getMessageOkButton(), getMessageOkButton().getName()); | |||||
| getMessageCommandPanel().add(getMessageClearLogButton(), | |||||
| getMessageClearLogButton().getName()); | |||||
| getMessageCommandPanel().add(getMessageOkButton(), | |||||
| getMessageOkButton().getName()); | |||||
| } catch (Throwable iExc) { | } catch (Throwable iExc) { | ||||
| handleException(iExc); | handleException(iExc); | ||||
| } | } | ||||
| @@ -1011,7 +1016,9 @@ public class VAJAntToolGUI extends Frame { | |||||
| iMessageFrame.setBounds(0, 0, 750, 250); | iMessageFrame.setBounds(0, 0, 750, 250); | ||||
| iMessageFrame.setTitle("Message Log"); | iMessageFrame.setTitle("Message Log"); | ||||
| iMessageFrame.add(getMessageContentPanel(), "Center"); | iMessageFrame.add(getMessageContentPanel(), "Center"); | ||||
| iMessageFrame.setLocation((Toolkit.getDefaultToolkit().getScreenSize().width / 2) - (iMessageFrame.getSize().width / 2), (java.awt.Toolkit.getDefaultToolkit().getScreenSize().height / 2)); | |||||
| iMessageFrame.setLocation((Toolkit.getDefaultToolkit().getScreenSize().width / 2) | |||||
| - (iMessageFrame.getSize().width / 2), | |||||
| (java.awt.Toolkit.getDefaultToolkit().getScreenSize().height / 2)); | |||||
| } catch (Throwable iExc) { | } catch (Throwable iExc) { | ||||
| handleException(iExc); | handleException(iExc); | ||||
| } | } | ||||
| @@ -1150,19 +1157,25 @@ public class VAJAntToolGUI extends Frame { | |||||
| constraintsTargetList.insets = new Insets(4, 4, 4, 4); | constraintsTargetList.insets = new Insets(4, 4, 4, 4); | ||||
| getOptionenPanel().add(getTargetList(), constraintsTargetList); | getOptionenPanel().add(getTargetList(), constraintsTargetList); | ||||
| GridBagConstraints constraintsMessageOutputLevelLabel = new GridBagConstraints(); | |||||
| constraintsMessageOutputLevelLabel.gridx = 0; constraintsMessageOutputLevelLabel.gridy = 4; | |||||
| GridBagConstraints constraintsMessageOutputLevelLabel | |||||
| = new GridBagConstraints(); | |||||
| constraintsMessageOutputLevelLabel.gridx = 0; | |||||
| constraintsMessageOutputLevelLabel.gridy = 4; | |||||
| constraintsMessageOutputLevelLabel.anchor = GridBagConstraints.WEST; | constraintsMessageOutputLevelLabel.anchor = GridBagConstraints.WEST; | ||||
| constraintsMessageOutputLevelLabel.insets = new Insets(4, 4, 4, 4); | constraintsMessageOutputLevelLabel.insets = new Insets(4, 4, 4, 4); | ||||
| getOptionenPanel().add(getMessageOutputLevelLabel(), constraintsMessageOutputLevelLabel); | |||||
| getOptionenPanel().add(getMessageOutputLevelLabel(), | |||||
| constraintsMessageOutputLevelLabel); | |||||
| GridBagConstraints constraintsMessageOutputLevelChoice = new GridBagConstraints(); | |||||
| constraintsMessageOutputLevelChoice.gridx = 1; constraintsMessageOutputLevelChoice.gridy = 4; | |||||
| GridBagConstraints constraintsMessageOutputLevelChoice | |||||
| = new GridBagConstraints(); | |||||
| constraintsMessageOutputLevelChoice.gridx = 1; | |||||
| constraintsMessageOutputLevelChoice.gridy = 4; | |||||
| constraintsMessageOutputLevelChoice.fill = GridBagConstraints.HORIZONTAL; | constraintsMessageOutputLevelChoice.fill = GridBagConstraints.HORIZONTAL; | ||||
| constraintsMessageOutputLevelChoice.anchor = GridBagConstraints.WEST; | constraintsMessageOutputLevelChoice.anchor = GridBagConstraints.WEST; | ||||
| constraintsMessageOutputLevelChoice.weightx = 1.0; | constraintsMessageOutputLevelChoice.weightx = 1.0; | ||||
| constraintsMessageOutputLevelChoice.insets = new Insets(4, 4, 4, 4); | constraintsMessageOutputLevelChoice.insets = new Insets(4, 4, 4, 4); | ||||
| getOptionenPanel().add(getMessageOutputLevelChoice(), constraintsMessageOutputLevelChoice); | |||||
| getOptionenPanel().add(getMessageOutputLevelChoice(), | |||||
| constraintsMessageOutputLevelChoice); | |||||
| } catch (Throwable iExc) { | } catch (Throwable iExc) { | ||||
| handleException(iExc); | handleException(iExc); | ||||
| } | } | ||||
| @@ -1333,7 +1346,10 @@ public class VAJAntToolGUI extends Frame { | |||||
| } catch (Throwable iExc) { | } catch (Throwable iExc) { | ||||
| handleException(iExc); | handleException(iExc); | ||||
| } | } | ||||
| setLocation((Toolkit.getDefaultToolkit().getScreenSize().width / 2) - (getSize().width / 2), (java.awt.Toolkit.getDefaultToolkit().getScreenSize().height / 2) - (getSize().height)); | |||||
| setLocation((Toolkit.getDefaultToolkit().getScreenSize().width / 2) | |||||
| - (getSize().width / 2), | |||||
| (java.awt.Toolkit.getDefaultToolkit().getScreenSize().height / 2) | |||||
| - (getSize().height)); | |||||
| if ((getTargetList().getItemCount() == 0) || (getTargetList().getSelectedIndex() < 0)) { | if ((getTargetList().getItemCount() == 0) || (getTargetList().getSelectedIndex() < 0)) { | ||||
| getBuildButton().setEnabled(false); | getBuildButton().setEnabled(false); | ||||
| } | } | ||||
| @@ -1373,8 +1389,10 @@ public class VAJAntToolGUI extends Frame { | |||||
| // Select the log-level given by BuildInfo | // Select the log-level given by BuildInfo | ||||
| getMessageOutputLevelChoice().select(iBuildInfo.getOutputMessageLevel()); | getMessageOutputLevelChoice().select(iBuildInfo.getOutputMessageLevel()); | ||||
| fillList(); | fillList(); | ||||
| // BuildInfo can conly be saved to a VAJ project if tool API is called via the projects context-menu | |||||
| if ((iBuildInfo.getVAJProjectName() == null) || (iBuildInfo.getVAJProjectName().equals(""))) { | |||||
| // BuildInfo can conly be saved to a VAJ project if tool API | |||||
| // is called via the projects context-menu | |||||
| if ((iBuildInfo.getVAJProjectName() == null) | |||||
| || (iBuildInfo.getVAJProjectName().equals(""))) { | |||||
| getSaveMenuItem().setEnabled(false); | getSaveMenuItem().setEnabled(false); | ||||
| } | } | ||||
| } catch (Throwable iExc) { | } catch (Throwable iExc) { | ||||
| @@ -74,12 +74,15 @@ import java.util.Iterator; | |||||
| import java.util.Vector; | import java.util.Vector; | ||||
| /** | /** | ||||
| * A MatchingTask which relies on <A HREF="http://java.sun.com/products/java-media/jai">JAI (Java Advanced Imaging)</A> | |||||
| * A MatchingTask which relies on | |||||
| * <A HREF="http://java.sun.com/products/java-media/jai">JAI (Java Advanced Imaging)</A> | |||||
| * to perform image manipulation operations on existing images. The | * to perform image manipulation operations on existing images. The | ||||
| * operations are represented as ImageOperation DataType objects. | * operations are represented as ImageOperation DataType objects. | ||||
| * The operations are arranged to conform to the Chaining Model | * The operations are arranged to conform to the Chaining Model | ||||
| * of JAI. | * of JAI. | ||||
| * Check out the <A HREF="http://java.sun.com/products/java-media/jai/forDevelopers/jai1_0_1guide-unc/">JAI Programming Guide</A> | |||||
| * Check out the | |||||
| * <A HREF="http://java.sun.com/products/java-media/jai/forDevelopers/jai1_0_1guide-unc/"> | |||||
| * JAI Programming Guide</A> | |||||
| * | * | ||||
| * @see org.apache.tools.ant.types.optional.image.ImageOperation | * @see org.apache.tools.ant.types.optional.image.ImageOperation | ||||
| * @see org.apache.tools.ant.types.DataType | * @see org.apache.tools.ant.types.DataType | ||||
| @@ -121,7 +124,9 @@ public class Image extends MatchingTask { | |||||
| } | } | ||||
| /** | /** | ||||
| * Set the image encoding type. <A HREF="http://java.sun.com/products/java-media/jai/forDevelopers/jai1_0_1guide-unc/Encode.doc.html#56610">See this table in the JAI Programming Guide</A>. | |||||
| * Set the image encoding type. | |||||
| * <A HREF="http://java.sun.com/products/java-media/jai/forDevelopers/jai1_0_1guide-unc/Encode.doc.html#56610"> | |||||
| * See this table in the JAI Programming Guide</A>. | |||||
| */ | */ | ||||
| public void setEncoding(String encoding) { | public void setEncoding(String encoding) { | ||||
| str_encoding = encoding; | str_encoding = encoding; | ||||
| @@ -144,7 +149,7 @@ public class Image extends MatchingTask { | |||||
| /** | /** | ||||
| * Sets the destination directory for manipulated images. | * Sets the destination directory for manipulated images. | ||||
| * @param destination The destination directory | |||||
| * @param destDir The destination directory | |||||
| */ | */ | ||||
| public void setDestDir(File destDir) { | public void setDestDir(File destDir) { | ||||
| this.destDir = destDir; | this.destDir = destDir; | ||||
| @@ -284,7 +289,8 @@ public class Image extends MatchingTask { | |||||
| ArrayList filesToRemove = new ArrayList(); | ArrayList filesToRemove = new ArrayList(); | ||||
| for (Iterator i = filesList.iterator(); i.hasNext();) { | for (Iterator i = filesList.iterator(); i.hasNext();) { | ||||
| File f = (File) i.next(); | File f = (File) i.next(); | ||||
| File new_file = new File(destDir.getAbsolutePath() + File.separator + f.getName()); | |||||
| File new_file = new File(destDir.getAbsolutePath() | |||||
| + File.separator + f.getName()); | |||||
| if (new_file.exists()) { | if (new_file.exists()) { | ||||
| filesToRemove.add(f); | filesToRemove.add(f); | ||||
| } | } | ||||
| @@ -89,7 +89,8 @@ public class JonasHotDeploymentTool extends GenericHotDeploymentTool implements | |||||
| /** | /** | ||||
| * All the valid actions that weblogic.deploy permits * | * All the valid actions that weblogic.deploy permits * | ||||
| */ | */ | ||||
| private static final String[] VALID_ACTIONS = {ACTION_DELETE, ACTION_DEPLOY, ACTION_LIST, ACTION_UNDEPLOY, ACTION_UPDATE}; | |||||
| private static final String[] VALID_ACTIONS | |||||
| = {ACTION_DELETE, ACTION_DEPLOY, ACTION_LIST, ACTION_UNDEPLOY, ACTION_UPDATE}; | |||||
| /** | /** | ||||
| * Description of the Field | * Description of the Field | ||||
| @@ -134,8 +134,8 @@ public class ServerDeploy extends Task { | |||||
| * <p>This method calls the deploy() method on each of the vendor-specific tools | * <p>This method calls the deploy() method on each of the vendor-specific tools | ||||
| * in the <code>vendorTools</code> collection. This performs the actual | * in the <code>vendorTools</code> collection. This performs the actual | ||||
| * process of deployment on each tool. | * process of deployment on each tool. | ||||
| * @exception org.apache.tools.ant.BuildException if the attributes are invalid or incomplete, or | |||||
| * a failure occurs in the deployment process. | |||||
| * @exception org.apache.tools.ant.BuildException if the attributes | |||||
| * are invalid or incomplete, or a failure occurs in the deployment process. | |||||
| */ | */ | ||||
| public void execute() throws BuildException { | public void execute() throws BuildException { | ||||
| for (Enumeration enum = vendorTools.elements(); | for (Enumeration enum = vendorTools.elements(); | ||||
| @@ -72,12 +72,14 @@ import org.apache.tools.ant.taskdefs.Java; | |||||
| * @see org.apache.tools.ant.taskdefs.optional.j2ee.AbstractHotDeploymentTool | * @see org.apache.tools.ant.taskdefs.optional.j2ee.AbstractHotDeploymentTool | ||||
| * @see org.apache.tools.ant.taskdefs.optional.j2ee.ServerDeploy | * @see org.apache.tools.ant.taskdefs.optional.j2ee.ServerDeploy | ||||
| */ | */ | ||||
| public class WebLogicHotDeploymentTool extends AbstractHotDeploymentTool implements HotDeploymentTool { | |||||
| public class WebLogicHotDeploymentTool extends AbstractHotDeploymentTool | |||||
| implements HotDeploymentTool { | |||||
| /** The classname of the tool to run **/ | /** The classname of the tool to run **/ | ||||
| private static final String WEBLOGIC_DEPLOY_CLASS_NAME = "weblogic.deploy"; | private static final String WEBLOGIC_DEPLOY_CLASS_NAME = "weblogic.deploy"; | ||||
| /** All the valid actions that weblogic.deploy permits **/ | /** All the valid actions that weblogic.deploy permits **/ | ||||
| private static final String[] VALID_ACTIONS = {ACTION_DELETE, ACTION_DEPLOY, ACTION_LIST, ACTION_UNDEPLOY, ACTION_UPDATE}; | |||||
| private static final String[] VALID_ACTIONS | |||||
| = {ACTION_DELETE, ACTION_DEPLOY, ACTION_LIST, ACTION_UNDEPLOY, ACTION_UPDATE}; | |||||
| /** Represents the "-debug" flag from weblogic.deploy **/ | /** Represents the "-debug" flag from weblogic.deploy **/ | ||||
| private boolean debug; | private boolean debug; | ||||
| @@ -540,7 +540,8 @@ public class JDependTask extends Task { | |||||
| commandline.createArgument().setValue(f.getPath()); | commandline.createArgument().setValue(f.getPath()); | ||||
| } | } | ||||
| Execute execute = new Execute(new LogStreamHandler(this, Project.MSG_INFO, Project.MSG_WARN), watchdog); | |||||
| Execute execute = new Execute(new LogStreamHandler(this, | |||||
| Project.MSG_INFO, Project.MSG_WARN), watchdog); | |||||
| execute.setCommandline(commandline.getCommandline()); | execute.setCommandline(commandline.getCommandline()); | ||||
| if (getDir() != null) { | if (getDir() != null) { | ||||
| execute.setWorkingDirectory(getDir()); | execute.setWorkingDirectory(getDir()); | ||||
| @@ -201,7 +201,8 @@ public class jlink extends Object { | |||||
| jlink linker = new jlink(); | jlink linker = new jlink(); | ||||
| linker.setOutfile(args[0]); | linker.setOutfile(args[0]); | ||||
| //To maintain compatibility with the command-line version, we will only add files to be merged. | |||||
| // To maintain compatibility with the command-line version, | |||||
| // we will only add files to be merged. | |||||
| for (int i = 1; i < args.length; i++) { | for (int i = 1; i < args.length; i++) { | ||||
| linker.addMergeFile(args[i]); | linker.addMergeFile(args[i]); | ||||
| } | } | ||||
| @@ -250,7 +251,8 @@ public class jlink extends Object { | |||||
| //It was the duplicate entry. | //It was the duplicate entry. | ||||
| continue; | continue; | ||||
| } else { | } else { | ||||
| //I hate to admit it, but we don't know what happened here. Throw the Exception. | |||||
| // I hate to admit it, but we don't know what happened | |||||
| // here. Throw the Exception. | |||||
| throw ex; | throw ex; | ||||
| } | } | ||||
| } | } | ||||
| @@ -273,7 +275,8 @@ public class jlink extends Object { | |||||
| /* | /* | ||||
| * Adds contents of a directory to the output. | * Adds contents of a directory to the output. | ||||
| */ | */ | ||||
| private void addDirContents(ZipOutputStream output, File dir, String prefix, boolean compress) throws IOException { | |||||
| private void addDirContents(ZipOutputStream output, File dir, String prefix, | |||||
| boolean compress) throws IOException { | |||||
| String[] contents = dir.list(); | String[] contents = dir.list(); | ||||
| for (int i = 0; i < contents.length; ++i) { | for (int i = 0; i < contents.length; ++i) { | ||||
| @@ -310,7 +313,8 @@ public class jlink extends Object { | |||||
| } catch (IOException ioe) { | } catch (IOException ioe) { | ||||
| } | } | ||||
| } | } | ||||
| System.out.println("From " + file.getPath() + " and prefix " + prefix + ", creating entry " + prefix + name); | |||||
| System.out.println("From " + file.getPath() + " and prefix " + prefix | |||||
| + ", creating entry " + prefix + name); | |||||
| return (prefix + name); | return (prefix + name); | ||||
| } | } | ||||
| @@ -318,7 +322,8 @@ public class jlink extends Object { | |||||
| /* | /* | ||||
| * Adds a file to the output stream. | * Adds a file to the output stream. | ||||
| */ | */ | ||||
| private void addFile(ZipOutputStream output, File file, String prefix, boolean compress) throws IOException { | |||||
| private void addFile(ZipOutputStream output, File file, String prefix, | |||||
| boolean compress) throws IOException { | |||||
| //Make sure file exists | //Make sure file exists | ||||
| if (!file.exists()) { | if (!file.exists()) { | ||||
| return; | return; | ||||
| @@ -339,7 +344,8 @@ public class jlink extends Object { | |||||
| /* | /* | ||||
| * A convenience method that several other methods might call. | * A convenience method that several other methods might call. | ||||
| */ | */ | ||||
| private void addToOutputStream(ZipOutputStream output, InputStream input, ZipEntry ze) throws IOException { | |||||
| private void addToOutputStream(ZipOutputStream output, InputStream input, | |||||
| ZipEntry ze) throws IOException { | |||||
| try { | try { | ||||
| output.putNextEntry(ze); | output.putNextEntry(ze); | ||||
| } catch (ZipException zipEx) { | } catch (ZipException zipEx) { | ||||
| @@ -81,8 +81,8 @@ public class Jasper41Mangler implements JspMangler { | |||||
| int end = jspUri.length(); | int end = jspUri.length(); | ||||
| StringBuffer modifiedClassName; | StringBuffer modifiedClassName; | ||||
| modifiedClassName = new StringBuffer(jspUri.length() - start); | modifiedClassName = new StringBuffer(jspUri.length() - start); | ||||
| if (!Character.isJavaIdentifierStart(jspUri.charAt(start)) || | |||||
| jspUri.charAt(start) == '_') { | |||||
| if (!Character.isJavaIdentifierStart(jspUri.charAt(start)) | |||||
| || jspUri.charAt(start) == '_') { | |||||
| // If the first char is not a start of Java identifier or is _ | // If the first char is not a start of Java identifier or is _ | ||||
| // prepend a '_'. | // prepend a '_'. | ||||
| modifiedClassName.append('_'); | modifiedClassName.append('_'); | ||||
| @@ -74,16 +74,19 @@ import org.apache.tools.ant.types.Path; | |||||
| * | * | ||||
| * required attributes | * required attributes | ||||
| * src : root of source tree for JSP, ie, the document root for your weblogic server | * src : root of source tree for JSP, ie, the document root for your weblogic server | ||||
| * dest : root of destination directory, what you have set as WorkingDir in the weblogic properties | |||||
| * dest : root of destination directory, what you have set as | |||||
| * WorkingDir in the weblogic properties | |||||
| * package : start package name under which your JSP's would be compiled | * package : start package name under which your JSP's would be compiled | ||||
| * | * | ||||
| * other attributes | * other attributes | ||||
| * classpath | * classpath | ||||
| * | * | ||||
| * A classpath should be set which contains the weblogic classes as well as all application classes | |||||
| * referenced by the JSP. The system classpath is also appended when the jspc is called, so you may | |||||
| * choose to put everything in the classpath while calling Ant. However, since presumably the JSP's will reference | |||||
| * classes being build by Ant, it would be better to explicitly add the classpath in the task | |||||
| * A classpath should be set which contains the weblogic classes as well as all | |||||
| * application classes referenced by the JSP. The system classpath is also | |||||
| * appended when the jspc is called, so you may choose to put everything in | |||||
| * the classpath while calling Ant. However, since presumably the JSP's will | |||||
| * reference classes being build by Ant, it would be better to explicitly add | |||||
| * the classpath in the task | |||||
| * | * | ||||
| * The task checks timestamps on the JSP's and the generated classes, and compiles | * The task checks timestamps on the JSP's and the generated classes, and compiles | ||||
| * only those files that have changed. | * only those files that have changed. | ||||
| @@ -92,13 +95,15 @@ import org.apache.tools.ant.types.Path; | |||||
| * <b> _dirName/_fileName.class for dirname/fileName.jsp </b> | * <b> _dirName/_fileName.class for dirname/fileName.jsp </b> | ||||
| * | * | ||||
| * Limitation: It compiles the files thru the Classic compiler only. | * Limitation: It compiles the files thru the Classic compiler only. | ||||
| * Limitation: Since it is my experience that weblogic jspc throws out of memory error on being given too | |||||
| * many files at one go, it is called multiple times with one jsp file each. | |||||
| * Limitation: Since it is my experience that weblogic jspc throws out of | |||||
| * memory error on being given too many files at one go, it is | |||||
| * called multiple times with one jsp file each. | |||||
| * | * | ||||
| * <pre> | * <pre> | ||||
| * example | * example | ||||
| * <target name="jspcompile" depends="compile"> | * <target name="jspcompile" depends="compile"> | ||||
| * <wljspc src="c:\\weblogic\\myserver\\public_html" dest="c:\\weblogic\\myserver\\serverclasses" package="myapp.jsp"> | |||||
| * <wljspc src="c:\\weblogic\\myserver\\public_html" | |||||
| * dest="c:\\weblogic\\myserver\\serverclasses" package="myapp.jsp"> | |||||
| * <classpath> | * <classpath> | ||||
| * <pathelement location="${weblogic.classpath}" /> | * <pathelement location="${weblogic.classpath}" /> | ||||
| * <pathelement path="${compile.dest}" /> | * <pathelement path="${compile.dest}" /> | ||||
| @@ -305,8 +310,8 @@ public class WLJspc extends MatchingTask { | |||||
| } | } | ||||
| String filePath = pack + File.separator + "_"; | String filePath = pack + File.separator + "_"; | ||||
| int startingIndex | |||||
| = files[i].lastIndexOf(File.separator) != -1 ? files[i].lastIndexOf(File.separator) + 1 : 0; | |||||
| int startingIndex = files[i].lastIndexOf(File.separator) != -1 | |||||
| ? files[i].lastIndexOf(File.separator) + 1 : 0; | |||||
| int endingIndex = files[i].indexOf(".jsp"); | int endingIndex = files[i].indexOf(".jsp"); | ||||
| if (endingIndex == -1) { | if (endingIndex == -1) { | ||||
| log("Skipping " + files[i] + ". Not a JSP", | log("Skipping " + files[i] + ". Not a JSP", | ||||
| @@ -63,12 +63,13 @@ import org.apache.tools.ant.Project; | |||||
| import org.apache.tools.ant.types.FileSet; | import org.apache.tools.ant.types.FileSet; | ||||
| /** | /** | ||||
| * <p> Create then run <code>JUnitTest</code>'s based on the list of files given by the fileset attribute. | |||||
| * <p> Create then run <code>JUnitTest</code>'s based on the list of files | |||||
| * given by the fileset attribute. | |||||
| * | * | ||||
| * <p> Every <code>.java</code> or <code>.class</code> file in the fileset is | * <p> Every <code>.java</code> or <code>.class</code> file in the fileset is | ||||
| * assumed to be a testcase. | * assumed to be a testcase. | ||||
| * A <code>JUnitTest</code> is created for each of these named classes with basic setup | |||||
| * inherited from the parent <code>BatchTest</code>. | |||||
| * A <code>JUnitTest</code> is created for each of these named classes with | |||||
| * basic setup inherited from the parent <code>BatchTest</code>. | |||||
| * | * | ||||
| * @author <a href="mailto:jeff.martin@synamic.co.uk">Jeff Martin</a> | * @author <a href="mailto:jeff.martin@synamic.co.uk">Jeff Martin</a> | ||||
| * @author Stefan Bodewig | * @author Stefan Bodewig | ||||
| @@ -181,11 +181,11 @@ public class BriefJUnitResultFormatter implements JUnitResultFormatter { | |||||
| output.write(results.toString()); | output.write(results.toString()); | ||||
| output.flush(); | output.flush(); | ||||
| } finally { | } finally { | ||||
| if (out != System.out && | |||||
| out != System.err) { | |||||
| if (out != System.out && out != System.err) { | |||||
| try { | try { | ||||
| out.close(); | out.close(); | ||||
| } catch (IOException e) { | } catch (IOException e) { | ||||
| // ignore | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -167,8 +167,8 @@ public final class DOMUtil { | |||||
| final int len = childList.getLength(); | final int len = childList.getLength(); | ||||
| for (int i = 0; i < len; i++) { | for (int i = 0; i < len; i++) { | ||||
| Node child = childList.item(i); | Node child = childList.item(i); | ||||
| if (child != null && child.getNodeType() == Node.ELEMENT_NODE && | |||||
| child.getNodeName().equals(tagname)) { | |||||
| if (child != null && child.getNodeType() == Node.ELEMENT_NODE | |||||
| && child.getNodeName().equals(tagname)) { | |||||
| return (Element) child; | return (Element) child; | ||||
| } | } | ||||
| } | } | ||||
| @@ -63,14 +63,16 @@ import org.apache.tools.ant.types.EnumeratedAttribute; | |||||
| /** | /** | ||||
| * <p> A wrapper for the implementations of <code>JUnitResultFormatter</code>. | * <p> A wrapper for the implementations of <code>JUnitResultFormatter</code>. | ||||
| * In particular, used as a nested <code><formatter></code> element in a <code><junit></code> task. | |||||
| * In particular, used as a nested <code><formatter></code> element in | |||||
| * a <code><junit></code> task. | |||||
| * <p> For example, | * <p> For example, | ||||
| * <code><pre> | * <code><pre> | ||||
| * <junit printsummary="no" haltonfailure="yes" fork="false"> | * <junit printsummary="no" haltonfailure="yes" fork="false"> | ||||
| * <formatter type="plain" usefile="false" /> | * <formatter type="plain" usefile="false" /> | ||||
| * <test name="org.apache.ecs.InternationalCharTest" /> | * <test name="org.apache.ecs.InternationalCharTest" /> | ||||
| * </junit></pre></code> | * </junit></pre></code> | ||||
| * adds a <code>plain</code> type implementation (<code>PlainJUnitResultFormatter</code>) to display the results of the test. | |||||
| * adds a <code>plain</code> type implementation | |||||
| * (<code>PlainJUnitResultFormatter</code>) to display the results of the test. | |||||
| * | * | ||||
| * <p> Either the <code>type</code> or the <code>classname</code> attribute | * <p> Either the <code>type</code> or the <code>classname</code> attribute | ||||
| * must be set. | * must be set. | ||||
| @@ -104,7 +106,8 @@ public class FormatterElement { | |||||
| * <li> The <code>plain</code> type (the default) uses a <code>PlainJUnitResultFormatter</code>. | * <li> The <code>plain</code> type (the default) uses a <code>PlainJUnitResultFormatter</code>. | ||||
| * </ul> | * </ul> | ||||
| * | * | ||||
| * <p> Sets <code>classname</code> attribute - so you can't use that attribute if you use this one. | |||||
| * <p> Sets <code>classname</code> attribute - so you can't use that | |||||
| * attribute if you use this one. | |||||
| */ | */ | ||||
| public void setType(TypeAttribute type) { | public void setType(TypeAttribute type) { | ||||
| if ("xml".equals(type.getValue())) { | if ("xml".equals(type.getValue())) { | ||||
| @@ -202,8 +205,8 @@ public class FormatterElement { | |||||
| public boolean shouldUse(Task t) { | public boolean shouldUse(Task t) { | ||||
| if (ifProperty != null && t.getProject().getProperty(ifProperty) == null) { | if (ifProperty != null && t.getProject().getProperty(ifProperty) == null) { | ||||
| return false; | return false; | ||||
| } else if (unlessProperty != null && | |||||
| t.getProject().getProperty(unlessProperty) != null) { | |||||
| } else if (unlessProperty != null | |||||
| && t.getProject().getProperty(unlessProperty) != null) { | |||||
| return false; | return false; | ||||
| } | } | ||||
| @@ -681,8 +681,7 @@ public class JUnitTask extends Task { | |||||
| // forked test | // forked test | ||||
| File propsFile = | File propsFile = | ||||
| FileUtils.newFileUtils().createTempFile("junit", ".properties", | FileUtils.newFileUtils().createTempFile("junit", ".properties", | ||||
| tmpDir != null ? tmpDir : | |||||
| getProject().getBaseDir()); | |||||
| tmpDir != null ? tmpDir : getProject().getBaseDir()); | |||||
| cmd.createArgument().setValue("propsfile=" | cmd.createArgument().setValue("propsfile=" | ||||
| + propsFile.getAbsolutePath()); | + propsFile.getAbsolutePath()); | ||||
| Hashtable p = getProject().getProperties(); | Hashtable p = getProject().getProperties(); | ||||
| @@ -178,8 +178,8 @@ public class JUnitTest extends BaseTest implements Cloneable { | |||||
| public boolean shouldRun(Project p) { | public boolean shouldRun(Project p) { | ||||
| if (ifProperty != null && p.getProperty(ifProperty) == null) { | if (ifProperty != null && p.getProperty(ifProperty) == null) { | ||||
| return false; | return false; | ||||
| } else if (unlessProperty != null && | |||||
| p.getProperty(unlessProperty) != null) { | |||||
| } else if (unlessProperty != null | |||||
| && p.getProperty(unlessProperty) != null) { | |||||
| return false; | return false; | ||||
| } | } | ||||
| @@ -108,8 +108,8 @@ public class JUnitVersionHelper { | |||||
| getNameMethod = t.getClass().getMethod("name", | getNameMethod = t.getClass().getMethod("name", | ||||
| new Class [0]); | new Class [0]); | ||||
| } | } | ||||
| if (getNameMethod != null && | |||||
| getNameMethod.getReturnType() == String.class) { | |||||
| if (getNameMethod != null | |||||
| && getNameMethod.getReturnType() == String.class) { | |||||
| return (String) getNameMethod.invoke(t, new Object[0]); | return (String) getNameMethod.invoke(t, new Object[0]); | ||||
| } | } | ||||
| } catch (Throwable e) { | } catch (Throwable e) { | ||||
| @@ -278,15 +278,19 @@ public class XMLResultAggregator extends Task implements XMLConstants { | |||||
| addTestSuite(rootElement, elem); | addTestSuite(rootElement, elem); | ||||
| } else { | } else { | ||||
| // issue a warning. | // issue a warning. | ||||
| log("the file " + files[i] + " is not a valid testsuite XML document", Project.MSG_WARN); | |||||
| log("the file " + files[i] | |||||
| + " is not a valid testsuite XML document", | |||||
| Project.MSG_WARN); | |||||
| } | } | ||||
| } catch (SAXException e) { | } catch (SAXException e) { | ||||
| // a testcase might have failed and write a zero-length document, | // a testcase might have failed and write a zero-length document, | ||||
| // It has already failed, but hey.... mm. just put a warning | // It has already failed, but hey.... mm. just put a warning | ||||
| log("The file " + files[i] + " is not a valid XML document. It is possibly corrupted.", Project.MSG_WARN); | |||||
| log("The file " + files[i] + " is not a valid XML document. " | |||||
| + "It is possibly corrupted.", Project.MSG_WARN); | |||||
| log(StringUtils.getStackTrace(e), Project.MSG_DEBUG); | log(StringUtils.getStackTrace(e), Project.MSG_DEBUG); | ||||
| } catch (IOException e) { | } catch (IOException e) { | ||||
| log("Error while accessing file " + files[i] + ": " + e.getMessage(), Project.MSG_ERR); | |||||
| log("Error while accessing file " + files[i] + ": " | |||||
| + e.getMessage(), Project.MSG_ERR); | |||||
| } | } | ||||
| } | } | ||||
| return rootElement; | return rootElement; | ||||
| @@ -123,7 +123,8 @@ abstract class XalanExecutor { | |||||
| xalan1missing.printStackTrace(new PrintWriter(swr)); | xalan1missing.printStackTrace(new PrintWriter(swr)); | ||||
| caller.task.log("Didn't find Xalan1.", Project.MSG_DEBUG); | caller.task.log("Didn't find Xalan1.", Project.MSG_DEBUG); | ||||
| caller.task.log(swr.toString(), Project.MSG_DEBUG); | caller.task.log(swr.toString(), Project.MSG_DEBUG); | ||||
| throw new BuildException("Could not find xalan2 nor xalan1 in the classpath. Check http://xml.apache.org/xalan-j"); | |||||
| throw new BuildException("Could not find xalan2 nor xalan1 " | |||||
| + "in the classpath. Check http://xml.apache.org/xalan-j"); | |||||
| } | } | ||||
| } | } | ||||
| String version = getXalanVersion(procVersion); | String version = getXalanVersion(procVersion); | ||||
| @@ -335,7 +335,8 @@ public abstract class AbstractMetamataTask extends Task { | |||||
| DirectoryScanner ds = fs.getDirectoryScanner(getProject()); | DirectoryScanner ds = fs.getDirectoryScanner(getProject()); | ||||
| ds.scan(); | ds.scan(); | ||||
| String[] f = ds.getIncludedFiles(); | String[] f = ds.getIncludedFiles(); | ||||
| log(i + ") Adding " + f.length + " files from directory " + ds.getBasedir(), Project.MSG_VERBOSE); | |||||
| log(i + ") Adding " + f.length + " files from directory " | |||||
| + ds.getBasedir(), Project.MSG_VERBOSE); | |||||
| for (int j = 0; j < f.length; j++) { | for (int j = 0; j < f.length; j++) { | ||||
| String pathname = f[j]; | String pathname = f[j]; | ||||
| if (pathname.endsWith(".java")) { | if (pathname.endsWith(".java")) { | ||||
| @@ -68,10 +68,11 @@ import org.apache.tools.ant.types.Path; | |||||
| /** | /** | ||||
| * Invokes the Metamata Audit/ Webgain Quality Analyzer on a set of Java files. | * Invokes the Metamata Audit/ Webgain Quality Analyzer on a set of Java files. | ||||
| * <p> | * <p> | ||||
| * <i>maudit</i> performs static analysis of the Java source code and byte code files to find and report | |||||
| * errors of style and potential problems related to performance, maintenance and robustness. | |||||
| * As a convenience, a stylesheet is given in <tt>etc</tt> directory, so that an HTML report | |||||
| * can be generated from the XML file. | |||||
| * <i>maudit</i> performs static analysis of the Java source code and byte | |||||
| * code files to find and report errors of style and potential problems related | |||||
| * to performance, maintenance and robustness. As a convenience, a stylesheet | |||||
| * is given in <tt>etc</tt> directory, so that an HTML report can be generated | |||||
| * from the XML file. | |||||
| * | * | ||||
| * @author <a href="mailto:sbailliez@apache.org">Stephane Bailliez</a> | * @author <a href="mailto:sbailliez@apache.org">Stephane Bailliez</a> | ||||
| */ | */ | ||||
| @@ -310,10 +311,12 @@ public class MAudit extends AbstractMetamataTask { | |||||
| protected void checkOptions() throws BuildException { | protected void checkOptions() throws BuildException { | ||||
| super.checkOptions(); | super.checkOptions(); | ||||
| if (unused && searchPath == null) { | if (unused && searchPath == null) { | ||||
| throw new BuildException("'searchpath' element must be set when looking for 'unused' declarations."); | |||||
| throw new BuildException("'searchpath' element must be set when " | |||||
| + "looking for 'unused' declarations."); | |||||
| } | } | ||||
| if (!unused && searchPath != null) { | if (!unused && searchPath != null) { | ||||
| log("'searchpath' element ignored. 'unused' attribute is disabled.", Project.MSG_WARN); | |||||
| log("'searchpath' element ignored. 'unused' attribute is disabled.", | |||||
| Project.MSG_WARN); | |||||
| } | } | ||||
| if (rulesPath != null) { | if (rulesPath != null) { | ||||
| cmdl.createClasspath(getProject()).addExisting(rulesPath); | cmdl.createClasspath(getProject()).addExisting(rulesPath); | ||||
| @@ -167,18 +167,24 @@ class MAuditStreamHandler implements ExecuteStreamHandler { | |||||
| Enumeration keys = auditedFiles.keys(); | Enumeration keys = auditedFiles.keys(); | ||||
| Hashtable filemapping = task.getFileMapping(); | Hashtable filemapping = task.getFileMapping(); | ||||
| final Date now = new Date(); | final Date now = new Date(); | ||||
| rootElement.setAttribute("snapshot_created", DateUtils.format(now, DateUtils.ISO8601_DATETIME_PATTERN)); | |||||
| rootElement.setAttribute("elapsed_time", String.valueOf(now.getTime() - program_start.getTime())); | |||||
| rootElement.setAttribute("program_start", DateUtils.format(now, DateUtils.ISO8601_DATETIME_PATTERN)); | |||||
| rootElement.setAttribute("audited", String.valueOf(filemapping.size())); | |||||
| rootElement.setAttribute("reported", String.valueOf(auditedFiles.size())); | |||||
| rootElement.setAttribute("snapshot_created", | |||||
| DateUtils.format(now, DateUtils.ISO8601_DATETIME_PATTERN)); | |||||
| rootElement.setAttribute("elapsed_time", | |||||
| String.valueOf(now.getTime() - program_start.getTime())); | |||||
| rootElement.setAttribute("program_start", | |||||
| DateUtils.format(now, DateUtils.ISO8601_DATETIME_PATTERN)); | |||||
| rootElement.setAttribute("audited", | |||||
| String.valueOf(filemapping.size())); | |||||
| rootElement.setAttribute("reported", | |||||
| String.valueOf(auditedFiles.size())); | |||||
| int errors = 0; | int errors = 0; | ||||
| while (keys.hasMoreElements()) { | while (keys.hasMoreElements()) { | ||||
| String filepath = (String) keys.nextElement(); | String filepath = (String) keys.nextElement(); | ||||
| Vector v = (Vector) auditedFiles.get(filepath); | Vector v = (Vector) auditedFiles.get(filepath); | ||||
| String fullclassname = (String) filemapping.get(filepath); | String fullclassname = (String) filemapping.get(filepath); | ||||
| if (fullclassname == null) { | if (fullclassname == null) { | ||||
| task.getProject().log("Could not find class mapping for " + filepath, Project.MSG_WARN); | |||||
| task.getProject().log("Could not find class mapping for " | |||||
| + filepath, Project.MSG_WARN); | |||||
| continue; | continue; | ||||
| } | } | ||||
| int pos = fullclassname.lastIndexOf('.'); | int pos = fullclassname.lastIndexOf('.'); | ||||
| @@ -177,11 +177,14 @@ Format Options | |||||
| throw new BuildException("Output XML file must be set via 'tofile' attribute."); | throw new BuildException("Output XML file must be set via 'tofile' attribute."); | ||||
| } | } | ||||
| if (path == null && fileSets.size() == 0) { | if (path == null && fileSets.size() == 0) { | ||||
| throw new BuildException("Must set either paths (path element) or files (fileset element)"); | |||||
| throw new BuildException("Must set either paths (path element) " | |||||
| + "or files (fileset element)"); | |||||
| } | } | ||||
| // I don't accept dirs and files at the same time, I cannot recognize the semantic in the result | |||||
| // I don't accept dirs and files at the same time, | |||||
| // I cannot recognize the semantic in the result | |||||
| if (path != null && fileSets.size() > 0) { | if (path != null && fileSets.size() > 0) { | ||||
| throw new BuildException("Cannot set paths (path element) and files (fileset element) at the same time"); | |||||
| throw new BuildException("Cannot set paths (path element) and " | |||||
| + "files (fileset element) at the same time"); | |||||
| } | } | ||||
| tmpFile = createTmpFile(); | tmpFile = createTmpFile(); | ||||
| } | } | ||||
| @@ -172,7 +172,8 @@ public class MMetricsStreamHandler implements ExecuteStreamHandler { | |||||
| attr.addAttribute("", "company", "company", "CDATA", "metamata"); | attr.addAttribute("", "company", "company", "CDATA", "metamata"); | ||||
| attr.addAttribute("", "snapshot_created", "snapshot_created", "CDATA", | attr.addAttribute("", "snapshot_created", "snapshot_created", "CDATA", | ||||
| DateUtils.format(now, DateUtils.ISO8601_DATETIME_PATTERN)); | DateUtils.format(now, DateUtils.ISO8601_DATETIME_PATTERN)); | ||||
| // attr.addAttribute("", "elapsed_time", "elapsed_time", "CDATA", String.valueOf(now.getTime() - program_start.getTime())); | |||||
| // attr.addAttribute("", "elapsed_time", "elapsed_time", "CDATA", | |||||
| // String.valueOf(now.getTime() - program_start.getTime())); | |||||
| attr.addAttribute("", "program_start", "program_start", "CDATA", | attr.addAttribute("", "program_start", "program_start", "CDATA", | ||||
| DateUtils.format(new Date(), DateUtils.ISO8601_DATETIME_PATTERN)); | DateUtils.format(new Date(), DateUtils.ISO8601_DATETIME_PATTERN)); | ||||
| metricsHandler.startElement("", "metrics", "metrics", attr); | metricsHandler.startElement("", "metrics", "metrics", attr); | ||||
| @@ -424,7 +425,8 @@ class MetricsElement { | |||||
| // there should be exactly 14 tokens (1 name + 13 metrics), if not, there is a problem ! | // there should be exactly 14 tokens (1 name + 13 metrics), if not, there is a problem ! | ||||
| if (metrics.size() != 14) { | if (metrics.size() != 14) { | ||||
| throw new ParseException("Could not parse the following line as a metrics: -->" + line + "<--", -1); | |||||
| throw new ParseException("Could not parse the following line as " | |||||
| + "a metrics: -->" + line + "<--", -1); | |||||
| } | } | ||||
| // remove the first token it's made of the indentation string and the | // remove the first token it's made of the indentation string and the | ||||
| @@ -226,8 +226,8 @@ public class RExecTask extends Task { | |||||
| Calendar endTime = Calendar.getInstance(); | Calendar endTime = Calendar.getInstance(); | ||||
| endTime.add(Calendar.SECOND, timeout.intValue()); | endTime.add(Calendar.SECOND, timeout.intValue()); | ||||
| while (sb.toString().indexOf(s) == -1) { | while (sb.toString().indexOf(s) == -1) { | ||||
| while (Calendar.getInstance().before(endTime) && | |||||
| is.available() == 0) { | |||||
| while (Calendar.getInstance().before(endTime) | |||||
| && is.available() == 0) { | |||||
| Thread.sleep(250); | Thread.sleep(250); | ||||
| } | } | ||||
| if (is.available() == 0) { | if (is.available() == 0) { | ||||
| @@ -270,8 +270,8 @@ public class SetProxy extends Task { | |||||
| //for Java1.1 we need to tell the system that the settings are new | //for Java1.1 we need to tell the system that the settings are new | ||||
| if (settingsChanged && | |||||
| JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1)) { | |||||
| if (settingsChanged | |||||
| && JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1)) { | |||||
| legacyResetProxySettingsCall(enablingProxy); | legacyResetProxySettingsCall(enablingProxy); | ||||
| } | } | ||||
| } | } | ||||
| @@ -524,7 +524,7 @@ public class Pvcs extends org.apache.tools.ant.Task { | |||||
| * should be set to the bin directory of the PVCS installation containing | * should be set to the bin directory of the PVCS installation containing | ||||
| * the executables mentioned before. If this attribute isn't specified the | * the executables mentioned before. If this attribute isn't specified the | ||||
| * tag expects the executables to be found using the PATH environment variable. | * tag expects the executables to be found using the PATH environment variable. | ||||
| * @param ws String | |||||
| * @param bin PVCS bin directory | |||||
| * @todo use a File setter and resolve paths. | * @todo use a File setter and resolve paths. | ||||
| */ | */ | ||||
| public void setPvcsbin(String bin) { | public void setPvcsbin(String bin) { | ||||
| @@ -241,8 +241,8 @@ public class AntStarTeamCheckOut extends org.apache.tools.ant.Task { | |||||
| // Because of the way I create the full target path, there | // Because of the way I create the full target path, there | ||||
| // must be NO slash at the end of targetFolder and folderName | // must be NO slash at the end of targetFolder and folderName | ||||
| // However, if the slash or backslash is the only character, leave it alone | // However, if the slash or backslash is the only character, leave it alone | ||||
| if ((getTargetFolder().endsWith("/") || | |||||
| getTargetFolder().endsWith("\\")) | |||||
| if ((getTargetFolder().endsWith("/") | |||||
| || getTargetFolder().endsWith("\\")) | |||||
| && getTargetFolder().length() > 1) { | && getTargetFolder().length() > 1) { | ||||
| setTargetFolder(getTargetFolder().substring(0, getTargetFolder().length() - 1)); | setTargetFolder(getTargetFolder().substring(0, getTargetFolder().length() - 1)); | ||||
| } | } | ||||
| @@ -453,7 +453,8 @@ public class AntStarTeamCheckOut extends org.apache.tools.ant.Task { | |||||
| // Replace the projectName in the file's absolute path to the viewName. | // Replace the projectName in the file's absolute path to the viewName. | ||||
| // This makes the root target of a checkout operation equal to: | // This makes the root target of a checkout operation equal to: | ||||
| // targetFolder + dirName | // targetFolder + dirName | ||||
| StringTokenizer pathTokenizer = new StringTokenizer(rootSourceFolder.getFolderHierarchy(), delim); | |||||
| StringTokenizer pathTokenizer | |||||
| = new StringTokenizer(rootSourceFolder.getFolderHierarchy(), delim); | |||||
| String currentToken = null; | String currentToken = null; | ||||
| boolean foundRoot = false; | boolean foundRoot = false; | ||||
| @@ -500,7 +501,8 @@ public class AntStarTeamCheckOut extends org.apache.tools.ant.Task { | |||||
| Folder[] subfolders = f.getSubFolders(); | Folder[] subfolders = f.getSubFolders(); | ||||
| for (int i = 0; i < subfolders.length; i++) { | for (int i = 0; i < subfolders.length; i++) { | ||||
| runFolder(s, p, v, t, subfolders[i], new java.io.File(tgt, subfolders[i].getName())); | |||||
| runFolder(s, p, v, t, subfolders[i], | |||||
| new java.io.File(tgt, subfolders[i].getName())); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -881,7 +883,7 @@ public class AntStarTeamCheckOut extends org.apache.tools.ant.Task { | |||||
| /** | /** | ||||
| * Sets the <CODE>targetFolder</CODE> attribute to the given value. | * Sets the <CODE>targetFolder</CODE> attribute to the given value. | ||||
| * | * | ||||
| * @param target The target path on the local machine to check out to. | |||||
| * @param targetFolder The target path on the local machine to check out to. | |||||
| * @see #getTargetFolder() | * @see #getTargetFolder() | ||||
| */ | */ | ||||
| public void setTargetFolder(String targetFolder) { | public void setTargetFolder(String targetFolder) { | ||||
| @@ -988,7 +990,8 @@ public class AntStarTeamCheckOut extends org.apache.tools.ant.Task { | |||||
| * <BR> | * <BR> | ||||
| * Separate multiple inlcude filters by <I>spaces</I> , not commas as Ant | * Separate multiple inlcude filters by <I>spaces</I> , not commas as Ant | ||||
| * uses. For example, if you want to check out all .java and .class\ | * uses. For example, if you want to check out all .java and .class\ | ||||
| * files, you would put the following line in your program: <CODE>setIncludes("*.java *.class");</CODE> | |||||
| * files, you would put the following line in your program: | |||||
| * <CODE>setIncludes("*.java *.class");</CODE> | |||||
| * Finally, note that filters have no effect on the <B>directories</B> | * Finally, note that filters have no effect on the <B>directories</B> | ||||
| * that are scanned; you could not check out files from directories with | * that are scanned; you could not check out files from directories with | ||||
| * names beginning only with "build," for instance. Of course, you could | * names beginning only with "build," for instance. Of course, you could | ||||
| @@ -1042,7 +1045,8 @@ public class AntStarTeamCheckOut extends org.apache.tools.ant.Task { | |||||
| * <BR> | * <BR> | ||||
| * Separate multiple exlcude filters by <I>spaces</I> , not commas as Ant | * Separate multiple exlcude filters by <I>spaces</I> , not commas as Ant | ||||
| * uses. For example, if you want to check out all files except .XML and | * uses. For example, if you want to check out all files except .XML and | ||||
| * .HTML files, you would put the following line in your program: <CODE>setExcludes("*.XML *.HTML");</CODE> | |||||
| * .HTML files, you would put the following line in your program: | |||||
| * <CODE>setExcludes("*.XML *.HTML");</CODE> | |||||
| * Finally, note that filters have no effect on the <B>directories</B> | * Finally, note that filters have no effect on the <B>directories</B> | ||||
| * that are scanned; you could not skip over all files in directories | * that are scanned; you could not skip over all files in directories | ||||
| * whose names begin with "project," for instance. <BR> | * whose names begin with "project," for instance. <BR> | ||||
| @@ -331,11 +331,9 @@ public class ScriptDef extends Task { | |||||
| /** | /** | ||||
| * Execute the script. | * Execute the script. | ||||
| * | * | ||||
| * @param scriptConfig the RuntimeConfigurable which contains the attribute | |||||
| * definitions for the script task instance. | |||||
| * @param attributes collection of attributes | |||||
| * | * | ||||
| * @param elements a list of UnknownElements which contain the configuration | |||||
| * of the nested elements of the script instance. | |||||
| * @param elements a list of nested element values. | |||||
| */ | */ | ||||
| public void executeScript(Map attributes, Map elements) { | public void executeScript(Map attributes, Map elements) { | ||||
| try { | try { | ||||
| @@ -130,7 +130,8 @@ public class CovMerge extends CovBase { | |||||
| cmdl.createArgument().setValue(tofile.getPath()); | cmdl.createArgument().setValue(tofile.getPath()); | ||||
| } | } | ||||
| LogStreamHandler handler = new LogStreamHandler(this, Project.MSG_INFO, Project.MSG_WARN); | |||||
| LogStreamHandler handler | |||||
| = new LogStreamHandler(this, Project.MSG_INFO, Project.MSG_WARN); | |||||
| Execute exec = new Execute(handler); | Execute exec = new Execute(handler); | ||||
| log(cmdl.describeCommand(), Project.MSG_VERBOSE); | log(cmdl.describeCommand(), Project.MSG_VERBOSE); | ||||
| exec.setCommandline(cmdl.getCommandline()); | exec.setCommandline(cmdl.getCommandline()); | ||||
| @@ -294,13 +294,15 @@ public class CovReport extends CovBase { | |||||
| } | } | ||||
| // use the custom handler for stdin issues | // use the custom handler for stdin issues | ||||
| LogStreamHandler handler = new LogStreamHandler(this, Project.MSG_INFO, Project.MSG_WARN); | |||||
| LogStreamHandler handler | |||||
| = new LogStreamHandler(this, Project.MSG_INFO, Project.MSG_WARN); | |||||
| Execute exec = new Execute(handler); | Execute exec = new Execute(handler); | ||||
| log(cmdl.describeCommand(), Project.MSG_VERBOSE); | log(cmdl.describeCommand(), Project.MSG_VERBOSE); | ||||
| exec.setCommandline(cmdl.getCommandline()); | exec.setCommandline(cmdl.getCommandline()); | ||||
| int exitValue = exec.execute(); | int exitValue = exec.execute(); | ||||
| if (exitValue != 0) { | if (exitValue != 0) { | ||||
| throw new BuildException("JProbe Coverage Report failed (" + exitValue + ")"); | |||||
| throw new BuildException("JProbe Coverage Report failed (" | |||||
| + exitValue + ")"); | |||||
| } | } | ||||
| log("coveragePath: " + coveragePath, Project.MSG_VERBOSE); | log("coveragePath: " + coveragePath, Project.MSG_VERBOSE); | ||||
| log("format: " + format, Project.MSG_VERBOSE); | log("format: " + format, Project.MSG_VERBOSE); | ||||
| @@ -396,7 +398,8 @@ public class CovReport extends CovBase { | |||||
| Result res = new StreamResult("file:///" + tofile.toString()); | Result res = new StreamResult("file:///" + tofile.toString()); | ||||
| transformer.transform(src, res); | transformer.transform(src, res); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| throw new BuildException("Error while performing enhanced XML report from file " + tofile, e); | |||||
| throw new BuildException("Error while performing enhanced XML " | |||||
| + "report from file " + tofile, e); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -109,7 +109,8 @@ public class ReportFilters { | |||||
| result = result && !matcher.matches(methodname); | result = result && !matcher.matches(methodname); | ||||
| } else { | } else { | ||||
| //not possible | //not possible | ||||
| throw new IllegalArgumentException("Invalid filter element: " + filter.getClass().getName()); | |||||
| throw new IllegalArgumentException("Invalid filter element: " | |||||
| + filter.getClass().getName()); | |||||
| } | } | ||||
| } | } | ||||
| return result; | return result; | ||||
| @@ -94,7 +94,10 @@ public class XMLReport { | |||||
| /** parsed document */ | /** parsed document */ | ||||
| private Document report; | private Document report; | ||||
| /** mapping of class names to <code>ClassFile</code>s from the reference classpath. It is used to filter the JProbe report. */ | |||||
| /** | |||||
| * mapping of class names to <code>ClassFile</code>s from the reference | |||||
| * classpath. It is used to filter the JProbe report. | |||||
| */ | |||||
| private Hashtable classFiles; | private Hashtable classFiles; | ||||
| /** mapping package name / package node for faster access */ | /** mapping package name / package node for faster access */ | ||||
| @@ -160,7 +163,8 @@ public class XMLReport { | |||||
| for (int k = methodlen - 1; k > -1; k--) { | for (int k = methodlen - 1; k > -1; k--) { | ||||
| Element meth = (Element) methods.item(k); | Element meth = (Element) methods.item(k); | ||||
| StringBuffer methodname = new StringBuffer(meth.getAttribute("name")); | StringBuffer methodname = new StringBuffer(meth.getAttribute("name")); | ||||
| methodname.delete(methodname.toString().indexOf("("), methodname.toString().length()); | |||||
| methodname.delete(methodname.toString().indexOf("("), | |||||
| methodname.toString().length()); | |||||
| String signature = classname + "." + methodname + "()"; | String signature = classname + "." + methodname + "()"; | ||||
| if (filters.accept(signature)) { | if (filters.accept(signature)) { | ||||
| log("kept method:" + signature); | log("kept method:" + signature); | ||||
| @@ -280,8 +284,8 @@ public class XMLReport { | |||||
| MethodInfo method = methods[i]; | MethodInfo method = methods[i]; | ||||
| String methodSig = getMethodSignature(method); | String methodSig = getMethodSignature(method); | ||||
| Element methodNode = (Element) methodNodeList.get(methodSig); | Element methodNode = (Element) methodNodeList.get(methodSig); | ||||
| if (methodNode != null && | |||||
| Utils.isAbstract(method.getAccessFlags())) { | |||||
| if (methodNode != null | |||||
| && Utils.isAbstract(method.getAccessFlags())) { | |||||
| log("\tRemoving abstract method " + methodSig); | log("\tRemoving abstract method " + methodSig); | ||||
| classNode.removeChild(methodNode); | classNode.removeChild(methodNode); | ||||
| } | } | ||||
| @@ -441,7 +445,8 @@ public class XMLReport { | |||||
| int pkg_total_methods = 0; | int pkg_total_methods = 0; | ||||
| int pkg_hit_lines = 0; | int pkg_hit_lines = 0; | ||||
| int pkg_total_lines = 0; | int pkg_total_lines = 0; | ||||
| //System.out.println("Processing package '" + pkgname + "': " + classes.length + " classes"); | |||||
| //System.out.println("Processing package '" + pkgname + "': " | |||||
| // + classes.length + " classes"); | |||||
| for (int j = 0; j < classes.length; j++) { | for (int j = 0; j < classes.length; j++) { | ||||
| Element clazz = classes[j]; | Element clazz = classes[j]; | ||||
| String classname = clazz.getAttribute("name"); | String classname = clazz.getAttribute("name"); | ||||
| @@ -457,7 +462,8 @@ public class XMLReport { | |||||
| pkg_hit_lines += Integer.parseInt(covdata.getAttribute("hit_lines")); | pkg_hit_lines += Integer.parseInt(covdata.getAttribute("hit_lines")); | ||||
| pkg_total_lines += Integer.parseInt(covdata.getAttribute("total_lines")); | pkg_total_lines += Integer.parseInt(covdata.getAttribute("total_lines")); | ||||
| } catch (NumberFormatException e) { | } catch (NumberFormatException e) { | ||||
| log("Error parsing '" + classname + "' (" + j + "/" + classes.length + ") in package '" + pkgname + "'"); | |||||
| log("Error parsing '" + classname + "' (" + j + "/" | |||||
| + classes.length + ") in package '" + pkgname + "'"); | |||||
| throw e; | throw e; | ||||
| } | } | ||||
| } | } | ||||
| @@ -493,7 +499,8 @@ public class XMLReport { | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| throw new NoSuchElementException("Could not find 'cov.data' element in parent '" + parent.getNodeName() + "'"); | |||||
| throw new NoSuchElementException("Could not find 'cov.data' " | |||||
| + "element in parent '" + parent.getNodeName() + "'"); | |||||
| } | } | ||||
| protected Hashtable getMethods(Element clazz) { | protected Hashtable getMethods(Element clazz) { | ||||
| @@ -340,7 +340,8 @@ final class DirectoryLoader implements ClassPathLoader.FileLoader { | |||||
| * @param recurse tells whether or not the listing is recursive. | * @param recurse tells whether or not the listing is recursive. | ||||
| * @return the list instance that was passed as the <tt>list</tt> argument. | * @return the list instance that was passed as the <tt>list</tt> argument. | ||||
| */ | */ | ||||
| private static Vector listFilesTo(Vector list, File directory, FilenameFilter filter, boolean recurse) { | |||||
| private static Vector listFilesTo(Vector list, File directory, | |||||
| FilenameFilter filter, boolean recurse) { | |||||
| String[] files = directory.list(filter); | String[] files = directory.list(filter); | ||||
| for (int i = 0; i < files.length; i++) { | for (int i = 0; i < files.length; i++) { | ||||
| list.addElement(new File(directory, files[i])); | list.addElement(new File(directory, files[i])); | ||||
| @@ -201,7 +201,8 @@ public class Utils { | |||||
| // think about it. | // think about it. | ||||
| //ooooops should never happen | //ooooops should never happen | ||||
| //throw new IllegalArgumentException("Invalid descriptor symbol: '" + i + "' in '" + descriptor + "'"); | |||||
| //throw new IllegalArgumentException("Invalid descriptor | |||||
| // symbol: '" + i + "' in '" + descriptor + "'"); | |||||
| } | } | ||||
| sb.append(dim.toString()); | sb.append(dim.toString()); | ||||
| return ++i; | return ++i; | ||||