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

Re-examine integration of extended Charsets

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2
    • 9
    • 9-repo-jigsaw
    • core-libs

    Backports

      Description


        Charset currently uses Class.forName to load sun.nio.cs.ext.ExtendedCharsets rather than the service provider mechanism. This bug is submitted to re-examine this case to see if it can be changed to use ServiceLoader.

        The following is an example failure that arises with an early modules build.

        java.lang.Error: java.lang.IllegalAccessException: Class java.nio.charset.Charset$ExtendedProviderHolder$1 (module java.base) can not access a member of class sun.nio.cs.ext.ExtendedCharsets (module sun.charsets) with modifiers "public"
        at java.nio.charset.Charset$ExtendedProviderHolder$1.run(Charset.java:442)
        at java.nio.charset.Charset$ExtendedProviderHolder$1.run(Charset.java:431)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.nio.charset.Charset$ExtendedProviderHolder.extendedProvider(Charset.java:430)
        at java.nio.charset.Charset$ExtendedProviderHolder.<clinit>(Charset.java:427)
        at java.nio.charset.Charset.lookupExtendedCharset(Charset.java:451)
        at java.nio.charset.Charset.lookup2(Charset.java:476)
        at java.nio.charset.Charset.lookup(Charset.java:464)
        at java.nio.charset.Charset.isSupported(Charset.java:505)
        at java.lang.StringCoding.lookupCharset(StringCoding.java:99)
        at java.lang.StringCoding.encode(StringCoding.java:336)
        at java.lang.String.getBytes(String.java:906)
        at javax.xml.bind.helpers.AbstractMarshallerImpl.getJavaEncoding(AbstractMarshallerImpl.java:295)
        at javasoft.sqe.tests.bind.helpers.abstractmarshallerimpl.ParasiteMarshaller.getJavaEncoding(AbstractMarshallerImpl_CTTests.java:264)
        at javasoft.sqe.tests.bind.helpers.abstractmarshallerimpl.AbstractMarshallerImpl_CTTests.Get002(AbstractMarshallerImpl_CTTests.java:92)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:484)
        at javasoft.sqe.javatest.lib.MultiTest.invokeTestCase(MultiTest.java:405)
        at javasoft.sqe.javatest.lib.MultiTest.run(MultiTest.java:194)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:484)
        at com.sun.jck.lib.ExecJCKTestSameJVMCmd$Version2Test.execute(ExecJCKTestSameJVMCmd.java:488)
        at com.sun.jck.lib.ExecJCKTestSameJVMCmd$StandardTest.run(ExecJCKTestSameJVMCmd.java:436)
        at com.sun.jck.lib.ExecJCKTestSameJVMCmd.execute(ExecJCKTestSameJVMCmd.java:258)
        at com.sun.jck.lib.ExecJCKTestSameJVMCmd.run(ExecJCKTestSameJVMCmd.java:161)
        at com.sun.javatest.agent.Agent$Task.executeCommand(Agent.java:845)
        at com.sun.javatest.agent.Agent$Task.execute(Agent.java:789)
        at com.sun.javatest.agent.Agent$Task.handleRequest(Agent.java:645)
        at com.sun.javatest.agent.Agent.handleRequestsUntilClosed(Agent.java:416)
        at com.sun.javatest.agent.Agent.access$000(Agent.java:60)
        at com.sun.javatest.agent.Agent$1.run(Agent.java:282)
        at java.lang.Thread.run(Thread.java:744)

        Attachments

          Issue Links

            Activity

              People

                sherman Xueming Shen
                alanb Alan Bateman
                Votes:
                0 Vote for this issue
                Watchers:
                9 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: