--- old/src/java.base/share/classes/sun/net/www/protocol/jrt/JavaRuntimeURLConnection.java 2017-03-21 13:44:16.969378385 +0000 +++ new/src/java.base/share/classes/sun/net/www/protocol/jrt/JavaRuntimeURLConnection.java 2017-03-21 13:44:16.771364797 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,8 +26,6 @@ package sun.net.www.protocol.jrt; import java.io.ByteArrayInputStream; -import java.io.File; -import java.io.FilePermission; import java.io.IOException; import java.io.InputStream; import java.net.MalformedURLException; @@ -44,7 +42,6 @@ import jdk.internal.loader.Resource; import sun.net.www.ParseUtil; import sun.net.www.URLConnection; -import sun.security.action.GetPropertyAction; /** * URLConnection implementation that can be used to connect to resources @@ -66,9 +63,6 @@ // the Resource when connected private volatile Resource resource; - // the permission to access resources in the runtime image, created lazily - private static volatile Permission permission; - JavaRuntimeURLConnection(URL url) throws IOException { super(url); String path = url.getPath(); @@ -164,14 +158,8 @@ } @Override - public Permission getPermission() throws IOException { - Permission p = permission; - if (p == null) { - String home = GetPropertyAction.privilegedGetProperty("java.home"); - p = new FilePermission(home + File.separator + "-", "read"); - permission = p; - } - return p; + public Permission getPermission() { + return new RuntimePermission("accessSystemModules"); } /**