Browse Source

Remove unnecessary imports to make bootstrap work.

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@271860 13f79535-47bb-0310-9956-ffa450edef68
master
Magesh Umasankar 23 years ago
parent
commit
8199a62cee
1 changed files with 20 additions and 23 deletions
  1. +20
    -23
      src/main/org/apache/tools/ant/taskdefs/optional/ejb/GenericDeploymentTool.java

+ 20
- 23
src/main/org/apache/tools/ant/taskdefs/optional/ejb/GenericDeploymentTool.java View File

@@ -75,10 +75,6 @@ import javax.xml.parsers.SAXParser;
import org.xml.sax.InputSource; import org.xml.sax.InputSource;
import org.xml.sax.SAXException; import org.xml.sax.SAXException;


import org.apache.tools.ant.util.depend.DependencyAnalyzer;
import org.apache.bcel.classfile.JavaClass;
import org.apache.bcel.classfile.ClassParser;

import org.apache.tools.ant.Task; import org.apache.tools.ant.Task;
import org.apache.tools.ant.BuildException; import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Location; import org.apache.tools.ant.Location;
@@ -87,6 +83,7 @@ import org.apache.tools.ant.DirectoryScanner;
import org.apache.tools.ant.AntClassLoader; import org.apache.tools.ant.AntClassLoader;
import org.apache.tools.ant.types.Path; import org.apache.tools.ant.types.Path;
import org.apache.tools.ant.types.FileSet; import org.apache.tools.ant.types.FileSet;
import org.apache.tools.ant.util.depend.DependencyAnalyzer;




/** /**
@@ -102,16 +99,16 @@ import org.apache.tools.ant.types.FileSet;
public class GenericDeploymentTool implements EJBDeploymentTool { public class GenericDeploymentTool implements EJBDeploymentTool {
/** The standard META-INF directory in jar files */ /** The standard META-INF directory in jar files */
protected static final String META_DIR = "META-INF/"; protected static final String META_DIR = "META-INF/";
/** Name for EJB Deployment descriptor within EJB jars */ /** Name for EJB Deployment descriptor within EJB jars */
protected static final String EJB_DD = "ejb-jar.xml"; protected static final String EJB_DD = "ejb-jar.xml";


public static final String DEFAULT_ANALYZER_CLASS public static final String DEFAULT_ANALYZER_CLASS
= "org.apache.tools.ant.util.depend.bcel.FullAnalyzer"; = "org.apache.tools.ant.util.depend.bcel.FullAnalyzer";
/** /**
* The configuration from the containing task. This config combined
* with the settings of the individual attributes here constitues the
* The configuration from the containing task. This config combined
* with the settings of the individual attributes here constitues the
* complete config for this deployment tool. * complete config for this deployment tool.
*/ */
private EjbJar.Config config; private EjbJar.Config config;
@@ -127,7 +124,7 @@ public class GenericDeploymentTool implements EJBDeploymentTool {
private String genericJarSuffix = "-generic.jar"; private String genericJarSuffix = "-generic.jar";


/** /**
* The task to which this tool belongs. This is used to access services
* The task to which this tool belongs. This is used to access services
* provided by the ant core, such as logging. * provided by the ant core, such as logging.
*/ */
private Task task; private Task task;
@@ -152,7 +149,7 @@ public class GenericDeploymentTool implements EJBDeploymentTool {
* Dependency analyzer used to collect class dependencies * Dependency analyzer used to collect class dependencies
*/ */
private DependencyAnalyzer dependencyAnalyzer; private DependencyAnalyzer dependencyAnalyzer;
public GenericDeploymentTool() { public GenericDeploymentTool() {
String analyzerClassName = DEFAULT_ANALYZER_CLASS; String analyzerClassName = DEFAULT_ANALYZER_CLASS;
try { try {
@@ -164,9 +161,9 @@ public class GenericDeploymentTool implements EJBDeploymentTool {
} }
} }


/** /**
* Setter used to store the value of destination directory prior to
* Setter used to store the value of destination directory prior to
* execute() being called. * execute() being called.
* @param inDir the destination directory. * @param inDir the destination directory.
*/ */
@@ -214,7 +211,7 @@ public class GenericDeploymentTool implements EJBDeploymentTool {
/** /**
* Indicate if this build is using the base jar name. * Indicate if this build is using the base jar name.
* *
* @return true if the name of the generated jar is coming from the
* @return true if the name of the generated jar is coming from the
* basejarname attribute * basejarname attribute
*/ */
protected boolean usingBaseJarName() { protected boolean usingBaseJarName() {
@@ -296,10 +293,10 @@ public class GenericDeploymentTool implements EJBDeploymentTool {
*/ */
public void configure(EjbJar.Config config) { public void configure(EjbJar.Config config) {
this.config = config; this.config = config;
dependencyAnalyzer.addClassPath(new Path(task.getProject(),
dependencyAnalyzer.addClassPath(new Path(task.getProject(),
config.srcDir.getPath())); config.srcDir.getPath()));
dependencyAnalyzer.addClassPath(config.classpath); dependencyAnalyzer.addClassPath(config.classpath);
classpathLoader = null; classpathLoader = null;
} }


@@ -810,30 +807,30 @@ public class GenericDeploymentTool implements EJBDeploymentTool {
throws BuildException { throws BuildException {


dependencyAnalyzer.reset(); dependencyAnalyzer.reset();
Iterator i = checkEntries.keySet().iterator(); Iterator i = checkEntries.keySet().iterator();
while (i.hasNext()) { while (i.hasNext()) {
String entryName = (String)i.next(); String entryName = (String)i.next();
if (entryName.endsWith(".class")) { if (entryName.endsWith(".class")) {
String className = entryName.substring(0,
String className = entryName.substring(0,
entryName.length() - ".class".length()); entryName.length() - ".class".length());
className = className.replace(File.separatorChar, '/'); className = className.replace(File.separatorChar, '/');
className = className.replace('/', '.'); className = className.replace('/', '.');
dependencyAnalyzer.addRootClass(className);
dependencyAnalyzer.addRootClass(className);
} }
} }
Enumeration e = dependencyAnalyzer.getClassDependencies(); Enumeration e = dependencyAnalyzer.getClassDependencies();
while (e.hasMoreElements()) { while (e.hasMoreElements()) {
String classname = (String)e.nextElement(); String classname = (String)e.nextElement();
String location
String location
= classname.replace('.', File.separatorChar) + ".class"; = classname.replace('.', File.separatorChar) + ".class";
File classFile = new File(config.srcDir, location); File classFile = new File(config.srcDir, location);
if (classFile.exists()) { if (classFile.exists()) {
checkEntries.put(location, classFile); checkEntries.put(location, classFile);
log("dependent class: " + classname + " - " + classFile,
log("dependent class: " + classname + " - " + classFile,
Project.MSG_VERBOSE); Project.MSG_VERBOSE);
} }
} }


Loading…
Cancel
Save