ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From peterrei...@apache.org
Subject cvs commit: ant/src/main/org/apache/tools/ant/types CommandlineJava.java PropertySet.java
Date Thu, 28 Oct 2004 09:17:49 GMT
peterreilly    2004/10/28 02:17:49

  Modified:    src/main/org/apache/tools/ant Tag: ANT_16_BRANCH
                        Project.java
               src/main/org/apache/tools/ant/types Tag: ANT_16_BRANCH
                        CommandlineJava.java PropertySet.java
  Log:
  sync
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.154.2.13 +3 -3      ant/src/main/org/apache/tools/ant/Project.java
  
  Index: Project.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/Project.java,v
  retrieving revision 1.154.2.12
  retrieving revision 1.154.2.13
  diff -u -r1.154.2.12 -r1.154.2.13
  --- Project.java	28 Oct 2004 08:48:48 -0000	1.154.2.12
  +++ Project.java	28 Oct 2004 09:17:48 -0000	1.154.2.13
  @@ -826,8 +826,8 @@
           Properties systemP = System.getProperties();
           Enumeration e = systemP.propertyNames();
           while (e.hasMoreElements()) {
  -            Object name = e.nextElement();
  -            String value = systemP.get(name).toString();
  +            String name = (String) e.nextElement();
  +            String value = systemP.getProperty(name);
               this.setPropertyInternal(name.toString(), value);
           }
       }
  
  
  
  No                   revision
  No                   revision
  1.47.2.8  +2 -2      ant/src/main/org/apache/tools/ant/types/CommandlineJava.java
  
  Index: CommandlineJava.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/types/CommandlineJava.java,v
  retrieving revision 1.47.2.7
  retrieving revision 1.47.2.8
  diff -u -r1.47.2.7 -r1.47.2.8
  --- CommandlineJava.java	28 Oct 2004 08:48:48 -0000	1.47.2.7
  +++ CommandlineJava.java	28 Oct 2004 09:17:49 -0000	1.47.2.8
  @@ -128,8 +128,8 @@
                   sys = System.getProperties();
                   Properties p = new Properties();
                   for (Enumeration e = sys.propertyNames(); e.hasMoreElements();) {
  -                    Object o = e.nextElement();
  -                    p.put(o, sys.get(o));
  +                    String name = (String) e.nextElement();
  +                    p.put(name, sys.getProperty(name));
                   }
                   p.putAll(mergePropertySets());
                   for (Enumeration e = variables.elements(); e.hasMoreElements();) {
  
  
  
  1.8.2.6   +21 -1     ant/src/main/org/apache/tools/ant/types/PropertySet.java
  
  Index: PropertySet.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/types/PropertySet.java,v
  retrieving revision 1.8.2.5
  retrieving revision 1.8.2.6
  diff -u -r1.8.2.5 -r1.8.2.6
  --- PropertySet.java	23 Apr 2004 15:41:38 -0000	1.8.2.5
  +++ PropertySet.java	28 Oct 2004 09:17:49 -0000	1.8.2.6
  @@ -163,11 +163,30 @@
           return isReference() ? getRef()._mapper : _mapper;
       }
   
  +    /**
  +     * Convert the system properties to a hashtable.
  +     * Use propertynames to get the list of properties (including
  +     * default ones).
  +     */
  +    private Hashtable getAllSystemProperties() {
  +        Hashtable ret = new Hashtable();
  +        for (Enumeration e = System.getProperties().propertyNames();
  +             e.hasMoreElements();) {
  +            String name = (String) e.nextElement();
  +            ret.put(name, System.getProperties().getProperty(name));
  +        }
  +        return ret;
  +    }
  +
  +    /**
  +     * this is the operation to get the existing or recalculated properties.
  +     * @return
  +     */
       public Properties getProperties() {
           Set names = null;
           Project prj = getProject();
           Hashtable props =
  -            prj == null ? System.getProperties() : prj.getProperties();
  +            prj == null ? getAllSystemProperties() : prj.getProperties();
   
           if (getDynamic() || cachedNames == null) {
               names = new HashSet();
  @@ -200,6 +219,7 @@
               mapper = myMapper.getImplementation();
           }
           Properties properties = new Properties();
  +        //iterate through the names, get the matching values
           for (Iterator iter = names.iterator(); iter.hasNext();) {
               String name = (String) iter.next();
               String value = (String) props.get(name);
  
  
  

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


Mime
View raw message