diff options
Diffstat (limited to 'src/main/org/apache/tools/ant/taskdefs/optional/ejb/IPlanetDeploymentTool.java')
-rw-r--r-- | src/main/org/apache/tools/ant/taskdefs/optional/ejb/IPlanetDeploymentTool.java | 43 |
1 files changed, 20 insertions, 23 deletions
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/ejb/IPlanetDeploymentTool.java b/src/main/org/apache/tools/ant/taskdefs/optional/ejb/IPlanetDeploymentTool.java index cbc8526aa..181720f78 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/ejb/IPlanetDeploymentTool.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/ejb/IPlanetDeploymentTool.java @@ -21,12 +21,12 @@ package org.apache.tools.ant.taskdefs.optional.ejb; import java.io.File; import java.io.IOException; import java.util.Hashtable; -import java.util.Iterator; import javax.xml.parsers.SAXParser; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.Project; +import org.apache.tools.ant.taskdefs.optional.ejb.EjbJar.DTDLocation; import org.xml.sax.SAXException; /** @@ -107,7 +107,7 @@ public class IPlanetDeploymentTool extends GenericDeploymentTool { * we may determine the name of the EJB JAR file using this display-name, * but this has not be implemented yet. */ - private String displayName; + private String displayName; /* * Regardless of the name of the iAS-specific EJB descriptor file, it will @@ -202,25 +202,26 @@ public class IPlanetDeploymentTool extends GenericDeploymentTool { int startOfName = descriptorFileName.lastIndexOf(File.separatorChar) + 1; String stdXml = descriptorFileName.substring(startOfName); if (stdXml.equals(EJB_DD) && (getConfig().baseJarName == null)) { - String msg = "No name specified for the completed JAR file. The EJB" - + " descriptor should be prepended with the JAR " - + "name or it should be specified using the " - + "attribute \"basejarname\" in the \"ejbjar\" task."; - throw new BuildException(msg, getLocation()); + throw new BuildException( + "No name specified for the completed JAR file. The EJB" + + " descriptor should be prepended with the JAR " + + "name or it should be specified using the " + + "attribute \"basejarname\" in the \"ejbjar\" task.", + getLocation()); } File iasDescriptor = new File(getConfig().descriptorDir, getIasDescriptorName()); if ((!iasDescriptor.exists()) || (!iasDescriptor.isFile())) { - String msg = "The iAS-specific EJB descriptor (" - + iasDescriptor + ") was not found."; - throw new BuildException(msg, getLocation()); + throw new BuildException("The iAS-specific EJB descriptor (" + + iasDescriptor + ") was not found.", getLocation()); } if ((iashome != null) && (!iashome.isDirectory())) { - String msg = "If \"iashome\" is specified, it must be a valid " - + "directory (it was set to " + iashome + ")."; - throw new BuildException(msg, getLocation()); + throw new BuildException( + "If \"iashome\" is specified, it must be a valid directory (it was set to " + + iashome + ").", + getLocation()); } } @@ -240,10 +241,10 @@ public class IPlanetDeploymentTool extends GenericDeploymentTool { * exception */ @Override - protected Hashtable parseEjbFiles(String descriptorFileName, + protected Hashtable<String, File> parseEjbFiles(String descriptorFileName, SAXParser saxParser) throws IOException, SAXException { - Hashtable files; + Hashtable<String, File> files; /* Build and populate an instance of the ejbc utility */ IPlanetEjbc ejbc = new IPlanetEjbc( @@ -260,12 +261,9 @@ public class IPlanetDeploymentTool extends GenericDeploymentTool { ejbc.setIasHomeDir(iashome); } if (getConfig().dtdLocations != null) { - for (Iterator i = getConfig().dtdLocations.iterator(); - i.hasNext();) { - EjbJar.DTDLocation dtdLocation = - (EjbJar.DTDLocation) i.next(); + for (DTDLocation dtdLocation : getConfig().dtdLocations) { ejbc.registerDTD(dtdLocation.getPublicId(), - dtdLocation.getLocation()); + dtdLocation.getLocation()); } } @@ -292,7 +290,7 @@ public class IPlanetDeploymentTool extends GenericDeploymentTool { int endOfCmp = cmpDescriptors[i].lastIndexOf('/'); String cmpDescriptor = cmpDescriptors[i].substring(endOfCmp + 1); - File cmpFile = new File(baseDir, relativePath + cmpDescriptor); + File cmpFile = new File(baseDir, relativePath + cmpDescriptor); if (!cmpFile.exists()) { throw new BuildException("The CMP descriptor file (" + cmpFile + ") could not be found.", getLocation()); @@ -300,7 +298,6 @@ public class IPlanetDeploymentTool extends GenericDeploymentTool { files.put(cmpDescriptors[i], cmpFile); } } - return files; } @@ -313,7 +310,7 @@ public class IPlanetDeploymentTool extends GenericDeploymentTool { * @param ddPrefix not used */ @Override - protected void addVendorFiles(Hashtable ejbFiles, String ddPrefix) { + protected void addVendorFiles(Hashtable<String, File> ejbFiles, String ddPrefix) { ejbFiles.put(META_DIR + IAS_DD, new File(getConfig().descriptorDir, getIasDescriptorName())); } |