ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adammurd...@apache.org
Subject cvs commit: jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/workspace DefaultWorkspace.java
Date Sun, 23 Jun 2002 10:52:27 GMT
adammurdoch    2002/06/23 03:52:27

  Modified:    container/src/java/org/apache/myrmidon/components/workspace
                        DefaultWorkspace.java
  Log:
  Don't add ProjectEntry objects to the property store, because they get inherited
  in workspaces created by <antcall> and cause grief.
  
  Revision  Changes    Path
  1.98      +12 -17    jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/workspace/DefaultWorkspace.java
  
  Index: DefaultWorkspace.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/workspace/DefaultWorkspace.java,v
  retrieving revision 1.97
  retrieving revision 1.98
  diff -u -r1.97 -r1.98
  --- DefaultWorkspace.java	21 Jun 2002 08:09:55 -0000	1.97
  +++ DefaultWorkspace.java	23 Jun 2002 10:52:27 -0000	1.98
  @@ -50,6 +50,11 @@
       private ExecutionFrame m_frame;
   
       /**
  +     * Map from ProjectDescriptor to ProjectEntry for that project.
  +     */
  +    private final Map m_entries = new HashMap();
  +
  +    /**
        * Sets the root execution frame for this workspace.
        */
       public void setFrame( final ExecutionFrame frame )
  @@ -61,7 +66,7 @@
                            final String targetName )
           throws TaskException
       {
  -        final ProjectEntry entry = getProjectEntry( descriptor, m_frame );
  +        final ProjectEntry entry = getProjectEntry( descriptor );
           final Project project = entry.getProject();
   
           // First execute the implicit target.
  @@ -218,25 +223,15 @@
           }
       }
   
  -    private ProjectEntry getProjectEntry( final ProjectDescriptor descriptor,
  -                                          final ExecutionFrame frame )
  +    private ProjectEntry getProjectEntry( final ProjectDescriptor descriptor )
           throws TaskException
       {
  -        final PropertyStore propertyStore =
  -            (PropertyStore)frame.lookup( PropertyStore.ROLE );
  -
  -        final String key = ProjectEntry.KEY + "-" + descriptor.toKey();
  -
  -        ProjectEntry entry = null;
  -        try
  -        {
  -            entry = (ProjectEntry)propertyStore.getProperty( key );
  -        }
  -        catch( TaskException e )
  +        ProjectEntry entry = (ProjectEntry)m_entries.get( descriptor );
  +        if( entry == null )
           {
               final Project project = getProject( descriptor );
               entry = createProjectEntry( project, m_frame );
  -            propertyStore.setProperty( key, entry );
  +            m_entries.put( descriptor, entry );
           }
   
           return entry;
  @@ -346,7 +341,7 @@
               entry.getFrame().createChildFrame( target.getName() );
           final Executor executor = (Executor)frame.lookup( Executor.ROLE );
           final TaskContext context =
  -            frame.createTaskContext( targetModel.getName(), targetModel.getName() );
  +            frame.createTaskContext( targetModel.getName(), targetModel.getLocation() );
           executor.execute( targetModel, context );
       }
   }
  
  
  

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