ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From co...@apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant AntClassLoader.java DemuxOutputStream.java DirectoryScanner.java FileScanner.java IntrospectionHelper.java Location.java Main.java NoBannerLogger.java PathTokenizer.java Project.java ProjectComponent.java ProjectHelper.java RuntimeConfigurable.java Target.java Task.java TaskAdapter.java UnknownElement.java XmlLogger.java
Date Tue, 09 Apr 2002 15:27:08 GMT
conor       02/04/09 08:27:08

  Modified:    src/main/org/apache/tools/ant AntClassLoader.java
                        DemuxOutputStream.java DirectoryScanner.java
                        FileScanner.java IntrospectionHelper.java
                        Location.java Main.java NoBannerLogger.java
                        PathTokenizer.java Project.java
                        ProjectComponent.java ProjectHelper.java
                        RuntimeConfigurable.java Target.java Task.java
                        TaskAdapter.java UnknownElement.java XmlLogger.java
  Log:
  Coding standard conformance
  
  Revision  Changes    Path
  1.51      +18 -22    jakarta-ant/src/main/org/apache/tools/ant/AntClassLoader.java
  
  Index: AntClassLoader.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/AntClassLoader.java,v
  retrieving revision 1.50
  retrieving revision 1.51
  diff -u -w -u -r1.50 -r1.51
  --- AntClassLoader.java	27 Mar 2002 09:48:20 -0000	1.50
  +++ AntClassLoader.java	9 Apr 2002 15:27:07 -0000	1.51
  @@ -1000,11 +1000,9 @@
                       throw (ClassFormatError)t;
                   } else if (t instanceof NoClassDefFoundError) {
                       throw (NoClassDefFoundError)t;
  -                }
  -                else if (t instanceof SecurityException) {
  +                } else if (t instanceof SecurityException) {
                       throw (SecurityException)t;
  -                }
  -                else {
  +                } else {
                       throw new IOException(t.toString());
                   }
               } catch (Exception e) {
  @@ -1059,11 +1057,9 @@
                       if (stream != null) {
                           return getClassFromStream(stream, name);
                       }
  -                }
  -                catch (SecurityException se) {
  +                } catch (SecurityException se) {
                       throw se;
  -                }
  -                catch (IOException ioe) {
  +                } catch (IOException ioe) {
                       // ioe.printStackTrace();
                       log("Exception reading component " + pathComponent ,
                           Project.MSG_VERBOSE);
  
  
  
  1.9       +6 -6      jakarta-ant/src/main/org/apache/tools/ant/DemuxOutputStream.java
  
  Index: DemuxOutputStream.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/DemuxOutputStream.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -w -u -r1.8 -r1.9
  --- DemuxOutputStream.java	26 Feb 2002 15:25:15 -0000	1.8
  +++ DemuxOutputStream.java	9 Apr 2002 15:27:07 -0000	1.9
  @@ -88,7 +88,8 @@
       }
       
       /** Maximum buffer size. */
  -    private final static int MAX_SIZE = 1024;
  +    private static final int MAX_SIZE = 1024;
  +    
       /** Mapping from thread to buffer (Thread to BufferInfo). */
       private Hashtable buffers = new Hashtable();
   
  @@ -142,8 +143,7 @@
           BufferInfo bufferInfo = (BufferInfo)buffers.get(current);
           try {
               bufferInfo.buffer.close();
  -        }
  -        catch (IOException e) {
  +        } catch (IOException e) {
               // Shouldn't happen
           }
           bufferInfo.buffer = new ByteArrayOutputStream();
  
  
  
  1.24      +64 -59    jakarta-ant/src/main/org/apache/tools/ant/DirectoryScanner.java
  
  Index: DirectoryScanner.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/DirectoryScanner.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -w -u -r1.23 -r1.24
  --- DirectoryScanner.java	27 Mar 2002 09:48:20 -0000	1.23
  +++ DirectoryScanner.java	9 Apr 2002 15:27:07 -0000	1.24
  @@ -147,7 +147,7 @@
        *
        * @see #addDefaultExcludes()
        */
  -    protected final static String[] DEFAULTEXCLUDES = {
  +    protected static final String[] DEFAULTEXCLUDES = {
           "**/*~",
           "**/#*#",
           "**/.#*",
  @@ -322,7 +322,8 @@
        * @return <code>true</code> if the pattern matches against the string,

        *         or <code>false</code> otherwise.
        */
  -    protected static boolean matchPath(String pattern, String str, boolean isCaseSensitive)
{
  +    protected static boolean matchPath(String pattern, String str, 
  +                                       boolean isCaseSensitive) {
           // When str starts with a File.separator, pattern has to start with a
           // File.separator.
           // When pattern starts with a File.separator, str has to start with a
  @@ -410,8 +411,10 @@
   strLoop:
               for (int i = 0; i <= strLength - patLength; i++) {
                   for (int j = 0; j < patLength; j++) {
  -                    String subPat = (String)patDirs.elementAt(patIdxStart+j+1);
  -                    String subStr = (String)strDirs.elementAt(strIdxStart+i+j);
  +                    String subPat 
  +                        = (String) patDirs.elementAt(patIdxStart + j + 1);
  +                    String subStr 
  +                        = (String) strDirs.elementAt(strIdxStart + i + j);
                       if (!match(subPat,subStr, isCaseSensitive)) {
                           continue strLoop;
                       }
  @@ -473,7 +476,8 @@
        * @return <code>true</code> if the string matches against the pattern,

        *         or <code>false</code> otherwise.
        */
  -    protected static boolean match(String pattern, String str, boolean isCaseSensitive)
{
  +    protected static boolean match(String pattern, String str, 
  +                                   boolean isCaseSensitive) {
           char[] patArr = pattern.toCharArray();
           char[] strArr = str.toCharArray();
           int patIdxStart = 0;
  @@ -589,7 +593,8 @@
                   for (int j = 0; j < patLength; j++) {
                       ch = patArr[patIdxStart+j+1];
                       if (ch != '?') {
  -                        if (isCaseSensitive && ch != strArr[strIdxStart+i+j]) {
  +                        if (isCaseSensitive 
  +                             && ch != strArr[strIdxStart + i + j]) {
                               continue strLoop;
                           }
                           if (!isCaseSensitive && Character.toUpperCase(ch) !=
  
  
  
  1.10      +1 -1      jakarta-ant/src/main/org/apache/tools/ant/FileScanner.java
  
  Index: FileScanner.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/FileScanner.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -w -u -r1.9 -r1.10
  --- FileScanner.java	18 Feb 2002 18:27:58 -0000	1.9
  +++ FileScanner.java	9 Apr 2002 15:27:07 -0000	1.10
  @@ -140,7 +140,7 @@
        *            incorrectly (i.e. if it is <code>null</code>, doesn't exist,
        *            or isn't a directory).
        */
  -    void scan();
  +    void scan() throws IllegalStateException;
       
       /**
        * Sets the base directory to be scanned. This is the directory which is
  
  
  
  1.39      +17 -17    jakarta-ant/src/main/org/apache/tools/ant/IntrospectionHelper.java
  
  Index: IntrospectionHelper.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/IntrospectionHelper.java,v
  retrieving revision 1.38
  retrieving revision 1.39
  diff -u -w -u -r1.38 -r1.39
  --- IntrospectionHelper.java	27 Mar 2002 09:48:20 -0000	1.38
  +++ IntrospectionHelper.java	9 Apr 2002 15:27:07 -0000	1.39
  @@ -392,7 +392,8 @@
       public void setAttribute(Project p, Object element, String attributeName,
                                String value)
           throws BuildException {
  -        AttributeSetter as = (AttributeSetter) attributeSetters.get(attributeName);
  +        AttributeSetter as 
  +            = (AttributeSetter) attributeSetters.get(attributeName);
           if (as == null) {
               String msg = p.getElementName(element) +
               //String msg = "Class " + element.getClass().getName() +
  @@ -437,8 +438,7 @@
               if ( text.trim().length() == 0 ) {
                   // Only whitespace - ignore
                   return;
  -            }
  -            else {
  +            } else {
                   // Not whitespace - fail
                   String msg = project.getElementName(element) +
                       " doesn't support nested text data.";
  @@ -480,8 +480,8 @@
        *                           element instance, or if the creating method
        *                           fails.
        */
  -    public Object createElement(Project project, Object parent, String elementName)
  -        throws BuildException {
  +    public Object createElement(Project project, Object parent, 
  +        String elementName) throws BuildException {
           NestedCreator nc = (NestedCreator) nestedCreators.get(elementName);
           if (nc == null) {
               String msg = project.getElementName(parent) +
  @@ -529,8 +529,8 @@
        * 
        * @exception BuildException if the storage method fails.
        */
  -    public void storeElement(Project project, Object parent, Object child, String elementName)
  -        throws BuildException {
  +    public void storeElement(Project project, Object parent, Object child, 
  +        String elementName) throws BuildException {
           if (elementName == null) {
               return;
           }
  @@ -663,7 +663,8 @@
        */
       private AttributeSetter createAttributeSetter(final Method m,
                                                     Class arg) {
  -        // use wrappers for primitive classes, e.g. int and Integer are treated identically
  +        // use wrappers for primitive classes, e.g. int and 
  +        // Integer are treated identically
           final Class reflectedArg = PRIMITIVE_TYPE_MAP.containsKey (arg) 
               ? (Class) PRIMITIVE_TYPE_MAP.get(arg) : arg;
   
  @@ -685,8 +686,8 @@
                       }
   
                   };
  -        // boolean and Boolean get special treatment because we have a nice method
  -        // in Project
  +        // boolean and Boolean get special treatment because we 
  +        // have a nice method in Project
           } else if (java.lang.Boolean.class.equals(reflectedArg)) {
               return new AttributeSetter() {
                       public void set(Project p, Object parent, String value)
  @@ -792,8 +793,7 @@
        * 
        * @return a description of the element type
        */
  -    protected String getElementName(Project project, Object element)
  -    {
  +    protected String getElementName(Project project, Object element) {
           return project.getElementName(element);
       }
   
  
  
  
  1.7       +1 -1      jakarta-ant/src/main/org/apache/tools/ant/Location.java
  
  Index: Location.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/Location.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -w -u -r1.6 -r1.7
  --- Location.java	24 Feb 2002 08:55:28 -0000	1.6
  +++ Location.java	9 Apr 2002 15:27:07 -0000	1.7
  @@ -69,7 +69,7 @@
       private int columnNumber;
   
       /** Location to use when one is needed but no information is available */
  -    public final static Location UNKNOWN_LOCATION = new Location();
  +    public static final Location UNKNOWN_LOCATION = new Location();
   
       /**
        * Creates an "unknown" location.
  
  
  
  1.61      +25 -34    jakarta-ant/src/main/org/apache/tools/ant/Main.java
  
  Index: Main.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/Main.java,v
  retrieving revision 1.60
  retrieving revision 1.61
  diff -u -w -u -r1.60 -r1.61
  --- Main.java	8 Apr 2002 17:45:41 -0000	1.60
  +++ Main.java	9 Apr 2002 15:27:07 -0000	1.61
  @@ -79,7 +79,7 @@
   public class Main {
   
       /** The default build file name. */
  -    public final static String DEFAULT_BUILD_FILENAME = "build.xml";
  +    public static final String DEFAULT_BUILD_FILENAME = "build.xml";
   
       /** Our current message output status. Follows Project.MSG_XXX. */
       private int msgOutputLevel = Project.MSG_INFO;
  @@ -334,8 +334,7 @@
                   }
                   try {
                       loggerClassname = args[++i];
  -                }
  -                catch (ArrayIndexOutOfBoundsException aioobe) {
  +                } catch (ArrayIndexOutOfBoundsException aioobe) {
                       System.out.println("You must specify a classname when " +
                                          "using the -logger argument");
                       return;
  @@ -410,8 +409,7 @@
               try {
                   fis = new FileInputStream(filename);
                   props.load(fis);
  -            }
  -            catch (IOException e) {
  +            } catch (IOException e) {
                   System.out.println("Could not load property file "
                      + filename + ": " + e.getMessage());
               } finally {
  @@ -595,8 +593,7 @@
                   }
   
                   project.executeTargets(targets);
  -            }
  -            finally {
  +            } finally {
                   // put back the original security manager
                   //The following will never eval to true. (PD)
                   if (oldsm != null){
  @@ -606,16 +603,13 @@
                   System.setOut(out);
                   System.setErr(err);
               }
  -        }
  -        catch (RuntimeException exc) {
  +        } catch (RuntimeException exc) {
               error = exc;
               throw exc;
  -        }
  -        catch (Error err) {
  +        } catch (Error err) {
               error = err;
               throw err;
  -        }
  -        finally {
  +        } finally {
               if (!projectHelp) {
                   project.fireBuildFinished(error);
               }
  @@ -640,8 +634,7 @@
                   BuildListener listener =
                       (BuildListener) Class.forName(className).newInstance();
                   project.addBuildListener(listener);
  -            }
  -            catch (Throwable exc) {
  +            } catch (Throwable exc) {
                   throw new BuildException("Unable to instantiate listener "
                       + className, exc);
               }
  @@ -663,20 +656,18 @@
           if (loggerClassname != null) {
               try {
                   logger = (BuildLogger)(Class.forName(loggerClassname).newInstance());
  -            }
  -            catch (ClassCastException e) {
  +            } catch (ClassCastException e) {
                   System.err.println("The specified logger class "
                       + loggerClassname
                       + " does not implement the BuildLogger interface");
                   throw new RuntimeException();
  -            }
  -            catch (Exception e) {
  +            } catch (Exception e) {
                   System.err.println("Unable to instantiate specified logger "
  -                    + "class " + loggerClassname + " : " + e.getClass().getName());
  +                    + "class " + loggerClassname + " : " 
  +                    + e.getClass().getName());
                   throw new RuntimeException();
               }
  -        }
  -        else {
  +        } else {
               logger = new DefaultLogger();
           }
   
  
  
  
  1.8       +6 -6      jakarta-ant/src/main/org/apache/tools/ant/NoBannerLogger.java
  
  Index: NoBannerLogger.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/NoBannerLogger.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -w -u -r1.7 -r1.8
  --- NoBannerLogger.java	27 Mar 2002 09:48:20 -0000	1.7
  +++ NoBannerLogger.java	9 Apr 2002 15:27:07 -0000	1.8
  @@ -107,9 +107,9 @@
        */
       public void messageLogged(BuildEvent event) {
   
  -        if( event.getPriority() > msgOutputLevel ||
  -                null == event.getMessage() ||
  -            "".equals( event.getMessage().trim() ) ) {
  +        if (event.getPriority() > msgOutputLevel 
  +            || null == event.getMessage() 
  +            || "".equals(event.getMessage().trim())) {
               return;
           }
   
  
  
  
  1.12      +6 -12     jakarta-ant/src/main/org/apache/tools/ant/PathTokenizer.java
  
  Index: PathTokenizer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/PathTokenizer.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -w -u -r1.11 -r1.12
  --- PathTokenizer.java	18 Mar 2002 02:44:29 -0000	1.11
  +++ PathTokenizer.java	9 Apr 2002 15:27:07 -0000	1.12
  @@ -104,8 +104,7 @@
               // For NetWare, use the boolean=true mode, so we can use delimiter 
               // information to make a better decision later.
               tokenizer = new StringTokenizer(path, ":;", true);
  -        }
  -        else {
  +        } else {
               // on Windows and Unix, we can ignore delimiters and still have
               // enough information to tokenize correctly.
               tokenizer = new StringTokenizer(path, ":;", false);
  @@ -142,8 +141,7 @@
           if (lookahead != null) {
               token = lookahead;
               lookahead = null;
  -        }
  -        else {
  +        } else {
               token = tokenizer.nextToken().trim();
           }            
               
  @@ -159,14 +157,12 @@
                       // starts with a slash or backslash, so we know this is a 
                       // drive spec
                       token += ":" + nextToken;
  -                }
  -                else {
  +                } else {
                       // store the token just read for next time
                       lookahead = nextToken;
                   }
               }
  -        }
  -        else {
  +        } else {
               // we are on NetWare, tokenizing is handled a little differently,
               // due to the fact that NetWare has multiple-character volume names.
               if (token.equals(File.pathSeparator)) {
  @@ -186,15 +182,13 @@
                               String oneMore = tokenizer.nextToken().trim();
                               if (!oneMore.equals(File.pathSeparator)) {
                                   token += ":" + oneMore;
  -                            }
  -                            else {
  +                            } else {
                                   token += ":";
                               }
                           }
                           // implicit else: ignore the ':' since we have either a
                           // UNIX or a relative path
  -                    }
  -                    else {
  +                    } else {
                           // store the token just read for next time
                           lookahead = nextToken;
                       }
  
  
  
  1.104     +35 -39    jakarta-ant/src/main/org/apache/tools/ant/Project.java
  
  Index: Project.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/Project.java,v
  retrieving revision 1.103
  retrieving revision 1.104
  diff -u -w -u -r1.103 -r1.104
  --- Project.java	7 Apr 2002 14:35:22 -0000	1.103
  +++ Project.java	9 Apr 2002 15:27:07 -0000	1.104
  @@ -82,48 +82,48 @@
    *
    * @author duncan@x180.com
    *
  - * @version $Revision: 1.103 $
  + * @version $Revision: 1.104 $
    */
   
   public class Project {
   
       /** Message priority of "error". */
  -    public final static int MSG_ERR = 0;
  +    public static final int MSG_ERR = 0;
       /** Message priority of "warning". */
  -    public final static int MSG_WARN = 1;
  +    public static final int MSG_WARN = 1;
       /** Message priority of "information". */
  -    public final static int MSG_INFO = 2;
  +    public static final int MSG_INFO = 2;
       /** Message priority of "verbose". */
  -    public final static int MSG_VERBOSE = 3;
  +    public static final int MSG_VERBOSE = 3;
       /** Message priority of "debug". */
  -    public final static int MSG_DEBUG = 4;
  +    public static final int MSG_DEBUG = 4;
   
       /** 
        * Constant for the "visiting" state, used when
        * traversing a DFS of target dependencies.
        */
  -    private final static String VISITING = "VISITING";
  +    private static final String VISITING = "VISITING";
       /** 
        * Constant for the "visited" state, used when
        * traversing a DFS of target dependencies.
        */
  -    private final static String VISITED = "VISITED";
  +    private static final String VISITED = "VISITED";
   
       /** Version constant for Java 1.0 */
  -    public final static String JAVA_1_0 = JavaEnvUtils.JAVA_1_0;
  +    public static final String JAVA_1_0 = JavaEnvUtils.JAVA_1_0;
       /** Version constant for Java 1.1 */
  -    public final static String JAVA_1_1 = JavaEnvUtils.JAVA_1_1;
  +    public static final String JAVA_1_1 = JavaEnvUtils.JAVA_1_1;
       /** Version constant for Java 1.2 */
  -    public final static String JAVA_1_2 = JavaEnvUtils.JAVA_1_2;
  +    public static final String JAVA_1_2 = JavaEnvUtils.JAVA_1_2;
       /** Version constant for Java 1.3 */
  -    public final static String JAVA_1_3 = JavaEnvUtils.JAVA_1_3;
  +    public static final String JAVA_1_3 = JavaEnvUtils.JAVA_1_3;
       /** Version constant for Java 1.4 */
  -    public final static String JAVA_1_4 = JavaEnvUtils.JAVA_1_4;
  +    public static final String JAVA_1_4 = JavaEnvUtils.JAVA_1_4;
   
       /** Default filter start token. */
  -    public final static String TOKEN_START = FilterSet.DEFAULT_TOKEN_START;
  +    public static final String TOKEN_START = FilterSet.DEFAULT_TOKEN_START;
       /** Default filter end token. */
  -    public final static String TOKEN_END = FilterSet.DEFAULT_TOKEN_END;
  +    public static final String TOKEN_END = FilterSet.DEFAULT_TOKEN_END;
   
       /** Name of this project. */
       private String name;
  @@ -1132,12 +1132,10 @@
           Task task = (Task)threadTasks.get(Thread.currentThread());
           if (task == null) {
               fireMessageLogged(this, line, isError ? MSG_ERR : MSG_INFO);
  -        }
  -        else {
  +        } else {
               if (isError) {
                   task.handleErrorOutput(line);
  -            }
  -            else {
  +            } else {
                   task.handleOutput(line);
               }
           }
  @@ -1510,12 +1508,11 @@
           tsort(root, targets, state, visiting, ret);
           log("Build sequence for target `" + root + "' is " + ret, MSG_VERBOSE);
           for (Enumeration en = targets.keys(); en.hasMoreElements();) {
  -            String curTarget = (String)(en.nextElement());
  +            String curTarget = (String) en.nextElement();
               String st = (String) state.get(curTarget);
               if (st == null) {
                   tsort(curTarget, targets, state, visiting, ret);
  -            }
  -            else if (st == VISITING) {
  +            } else if (st == VISITING) {
                   throw new RuntimeException("Unexpected node in visiting state: "
                       + curTarget);
               }
  @@ -1571,7 +1568,7 @@
           state.put(root, VISITING);
           visiting.push(root);
   
  -        Target target = (Target)(targets.get(root));
  +        Target target = (Target) targets.get(root);
   
           // Make sure we exist
           if (target == null) {
  @@ -1595,8 +1592,7 @@
               if (m == null) {
                   // Not been visited
                   tsort(cur, targets, state, visiting, ret);
  -            }
  -            else if (m == VISITING) {
  +            } else if (m == VISITING) {
                   // Currently visiting this node, so have a cycle
                   throw makeCircularException(cur, visiting);
               }
  
  
  
  1.4       +2 -1      jakarta-ant/src/main/org/apache/tools/ant/ProjectComponent.java
  
  Index: ProjectComponent.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/ProjectComponent.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -w -u -r1.3 -r1.4
  --- ProjectComponent.java	18 Mar 2002 02:44:29 -0000	1.3
  +++ ProjectComponent.java	9 Apr 2002 15:27:07 -0000	1.4
  @@ -105,7 +105,8 @@
        * Logs a mesage with the given priority.
        *
        * @param msg The message to be logged. Should not be <code>null</code>.
  -     * @param msgLevel the message priority at which this message is to be logged.
  +     * @param msgLevel the message priority at which this message is 
  +     *                 to be logged.
        */
       public void log(String msg, int msgLevel) {
           if (project != null) {
  
  
  
  1.82      +12 -12    jakarta-ant/src/main/org/apache/tools/ant/ProjectHelper.java
  
  Index: ProjectHelper.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/ProjectHelper.java,v
  retrieving revision 1.81
  retrieving revision 1.82
  diff -u -w -u -r1.81 -r1.82
  --- ProjectHelper.java	27 Mar 2002 09:48:20 -0000	1.81
  +++ ProjectHelper.java	9 Apr 2002 15:27:07 -0000	1.82
  @@ -368,7 +368,8 @@
        */
       public static void storeChild(Project project, Object parent, 
            Object child, String tag) {
  -        IntrospectionHelper ih = IntrospectionHelper.getHelper(parent.getClass());
  +        IntrospectionHelper ih 
  +            = IntrospectionHelper.getHelper(parent.getClass());
           ih.storeElement(project, parent, child, tag);
       }
   
  @@ -479,9 +480,8 @@
               if( pos == (value.length() - 1)) {
                   fragments.addElement("$");
                   prev = pos + 1;
  -            }
  +            } else if (value.charAt(pos + 1) != '{') {
               //peek ahead to see if the next char is a property or not
  -            else if (value.charAt(pos + 1) != '{' ) {
                   //not a property: insert the char as a literal
                   fragments.addElement(value.substring(pos + 1, pos + 2));
                   prev = pos + 2;
  
  
  
  1.14      +4 -2      jakarta-ant/src/main/org/apache/tools/ant/RuntimeConfigurable.java
  
  Index: RuntimeConfigurable.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/RuntimeConfigurable.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -w -u -r1.13 -r1.14
  --- RuntimeConfigurable.java	1 Mar 2002 16:29:15 -0000	1.13
  +++ RuntimeConfigurable.java	9 Apr 2002 15:27:07 -0000	1.14
  @@ -208,7 +208,8 @@
           }
           Enumeration enum = children.elements();
           while (enum.hasMoreElements()) {
  -            RuntimeConfigurable child = (RuntimeConfigurable) enum.nextElement();
  +            RuntimeConfigurable child 
  +                = (RuntimeConfigurable) enum.nextElement();
               if (child.wrappedObject instanceof Task) {
                   Task childTask = (Task) child.wrappedObject;
                   childTask.setRuntimeConfigurableWrapper(child);
  @@ -216,7 +217,8 @@
               } else {
                   child.maybeConfigure(p);
               }
  -            ProjectHelper.storeChild(p, wrappedObject, child.wrappedObject, child.getElementTag().toLowerCase(Locale.US));
  +            ProjectHelper.storeChild(p, wrappedObject, child.wrappedObject, 
  +                child.getElementTag().toLowerCase(Locale.US));
           }
   
           if (id != null) {
  
  
  
  1.33      +11 -12    jakarta-ant/src/main/org/apache/tools/ant/Target.java
  
  Index: Target.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/Target.java,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -w -u -r1.32 -r1.33
  --- Target.java	1 Mar 2002 15:54:53 -0000	1.32
  +++ Target.java	9 Apr 2002 15:27:07 -0000	1.33
  @@ -120,9 +120,9 @@
   
                   // Make sure the dependency is not empty string
                   if (token.equals("") || token.equals(",")) {
  -                    throw new BuildException( "Syntax Error: Depend attribute " +
  -                                              "for target \"" + getName() + 
  -                                              "\" has an empty string for dependency."
);
  +                    throw new BuildException("Syntax Error: Depend "
  +                        + "attribute for target \"" + getName() 
  +                        + "\" has an empty string for dependency.");
                   }
   
                   addDependency(token);
  @@ -132,9 +132,9 @@
                   if (tok.hasMoreTokens()) {
                       token = tok.nextToken();
                       if (!tok.hasMoreTokens() || !token.equals(",")) {
  -                        throw new BuildException( "Syntax Error: Depend attribute " +
  -                                                  "for target \"" + getName() + 
  -                                                  "\" ends with a , character" );
  +                        throw new BuildException("Syntax Error: Depend " 
  +                            + "attribute for target \"" + getName() 
  +                            + "\" ends with a , character");
                       }
                   }
               }
  @@ -313,11 +313,11 @@
                   }
               }
           } else if (!testIfCondition()) {
  -            project.log(this, "Skipped because property '" + this.ifCondition + "' not
set.", 
  -                        Project.MSG_VERBOSE);
  +            project.log(this, "Skipped because property '" + this.ifCondition 
  +                + "' not set.", Project.MSG_VERBOSE);
           } else {
  -            project.log(this, "Skipped because property '" + this.unlessCondition + "'
set.",
  -                        Project.MSG_VERBOSE);
  +            project.log(this, "Skipped because property '" 
  +                + this.unlessCondition + "' set.", Project.MSG_VERBOSE);
           }
       }
   
  @@ -333,8 +333,7 @@
               project.fireTargetStarted(this);
               execute();
               project.fireTargetFinished(this, null);
  -        }
  -        catch(RuntimeException exc) {
  +        } catch (RuntimeException exc) {
               project.fireTargetFinished(this, exc);
               throw exc;
           }
  
  
  
  1.27      +2 -3      jakarta-ant/src/main/org/apache/tools/ant/Task.java
  
  Index: Task.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/Task.java,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -w -u -r1.26 -r1.27
  --- Task.java	5 Mar 2002 23:31:36 -0000	1.26
  +++ Task.java	9 Apr 2002 15:27:08 -0000	1.27
  @@ -312,8 +312,7 @@
                   maybeConfigure();
                   execute();
                   project.fireTaskFinished(this, null);
  -            }
  -            catch (RuntimeException exc) {
  +            } catch (RuntimeException exc) {
                   if (exc instanceof BuildException) {
                       BuildException be = (BuildException) exc;
                       if (be.getLocation() == Location.UNKNOWN_LOCATION) {
  
  
  
  1.16      +25 -20    jakarta-ant/src/main/org/apache/tools/ant/TaskAdapter.java
  
  Index: TaskAdapter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/TaskAdapter.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -w -u -r1.15 -r1.16
  --- TaskAdapter.java	27 Mar 2002 09:48:20 -0000	1.15
  +++ TaskAdapter.java	9 Apr 2002 15:27:08 -0000	1.16
  @@ -66,7 +66,7 @@
   public class TaskAdapter extends Task {
   
       /** Object to act as a proxy for. */
  -    Object proxy;
  +    private Object proxy;
       
       /**
        * Checks whether or not a class is suitable to be adapted by TaskAdapter.
  @@ -86,7 +86,8 @@
        * 
        * @see Project#checkTaskClass(Class)
        */
  -    public static void checkTaskClass(final Class taskClass, final Project project) {
  +    public static void checkTaskClass(final Class taskClass, 
  +                                      final Project project) {
           // don't have to check for interface, since then
           // taskClass would be abstract too.
           try {
  @@ -96,7 +97,9 @@
               // don't have to check for abstract, since then
               // taskClass would be abstract too.
               if(!Void.TYPE.equals(executeM.getReturnType())) {
  -                final String message = "return type of execute() should be void but was
\""+executeM.getReturnType()+"\" in " + taskClass;
  +                final String message = "return type of execute() should be " 
  +                    + "void but was \"" + executeM.getReturnType() + "\" in " 
  +                    + taskClass;
                   project.log(message, Project.MSG_WARN);
               }
           } catch(NoSuchMethodException e) {
  @@ -136,8 +139,10 @@
               Class c=proxy.getClass();
               executeM=c.getMethod( "execute", new Class[0] );
               if( executeM == null ) {
  -                log("No public execute() in " + proxy.getClass(), Project.MSG_ERR);
  -                throw new BuildException("No public execute() in " + proxy.getClass());
  +                log("No public execute() in " + proxy.getClass(), 
  +                    Project.MSG_ERR);
  +                throw new BuildException("No public execute() in " 
  +                    + proxy.getClass());
               }
               executeM.invoke(proxy, null);
               return; 
  
  
  
  1.26      +2 -2      jakarta-ant/src/main/org/apache/tools/ant/UnknownElement.java
  
  Index: UnknownElement.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/UnknownElement.java,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -w -u -r1.25 -r1.26
  
  
  
  1.27      +56 -49    jakarta-ant/src/main/org/apache/tools/ant/XmlLogger.java
  
  Index: XmlLogger.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/XmlLogger.java,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -w -u -r1.26 -r1.27
  --- XmlLogger.java	27 Mar 2002 09:48:20 -0000	1.26
  +++ XmlLogger.java	9 Apr 2002 15:27:08 -0000	1.27
  @@ -87,7 +87,7 @@
   public class XmlLogger implements BuildListener {
   
       /** DocumentBuilder to use when creating the document to start with. */
  -    private final static DocumentBuilder builder = getDocumentBuilder();
  +    private static final DocumentBuilder builder = getDocumentBuilder();
   
       /** 
        * Returns a default DocumentBuilder instance or throws an
  @@ -98,32 +98,31 @@
       private static DocumentBuilder getDocumentBuilder() {
           try {
               return DocumentBuilderFactory.newInstance().newDocumentBuilder();
  -        }
  -        catch(Exception exc) {
  +        } catch (Exception exc) {
               throw new ExceptionInInitializerError(exc);
           }
       }
   
       /** XML element name for a build. */
  -    private final static String BUILD_TAG = "build";
  +    private static final String BUILD_TAG = "build";
       /** XML element name for a target. */
  -    private final static String TARGET_TAG = "target";
  +    private static final String TARGET_TAG = "target";
       /** XML element name for a task. */
  -    private final static String TASK_TAG = "task";
  +    private static final String TASK_TAG = "task";
       /** XML element name for a message. */
  -    private final static String MESSAGE_TAG = "message";
  +    private static final String MESSAGE_TAG = "message";
       /** XML attribute name for a name. */
  -    private final static String NAME_ATTR = "name";
  +    private static final String NAME_ATTR = "name";
       /** XML attribute name for a time. */
  -    private final static String TIME_ATTR = "time";
  +    private static final String TIME_ATTR = "time";
       /** XML attribute name for a message priority. */
  -    private final static String PRIORITY_ATTR = "priority";
  +    private static final String PRIORITY_ATTR = "priority";
       /** XML attribute name for a file location. */
  -    private final static String LOCATION_ATTR = "location";
  +    private static final String LOCATION_ATTR = "location";
       /** XML attribute name for an error description. */
  -    private final static String ERROR_ATTR = "error";
  +    private static final String ERROR_ATTR = "error";
       /** XML element name for a stack trace. */
  -    private final static String STACKTRACE_TAG = "stacktrace";
  +    private static final String STACKTRACE_TAG = "stacktrace";
   
       /** The complete log document for this build. */
       private Document doc = builder.newDocument();
  @@ -147,9 +146,9 @@
            * Start time in milliseconds 
            * (as returned by <code>System.currentTimeMillis()</code>). 
            */
  -        long startTime;
  +        private long startTime;
           /** Element created at the start time. */ 
  -        Element element;
  +        private Element element;
       }
   
       /**
  @@ -179,10 +178,12 @@
        */
       public void buildFinished(BuildEvent event) {
           long totalTime = System.currentTimeMillis() - buildElement.startTime;
  -        buildElement.element.setAttribute(TIME_ATTR, DefaultLogger.formatTime(totalTime));
  +        buildElement.element.setAttribute(TIME_ATTR, 
  +            DefaultLogger.formatTime(totalTime));
   
           if (event.getException() != null) {
  -            buildElement.element.setAttribute(ERROR_ATTR, event.getException().toString());
  +            buildElement.element.setAttribute(ERROR_ATTR, 
  +                event.getException().toString());
               // print the stacktrace in the build file it is always useful...
               // better have too much info than not enough.
               Throwable t = event.getException();
  @@ -196,7 +197,8 @@
           if (outFilename == null) {
               outFilename = "log.xml";
           }
  -        String xslUri=event.getProject().getProperty("ant.XmlLogger.stylesheet.uri");
  +        String xslUri 
  +            = event.getProject().getProperty("ant.XmlLogger.stylesheet.uri");
           if(xslUri==null) {
               xslUri="log.xsl";
           }
  @@ -208,7 +210,8 @@
               out = new OutputStreamWriter(fos, "UTF8");
               out.write("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n");
               if(xslUri.length()>0) {
  -                out.write("<?xml-stylesheet type=\"text/xsl\" href=\""+xslUri+"\"?>\n\n");
  +                out.write("<?xml-stylesheet type=\"text/xsl\" href=\""
  +                    + xslUri + "\"?>\n\n");
               }
               (new DOMElementWriter()).write(buildElement.element, out, 0, "\t");
               out.flush();
  @@ -266,16 +269,19 @@
           Target target = event.getTarget();
           TimedElement targetElement = (TimedElement)targets.get(target);
           if (targetElement != null) {
  -            long totalTime = System.currentTimeMillis() - targetElement.startTime;
  -            targetElement.element.setAttribute(TIME_ATTR, DefaultLogger.formatTime(totalTime));
  +            long totalTime 
  +                = System.currentTimeMillis() - targetElement.startTime;
  +            targetElement.element.setAttribute(TIME_ATTR, 
  +                DefaultLogger.formatTime(totalTime));
   
               TimedElement parentElement = null;
               Stack threadStack = getStack();
               if (!threadStack.empty()) {
                   TimedElement poppedStack = (TimedElement)threadStack.pop();
                   if (poppedStack != targetElement) {
  -                    throw new RuntimeException("Mismatch - popped element = " + poppedStack.element
+
  -                    " finished target element = " + targetElement.element);
  +                    throw new RuntimeException("Mismatch - popped element = " 
  +                        + poppedStack.element + " finished target element = " 
  +                        + targetElement.element);
                   }
                   if (!threadStack.empty()) {
                       parentElement = (TimedElement)threadStack.peek();
  @@ -283,8 +289,7 @@
               }
               if (parentElement == null) {
                   buildElement.element.appendChild(targetElement.element);
  -            }
  -            else {
  +            } else {
                   parentElement.element.appendChild(targetElement.element);
               }
           }
  @@ -306,7 +311,8 @@
           
           String name = event.getTask().getTaskName();
           taskElement.element.setAttribute(NAME_ATTR, name);
  -        taskElement.element.setAttribute(LOCATION_ATTR, event.getTask().getLocation().toString());
  +        taskElement.element.setAttribute(LOCATION_ATTR, 
  +            event.getTask().getLocation().toString());
           tasks.put(task, taskElement);
           getStack().push(taskElement);
       }
  @@ -323,7 +329,8 @@
           TimedElement taskElement = (TimedElement)tasks.get(task);
           if (taskElement != null) {
               long totalTime = System.currentTimeMillis() - taskElement.startTime;
  -            taskElement.element.setAttribute(TIME_ATTR, DefaultLogger.formatTime(totalTime));
  +            taskElement.element.setAttribute(TIME_ATTR, 
  +                DefaultLogger.formatTime(totalTime));
               Target target = task.getOwningTarget();
               TimedElement targetElement = null;
               if (target != null) {
  @@ -331,16 +338,16 @@
               }
               if (targetElement == null) {
                   buildElement.element.appendChild(taskElement.element);
  -            }
  -            else {
  +            } else {
                   targetElement.element.appendChild(taskElement.element);
               }
               Stack threadStack = getStack();
               if (!threadStack.empty()) {
                   TimedElement poppedStack = (TimedElement)threadStack.pop();
                   if (poppedStack != taskElement) {
  -                    throw new RuntimeException("Mismatch - popped element = " + poppedStack.element
+
  -                    " finished task element = " + taskElement.element);
  +                    throw new RuntimeException("Mismatch - popped element = " 
  +                        + poppedStack.element + " finished task element = " 
  +                        + taskElement.element);
                   }
               }
           }
  @@ -381,7 +388,8 @@
           }
   
           if (parentElement == null) {
  -            Stack threadStack = (Stack)threadStacks.get(Thread.currentThread());
  +            Stack threadStack 
  +                = (Stack) threadStacks.get(Thread.currentThread());
               if (threadStack != null) {
                   if (!threadStack.empty()) {
                       parentElement = (TimedElement)threadStack.peek();
  @@ -391,8 +399,7 @@
   
           if (parentElement != null) {
               parentElement.element.appendChild(messageElement);
  -        }
  -        else {
  +        } else {
               buildElement.element.appendChild(messageElement);
           }
       }
  
  
  

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


Mime
View raw message