RFR: 8302858: Polish FlightRecorderMXBeanImpl [v2]

Erik Gahlin egahlin at openjdk.org
Mon Feb 20 17:21:30 UTC 2023


On Mon, 20 Feb 2023 17:10:58 GMT, Per Minborg <pminborg at openjdk.org> wrote:

>> src/jdk.management.jfr/share/classes/jdk/management/jfr/FlightRecorderMXBeanImpl.java line 286:
>> 
>>> 284:             Object value = entry.getValue();
>>> 285:             if (!(key instanceof String)) {
>>> 286:                 throw new IllegalArgumentException("Option key must not be null, or other type than " + String.class);
>> 
>> Why is the type check removed?
>
> Because it must be a String as we are iterating over Map.Entry<String, String>

Only at compile time. A user could send data over the network using other types.

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

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


More information about the hotspot-jfr-dev mailing list