RFR: 8272515: JFR: Names should only be valid Java identifiers

Alan Bateman alanb at openjdk.java.net
Mon Sep 13 18:05:54 UTC 2021


On Wed, 8 Sep 2021 13:00:17 GMT, Erik Gahlin <egahlin at openjdk.org> wrote:

> Hi,
> 
> Could I have a review of change that prevents invalid Java identifiers or type names in JFR events. For rationale and compatibility issues see the CSR request. The only change to java.base is making jdk.modules.internal.Checks::isJavaIdentifier(String) public, so it can be reused by the jdk.jfr module.
> 
> Testing: /jdk/jdk/jfr + tier1 + tier2
> 
> Thanks
> Erik

src/java.base/share/classes/jdk/internal/module/Checks.java line 171:

> 169:      * otherwise false.
> 170:      */
> 171:     public static boolean isJavaIdentifier(String str) {

I see Checks is already used by code in the jdk.jlink and jdk.jartool module so probably okay if JFR uses it. At some point we need to get back to trimming back the qualified exports to avoid too much back sliding into a ball of mud.

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

PR: https://git.openjdk.java.net/jdk/pull/5415


More information about the core-libs-dev mailing list