Skip to content

singletions recreated many times on error, memebrs injected values may be null #676

@gissuebot

Description

@gissuebot

From kvaster on December 25, 2011 05:39:32

  1. Singletons should be not recreated many times if there was error whil constructing it. i.e.:
    class T1, class T2 depends on T1 and class T3 depends on T1.
    All of them singletons. Guice will try to create T1 three times: when creating itself, when creating T2 and T3.

  2. Injected member may be null in case of dependent bean creation error. i.e.:
    T1 class, T2 class have member of T1.
    T1 failed to create due to exception, but T2 will not fail, rather it will have T1 fieled equal to null.

Attached patch to fix issues.

Attachment: gist
   guice-singleton-recreation.patch

Original issue: http://code.google.com/p/google-guice/issues/detail?id=676

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions