Uploaded image for project: 'Forge'
  1. Forge
  2. FORGE-1206

Imported<?>.get() has a different behavior compared to iterator()

    XMLWordPrintable

Details

    Description

      Given:

      public interface  MyInterface {}
      

      and

      public class Foo implements MyInterface {}
      

      Trying to retrieve it from the Imported object from AddonRegistry:

      Imported<MyInterface> imported = addonRegistry.getServices(MyInterface.class);
      

      The following statements are observed:

      1. imported.get() returns instance of Foo
      2. imported.iterator().hasNext() returns false.

      Since no @Exported is placed in MyInterface, I believe the first statement is a bug.

      Attachments

        Activity

          People

            lincolnthree Lincoln Baxter III (Inactive)
            rhn-support-ggastald George Gastaldi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: