ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/interfaces/workspace TargetSet.java
Date Fri, 05 Jul 2002 00:24:47 GMT
donaldp     2002/07/04 17:24:47

  Modified:    container/src/java/org/apache/myrmidon/interfaces/workspace
                        TargetSet.java
  Log:
  return unmodifiable map from TargetSet
  
  Revision  Changes    Path
  1.3       +8 -6      jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/interfaces/workspace/TargetSet.java
  
  Index: TargetSet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/interfaces/workspace/TargetSet.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TargetSet.java	4 Jul 2002 01:53:16 -0000	1.2
  +++ TargetSet.java	5 Jul 2002 00:24:47 -0000	1.3
  @@ -9,6 +9,7 @@
   
   import java.util.HashMap;
   import java.util.Map;
  +import java.util.Collections;
   import org.apache.myrmidon.api.TaskException;
   import org.apache.myrmidon.interfaces.model.Target;
   
  @@ -27,17 +28,18 @@
       private final Map m_targets = new HashMap();
   
       /**
  +     * Unmodifiable map to be used when returning values in set.
  +     */
  +    private final Map m_unmodifiableTargets = Collections.unmodifiableMap( m_targets );
  +
  +    /**
        * Returns all the targets of the current project.
        *
        * @return A read-only map from target name to {@link Target}.
  -     *
  -     * @todo Return an unmodifiable wrapper.  For some reason JXPath won't
  -     *       introspect the wrapper returned by Collections.unmodifiableMap().
  -     *       Need to investigate more.
        */
       public Map getTargets()
       {
  -        return m_targets;
  +        return m_unmodifiableTargets;
       }
   
       /**
  
  
  

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