Skip to content

Commit

Permalink
Soften up rule for identifier control.
Browse files Browse the repository at this point in the history
  • Loading branch information
raphw committed Apr 5, 2024
1 parent 95b083f commit 5efc70c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1842,13 +1842,16 @@ private static boolean isValidIdentifier(String[] identifier) {
* @return {@code true} if the given identifier is valid.
*/
private static boolean isValidIdentifier(String identifier) {
if (KEYWORDS.contains(identifier) || identifier.length() == 0 || !Character.isUnicodeIdentifierStart(identifier.charAt(0))) {
if (KEYWORDS.contains(identifier)
|| identifier.length() == 0
|| !(Character.isJavaIdentifierStart(identifier.charAt(0))
|| Character.isUnicodeIdentifierStart(identifier.charAt(0)))) {
return false;
} else if (identifier.equals(PackageDescription.PACKAGE_CLASS_NAME)) {
return true;
}
for (int index = 1; index < identifier.length(); index++) {
if (!Character.isUnicodeIdentifierPart(identifier.charAt(index))) {
if (!(Character.isJavaIdentifierPart(identifier.charAt(index)) || Character.isUnicodeIdentifierPart(identifier.charAt(index)))) {
return false;
}
}
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -988,7 +988,7 @@
<id>surefire-enable-dynamic-attach</id>
<activation>
<activeByDefault>false</activeByDefault>
<jdk>[22,)</jdk>
<jdk>[21,)</jdk>
</activation>
<properties>
<surefire.arguments>-XX:+EnableDynamicAgentLoading</surefire.arguments>
Expand Down

0 comments on commit 5efc70c

Please sign in to comment.