Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8296439

ServiceLoader does not support service providers on the class path with a static "provider" method

XMLWordPrintable

    • generic
    • generic

      A DESCRIPTION OF THE PROBLEM :
      Service provider mechanism is inconsistent when used with module-info.java and META-INF/resources and docs of ServiceLoader does not explain why.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Create Service and Provider for this service in a single project.
      When modules are used and provider is declared in module-info.java everything works fine.
      When provider is declared in META-INF/services the provider is not discovered.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Consistent behaviour in both cases and explanation in ServiceLoader documentation.
      ACTUAL -
      Different behaviour in both cases.

      ---------- BEGIN SOURCE ---------
      See attached zip file.
      ---------- END SOURCE ----------

      FREQUENCY : always


            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: