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

JFC table view now requires extra permission.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • None
    • 10
    • core-libs
    • 10

      Run the below code with the next security policy:

      grant {
          permission java.io.FilePermission "/home/-", "read";
          permission java.util.PropertyPermission "user.home", "read";
      };

      When JFC shows up press the "details" button. See the next exception:

      Exception in thread "AWT-EventQueue-0" java.util.ServiceConfigurationError: sun.util.locale.provider.LocaleDataMetaInfo: Unable to load sun.util.resources.cldr.provider.CLDRLocaleDataMetaInfo
      at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:581)
      at java.base/java.util.ServiceLoader.loadProvider(ServiceLoader.java:862)
      at java.base/java.util.ServiceLoader.access$600(ServiceLoader.java:390)
      at java.base/java.util.ServiceLoader$ModuleServicesLookupIterator.hasNext(ServiceLoader.java:1076)
      at java.base/java.util.ServiceLoader$2.hasNext(ServiceLoader.java:1299)
      at java.base/java.util.ServiceLoader$3.hasNext(ServiceLoader.java:1384)
      at java.base/sun.util.cldr.CLDRLocaleProviderAdapter$1.run(CLDRLocaleProviderAdapter.java:79)
      at java.base/sun.util.cldr.CLDRLocaleProviderAdapter$1.run(CLDRLocaleProviderAdapter.java:76)
      at java.base/java.security.AccessController.doPrivileged(Native Method)
      at java.base/sun.util.cldr.CLDRLocaleProviderAdapter.<init>(CLDRLocaleProviderAdapter.java:76)
      at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
      at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:488)
      at java.base/java.lang.Class.newInstance(Class.java:561)
      at java.base/sun.util.locale.provider.LocaleProviderAdapter.forType(LocaleProviderAdapter.java:176)
      at java.base/sun.util.locale.provider.LocaleProviderAdapter.findAdapter(LocaleProviderAdapter.java:279)
      at java.base/sun.util.locale.provider.LocaleProviderAdapter.getAdapter(LocaleProviderAdapter.java:250)
      at java.base/java.text.DateFormat.get(DateFormat.java:819)
      at java.base/java.text.DateFormat.getDateTimeInstance(DateFormat.java:608)
      at java.desktop/sun.swing.FilePane$DetailsTableCellRenderer.<init>(FilePane.java:1054)
      at java.desktop/sun.swing.FilePane.createDetailsView(FilePane.java:1188)
      at java.desktop/javax.swing.plaf.metal.MetalFileChooserUI.createDetailsView(MetalFileChooserUI.java:554)
      at java.desktop/javax.swing.plaf.metal.MetalFileChooserUI$MetalFileChooserUIAccessor.createDetailsView(MetalFileChooserUI.java:182)
      at java.desktop/sun.swing.FilePane.setViewType(FilePane.java:353)
      at java.desktop/sun.swing.FilePane$ViewTypeAction.actionPerformed(FilePane.java:415)
      at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1967)
      at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2308)
      at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405)
      at java.desktop/javax.swing.JToggleButton$ToggleButtonModel.setPressed(JToggleButton.java:401)
      at java.desktop/javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:270)
      at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:297)
      at java.desktop/java.awt.Component.processMouseEvent(Component.java:6589)
      at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3343)
      at java.desktop/java.awt.Component.processEvent(Component.java:6354)
      at java.desktop/java.awt.Container.processEvent(Container.java:2260)
      at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:4966)
      at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2318)
      at java.desktop/java.awt.Component.dispatchEvent(Component.java:4798)
      at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4906)
      at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4535)
      at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4476)
      at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2304)
      at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2772)
      at java.desktop/java.awt.Component.dispatchEvent(Component.java:4798)
      at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:772)
      at java.desktop/java.awt.EventQueue.access$600(EventQueue.java:97)
      at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
      at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
      at java.base/java.security.AccessController.doPrivileged(Native Method)
      at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:89)
      at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:99)
      at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745)
      at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:743)
      at java.base/java.security.AccessController.doPrivileged(Native Method)
      at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:89)
      at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
      at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
      at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
      at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:117)
      at java.desktop/java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:190)
      at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
      at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770)
      at java.desktop/java.awt.EventQueue.access$600(EventQueue.java:97)
      at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
      at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
      at java.base/java.security.AccessController.doPrivileged(Native Method)
      at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:89)
      at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740)
      at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
      at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
      at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
      at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
      at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
      at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
      Caused by: java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessClassInPackage.sun.util.locale.provider")
      at java.base/java.security.AccessControlContext.checkPermission(AccessControlContext.java:472)
      at java.base/java.security.AccessController.checkPermission(AccessController.java:895)
      at java.base/java.lang.SecurityManager.checkPermission(SecurityManager.java:558)
      at java.base/java.lang.SecurityManager.checkPackageAccess(SecurityManager.java:1534)
      at java.base/java.lang.ClassLoader$1.run(ClassLoader.java:682)
      at java.base/java.lang.ClassLoader$1.run(ClassLoader.java:680)
      at java.base/java.security.AccessController.doPrivileged(Native Method)
      at java.base/java.lang.ClassLoader.checkPackageAccess(ClassLoader.java:680)
      at java.base/java.lang.ClassLoader.defineClass1(Native Method)
      at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1008)
      at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1087)
      at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:206)
      at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:760)
      at java.base/jdk.internal.loader.BuiltinClassLoader.lambda$findClassInModuleOrNull$2(BuiltinClassLoader.java:683)
      at java.base/java.security.AccessController.doPrivileged(Native Method)
      at java.base/jdk.internal.loader.BuiltinClassLoader.findClassInModuleOrNull(BuiltinClassLoader.java:684)
      at java.base/jdk.internal.loader.BuiltinClassLoader.findClass(BuiltinClassLoader.java:562)
      at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:610)
      at java.base/java.lang.Class.forName(Class.java:451)
      at java.base/java.util.ServiceLoader.lambda$loadProvider$1(ServiceLoader.java:856)
      at java.base/java.security.AccessController.doPrivileged(Native Method)
      at java.base/java.util.ServiceLoader.loadProvider(ServiceLoader.java:858)
      ... 73 more


      ===================================
      import javax.swing.*;

      public class JFC {
          public static void main(String[] args) {
              JFileChooser jFileChooser = new JFileChooser();
              jFileChooser.showOpenDialog(null);
          }
      }

            naoto Naoto Sato
            ssadetsky Semyon Sadetsky (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: