Details
- 
        Type:
 Bug
            
         - 
        Status:
 Closed
            
                     - 
            Priority:
 Major
                
             - 
            Resolution: Fixed
 - 
            Affects Version/s: 1.0-beta-4, 1.0
 - 
            Fix Version/s: 1.0-beta-5
 - 
            Component/s: PicoContainer (Java)
 - 
            Labels:None
 
- 
                        Number of attachments :
 
Description
The testcase:
   public static class ContainerDependency implements Startable{
        private final DefaultPicoContainer _container;
        private boolean _started = false;
public ContainerDependency(DefaultPicoContainer container)
{ _container = container; }public void start()
{ _started = true; }        public void stop() {
        }
    }
public void testSelfRegistry()
{ DefaultPicoContainer pico = new DefaultPicoContainer(); pico.registerComponentInstance(pico); pico.registerComponentImplementation(ContainerDependency.class); pico.start(); ContainerDependency dep = (ContainerDependency)pico.getComponentInstance(ContainerDependency.class); assertTrue(pico == dep._container); assertTrue(dep._started); }This will cause a stack overflow in the current codebase b/c the container will recursive try to start itself.
Activity
| Field | Original Value | New Value | 
|---|---|---|
| Attachment | patch.txt [ 11311 ] | 
| Attachment | patch2.txt [ 11315 ] | 
| Attachment | PicoSelfRegistrationException.java [ 11316 ] | 
| Fix Version/s | 1.0-beta-5 [ 10145 ] | |
| Resolution | Fixed [ 1 ] | |
| Assignee | Aslak Hellesoy [ rinkrank ] | |
| Status | Open [ 1 ] | Closed [ 6 ] | 
This patch includes the junit testcase and the fix.