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

java.util.Service<T>.reload() doesn't update corresponding data

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P2 P2
    • 6
    • 6
    • core-libs
    • generic
    • generic

      We are trying to test CCC 4052440 (pluggable locale) functionality using Service.reload() method.
      The spec for this method says:

      "This method is intended for use in situations in which new providers can be installed into a running Java virtual machine."

      However following code doesn't install custom service provider from jar file (see the attachment)

        URLClassLoader cl =
            URLClassLoader.newInstance(
                new URL[]{ new URL("file:///C:\\Tmp\\dltest\\testserviceprovider.jar") });
        Service<LocaleNameProvider> s = Service.lookup(LocaleNameProvider.class, cl);
        s.reload();

      You may reproduce it running the Dltest.java class and (perhaps) changing a path to TestServiceProvider.jar file (attached as well). For example, after service provider dynamically loaded list of available locales isn't updated.

      Locale.getAvailableLocales doesn't get extra locale from service provider in jar file.

      ===
      Output of my test is:

      javasoft.sqe.tests.api.java.util.spi.sp.util.LocaleNameProviderImpl@1c39a2d
      Very bad! You didn't update available locales array!
      ===

            mr Mark Reinhold
            itseytin Igor Tseytin (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: