mbenson     2005/03/01 09:17:39

  Modified:    src/main/org/apache/tools/ant ComponentHelper.java
  Log:
  Clean up spacing, remove erroneously inserted "not".
  
  Revision  Changes    Path
  1.51      +17 -16    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.50
  retrieving revision 1.51
  diff -u -r1.50 -r1.51
  --- ComponentHelper.java      1 Mar 2005 16:23:41 -0000       1.50
  +++ ComponentHelper.java      1 Mar 2005 17:17:39 -0000       1.51
  @@ -770,29 +770,30 @@
       }
   
       /**
  -     * Handler called to do decent diagnosis on instantiation failure
  -     * @param componentName
  +     * Handler called to do decent diagnosis on instantiation failure.
  +     * @param componentName component name.
  +     * @param type component type.
        * @return a string containing as much diagnostics info as possible.
        */
  -    public String diagnoseCreationFailure(String componentName,String type) {
  -        StringWriter errorText=new StringWriter();
  -        PrintWriter out=new PrintWriter(errorText);
  -        out.println("Problem: failed to create "+ type +" "+componentName);
  +    public String diagnoseCreationFailure(String componentName, String type) 
{
  +        StringWriter errorText = new StringWriter();
  +        PrintWriter out = new PrintWriter(errorText);
  +        out.println("Problem: failed to create " + type + " " + 
componentName);
           //class of problem
  -        boolean lowlevel=false;
  -        boolean jars=false;
  -        boolean definitions=false;
  +        boolean lowlevel = false;
  +        boolean jars = false;
  +        boolean definitions = false;
           boolean antTask;
           //look up the name
           AntTypeDefinition def = getDefinition(componentName);
  -        if(def==null) {
  +        if (def == null) {
               //not a known type
               out.println("Cause: The name is undefined.");
               out.println("Action: Check the spelling.");
               out.println("Action: Check that any custom tasks/types have been 
declared");
               out.println("Action: Check that any <presetdef>/<macrodefs> 
declarations have taken place");
  -            definitions=true;
  -        } else{
  +            definitions = true;
  +        } else {
               //we are defined, so it is an instantiation problem
               final String classname = def.getClassName();
               antTask = classname.startsWith("org.apache.tools.ant.");
  @@ -805,7 +806,7 @@
                       Launcher.ANT_PRIVATELIB);
   
               //start with instantiating the class.
  -            Class clazz= null;
  +            Class clazz = null;
               try {
                   clazz = def.innerGetTypeClass();
               } catch (ClassNotFoundException e) {
  @@ -838,12 +839,12 @@
                   out.println("        in " + libDir );
               }
               //here we successfully loaded the class or failed.
  -            if(clazz!=null) {
  +            if (clazz != null) {
                   //success: proceed with more steps
                   try {
  -                    def.innerCreateAndSet(clazz,project);
  +                    def.innerCreateAndSet(clazz, project);
                       //hey, there is nothing wrong with us
  -                    out.println("The component could not be instantiated.");
  +                    out.println("The component could be instantiated.");
                   } catch (NoSuchMethodException e) {
                       lowlevel = true;
                       out.println("Cause: The class " + classname
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to