src/java.base/share/classes/java/security/Security.java
changeset 52621 f7309a1491d9
parent 52427 3c6aa484536c
child 53018 8bf9268df0e2
equal deleted inserted replaced
52620:5f47b56cb867 52621:f7309a1491d9
    28 import java.util.*;
    28 import java.util.*;
    29 import java.util.concurrent.ConcurrentHashMap;
    29 import java.util.concurrent.ConcurrentHashMap;
    30 import java.io.*;
    30 import java.io.*;
    31 import java.net.URL;
    31 import java.net.URL;
    32 
    32 
       
    33 import jdk.internal.event.EventHelper;
       
    34 import jdk.internal.event.SecurityPropertyModificationEvent;
    33 import jdk.internal.access.SharedSecrets;
    35 import jdk.internal.access.SharedSecrets;
    34 import jdk.internal.util.StaticProperty;
    36 import jdk.internal.util.StaticProperty;
    35 import sun.security.util.Debug;
    37 import sun.security.util.Debug;
    36 import sun.security.util.PropertyExpander;
    38 import sun.security.util.PropertyExpander;
    37 
    39 
   790      *
   792      *
   791      * @see #getProperty
   793      * @see #getProperty
   792      * @see java.security.SecurityPermission
   794      * @see java.security.SecurityPermission
   793      */
   795      */
   794     public static void setProperty(String key, String datum) {
   796     public static void setProperty(String key, String datum) {
   795         check("setProperty."+key);
   797         check("setProperty." + key);
   796         props.put(key, datum);
   798         props.put(key, datum);
   797         invalidateSMCache(key);  /* See below. */
   799         invalidateSMCache(key);  /* See below. */
       
   800 
       
   801         SecurityPropertyModificationEvent spe = new SecurityPropertyModificationEvent();
       
   802         // following is a no-op if event is disabled
       
   803         spe.key = key;
       
   804         spe.value = datum;
       
   805         spe.commit();
       
   806 
       
   807         if (EventHelper.isLoggingSecurity()) {
       
   808             EventHelper.logSecurityPropertyEvent(key, datum);
       
   809         }
   798     }
   810     }
   799 
   811 
   800     /*
   812     /*
   801      * Implementation detail:  If the property we just set in
   813      * Implementation detail:  If the property we just set in
   802      * setProperty() was either "package.access" or
   814      * setProperty() was either "package.access" or