You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by st...@apache.org on 2005/08/13 17:15:23 UTC

cvs commit: ant/src/main/org/apache/tools/ant/taskdefs/condition TypeFound.java

stevel      2005/08/13 08:15:23

  Modified:    src/main/org/apache/tools/ant ComponentHelper.java
               src/main/org/apache/tools/ant/taskdefs/condition
                        TypeFound.java
  Log:
  typefound prints diags in -v option
  
  Revision  Changes    Path
  1.58      +1 -1      ant/src/main/org/apache/tools/ant/ComponentHelper.java
  
  Index: ComponentHelper.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/ComponentHelper.java,v
  retrieving revision 1.57
  retrieving revision 1.58
  diff -u -r1.57 -r1.58
  --- ComponentHelper.java	6 Jun 2005 19:45:32 -0000	1.57
  +++ ComponentHelper.java	13 Aug 2005 15:15:23 -0000	1.58
  @@ -789,7 +789,7 @@
       /**
        * Handler called to do decent diagnosis on instantiation failure.
        * @param componentName component name.
  -     * @param type component type.
  +     * @param type component type, used in error messages
        * @return a string containing as much diagnostics info as possible.
        */
       public String diagnoseCreationFailure(String componentName, String type) {
  
  
  
  1.9       +9 -3      ant/src/main/org/apache/tools/ant/taskdefs/condition/TypeFound.java
  
  Index: TypeFound.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/condition/TypeFound.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- TypeFound.java	20 May 2005 16:53:57 -0000	1.8
  +++ TypeFound.java	13 Aug 2005 15:15:23 -0000	1.9
  @@ -22,6 +22,7 @@
   import org.apache.tools.ant.ProjectComponent;
   import org.apache.tools.ant.ProjectHelper;
   import org.apache.tools.ant.AntTypeDefinition;
  +import org.apache.tools.ant.Project;
   
   /**
    * looks for a task or other Ant type that exists. Existence is defined as
  @@ -59,13 +60,18 @@
   
           ComponentHelper helper =
               ComponentHelper.getComponentHelper(getProject());
  -        AntTypeDefinition def = helper.getDefinition(
  -            ProjectHelper.genComponentName(uri, typename));
  +        String componentName = ProjectHelper.genComponentName(uri, typename);
  +        AntTypeDefinition def = helper.getDefinition(componentName);
           if (def == null) {
               return false;
           }
           //now verify that the class has an implementation
  -        return def.getExposedClass(getProject()) != null;
  +        boolean found = def.getExposedClass(getProject()) != null;
  +        if(!found) {
  +            String text= helper.diagnoseCreationFailure(componentName,"type");
  +            log(text, Project.MSG_VERBOSE);
  +        }
  +        return found;
       }
   
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org