hk2
  1. hk2
  2. HK2-132

HK2-Guice bridge does not work for Provider<GuiceService>

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.0
    • Fix Version/s: 2.2.0
    • Component/s: None
    • Labels:
      None
    • Environment:

      Guice 3 + Guice Bridge (Hk2 2.2.0-b14) + Jersey 2.3.1

      Description

      The bridge works fine for direct dependencies but when it comes to Providers, HK2 do inject a Provider implementation but when performing the get(), it won't call the bridge and simply returns null.

      Ex:

      @Path("")
      public class WelcomeResource {

      // This works fine.
      @Inject
      PageController pageController;

      // This won't. Got a provider but it won't resolve when I call get.
      @Inject
      PageController pageControllerProvider;

        Activity

        Hide
        eric_poitras added a comment -

        The second property should have been:

        // This won't. Got a provider but it won't resolve when I call get.
        @Inject
        Provider<PageController> pageControllerProvider;

        Show
        eric_poitras added a comment - The second property should have been: // This won't. Got a provider but it won't resolve when I call get. @Inject Provider<PageController> pageControllerProvider;
        Hide
        jwells added a comment -

        This was an issue with Providers not participating in the JIT protocol. Tests have been added and the problem fixed.

        Show
        jwells added a comment - This was an issue with Providers not participating in the JIT protocol. Tests have been added and the problem fixed.

          People

          • Assignee:
            jwells
            Reporter:
            eric_poitras
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: