ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From umag...@apache.org
Subject cvs commit: jakarta-ant/proposal/sandbox/filterreaders/src/main/org/apache/tools/ant/taskdefs LoadProperties.java
Date Thu, 28 Feb 2002 19:16:36 GMT
umagesh     02/02/28 11:16:36

  Modified:    proposal/sandbox/filterreaders/src/main/org/apache/tools/ant/taskdefs
                        LoadProperties.java
  Log:
  Misplaced null check.
  
  Revision  Changes    Path
  1.7       +9 -8      jakarta-ant/proposal/sandbox/filterreaders/src/main/org/apache/tools/ant/taskdefs/LoadProperties.java
  
  Index: LoadProperties.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/sandbox/filterreaders/src/main/org/apache/tools/ant/taskdefs/LoadProperties.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- LoadProperties.java	28 Feb 2002 19:12:19 -0000	1.6
  +++ LoadProperties.java	28 Feb 2002 19:16:36 -0000	1.7
  @@ -130,18 +130,19 @@
               crh.setFilterChains(filterChains);
   
               String text = crh.processStream();
  -            if (!text.endsWith("\n")) {
  -                text = text + "\n";
  -            }
   
               if (text != null) {
  -                StringInputStream sis = new StringInputStream(text);
  -                Properties props = new Properties();
  +                if (!text.endsWith("\n")) {
  +                    text = text + "\n";
  +                }
  +
  +                final StringInputStream sis = new StringInputStream(text);
  +                final Properties props = new Properties();
                   props.load(sis);
  -                Enumeration e = props.keys();
  +                final Enumeration e = props.keys();
                   while (e.hasMoreElements()) {
  -                    String key = (String) e.nextElement();
  -                    String value = props.getProperty(key);
  +                    final String key = (String) e.nextElement();
  +                    final String value = props.getProperty(key);
                       if (key != null && value != null
                               && value.trim().length() > 0) {
                           project.setNewProperty(key, value);
  
  
  

--
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