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 {

View File

@@ -74,6 +74,9 @@ X https://github.com/processing/processing/issues/5805
X https://github.com/processing/processing/pull/5909
X updtes to Ukrainian translation
X https://github.com/processing/processing/pull/5944
X rename-variable menu allows Java identifiers
X https://github.com/processing/processing/issues/5828
X https://github.com/processing/processing/pull/5906
sampottinger
X Fix JDK naming and cleanup in ant build
@@ -129,9 +132,6 @@ _ windows anti-malware leaves browser stuck at 100%
_ https://github.com/processing/processing/issues/5893
quick fixes
_ rename-variable menu allows Java identifiers
_ https://github.com/processing/processing/pull/5906
from Casey
_ Math for BLEND incorrect in the reference?