[cdi-dev] [JBoss JIRA] (CDI-332) Broken example for obtaining unmanaged instance

Pete Muir (JIRA) jira-events at lists.jboss.org
Mon Mar 4 10:16:57 EST 2013


     [ https://issues.jboss.org/browse/CDI-332?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pete Muir resolved CDI-332.
---------------------------

      Assignee: Pete Muir
    Resolution: Done


Thanks, fixed.
                
> Broken example for obtaining unmanaged instance
> -----------------------------------------------
>
>                 Key: CDI-332
>                 URL: https://issues.jboss.org/browse/CDI-332
>             Project: CDI Specification Issues
>          Issue Type: Bug
>    Affects Versions: 1.1.PFD
>            Reporter: Martin Kouba
>            Assignee: Pete Muir
>            Priority: Minor
>             Fix For: 1.1.FD
>
>
> The example in the spec text and javadoc:
> {code}
> Unmanaged unmanagedFoo = new Unmanaged(Foo.class);
> UnmanagedInstance fooInstance = unManagedFoo.newInstance();
> Foo foo = fooInstance.produce().inject().postConstruct();
> // Use the foo instance
> fooInstance.preDestroy().dispose();
> {code}
> should be replaced with something like this:
> {code}
> Unmanaged<Foo> unmanagedFoo = new Unmanaged<Foo>(Foo.class);
> UnmanagedInstance<Foo> fooInstance = unmanagedFoo.newInstance();
> Foo foo = fooInstance.produce().inject().postConstruct().get();
> // Use the foo instance
> fooInstance.preDestroy().dispose();
> {code}
> Note the generics, unManagedFoo -> unmanagedFoo and missing {{get()}}.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the cdi-dev mailing list