prevent Rename from allowing Java identifiers (5828, 5906)

This commit is contained in:
Ben Fry
2020-01-17 16:41:40 -05:00
parent 5d3d1aacb8
commit 2d5683d4f9
2 changed files with 5 additions and 5 deletions

View File

@@ -129,8 +129,8 @@ class Rename {
final String newName = textField.getText().trim();
if (!newName.isEmpty()) {
if (newName.length() >= 1 &&
newName.chars().limit(1).allMatch(Character::isUnicodeIdentifierStart) &&
newName.chars().skip(1).allMatch(Character::isUnicodeIdentifierPart)) {
newName.chars().limit(1).allMatch(Character::isJavaIdentifierStart) &&
newName.chars().skip(1).allMatch(Character::isJavaIdentifierPart)) {
rename(ps, binding, newName);
window.setVisible(false);
} else {