8272515: JFR: Names should only be valid Java identifiers

Reviewed-by: mgronlun
This commit is contained in:
Erik Gahlin 2021-09-20 15:44:46 +00:00
parent 4d95a5d6dc
commit 48aff23165
11 changed files with 285 additions and 49 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2009, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -168,7 +168,7 @@ public final class Checks {
* Returns true if the given string is a legal Java identifier,
* otherwise false.
*/
private static boolean isJavaIdentifier(String str) {
public static boolean isJavaIdentifier(String str) {
if (str.isEmpty() || RESERVED.contains(str))
return false;