jdk/src/java.base/share/classes/java/net/CookieHandler.java
changeset 32649 2ee9017c7597
parent 25859 3317bb8137f4
equal deleted inserted replaced
32648:1fa861caf840 32649:2ee9017c7597
    67      * @throws SecurityException
    67      * @throws SecurityException
    68      *       If a security manager has been installed and it denies
    68      *       If a security manager has been installed and it denies
    69      * {@link NetPermission}{@code ("getCookieHandler")}
    69      * {@link NetPermission}{@code ("getCookieHandler")}
    70      * @see #setDefault(CookieHandler)
    70      * @see #setDefault(CookieHandler)
    71      */
    71      */
    72     public synchronized static CookieHandler getDefault() {
    72     public static synchronized CookieHandler getDefault() {
    73         SecurityManager sm = System.getSecurityManager();
    73         SecurityManager sm = System.getSecurityManager();
    74         if (sm != null) {
    74         if (sm != null) {
    75             sm.checkPermission(SecurityConstants.GET_COOKIEHANDLER_PERMISSION);
    75             sm.checkPermission(SecurityConstants.GET_COOKIEHANDLER_PERMISSION);
    76         }
    76         }
    77         return cookieHandler;
    77         return cookieHandler;
    87      * @throws SecurityException
    87      * @throws SecurityException
    88      *       If a security manager has been installed and it denies
    88      *       If a security manager has been installed and it denies
    89      * {@link NetPermission}{@code ("setCookieHandler")}
    89      * {@link NetPermission}{@code ("setCookieHandler")}
    90      * @see #getDefault()
    90      * @see #getDefault()
    91      */
    91      */
    92     public synchronized static void setDefault(CookieHandler cHandler) {
    92     public static synchronized void setDefault(CookieHandler cHandler) {
    93         SecurityManager sm = System.getSecurityManager();
    93         SecurityManager sm = System.getSecurityManager();
    94         if (sm != null) {
    94         if (sm != null) {
    95             sm.checkPermission(SecurityConstants.SET_COOKIEHANDLER_PERMISSION);
    95             sm.checkPermission(SecurityConstants.SET_COOKIEHANDLER_PERMISSION);
    96         }
    96         }
    97         cookieHandler = cHandler;
    97         cookieHandler = cHandler;