RFR: 8292177: InitialSecurityProperty JFR event [v3]

Jaikiran Pai jpai at openjdk.org
Mon Oct 10 07:25:52 UTC 2022


On Mon, 3 Oct 2022 10:30:54 GMT, Sean Coffey <coffeys at openjdk.org> wrote:

>> New JFR event to record state of initial security properties.
>>  
>> Debug output is also now added for these properties via -Djava.security.debug=properties
>
> Sean Coffey has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Check for 0 security events

src/jdk.jfr/share/classes/jdk/jfr/internal/instrument/JDKEvents.java line 318:

> 316:                 InitialSecurityPropertyEvent e = new InitialSecurityPropertyEvent();
> 317:                 e.key = (String) entry.getKey();
> 318:                 e.value = (String) entry.getValue();

To avoid any (odd/unexpected) `ClassCastException` here, perhaps this loop can be changed to something like:

for (Set<String> name : p.stringPropertyNames()) {
    InitialSecurityPropertyEvent e = new InitialSecurityPropertyEvent();
    e.key = name;
    e.value = p.getProperty(name);

Since this code anyway wants to deal with string key/values, this wouldn't introduce any functional change and yet at the same time prevent any unexpected/theoretical `ClassCastException`s

-------------

PR: https://git.openjdk.org/jdk/pull/10394


More information about the core-libs-dev mailing list