Skip to content

Commit af1e2ee

Browse files
rename-variable menu allows Java identifiers
Previously it was limited to unicode identifiers--for example a beginning with _ was forbidden; not so in Java. Closes #5828 "rename-variable dialog doesn't allow 1st-char underscore"
1 parent e77ce47 commit af1e2ee

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

java/src/processing/mode/java/pdex/Rename.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ public void componentHidden(ComponentEvent e) {
129129
final String newName = textField.getText().trim();
130130
if (!newName.isEmpty()) {
131131
if (newName.length() >= 1 &&
132-
newName.chars().limit(1).allMatch(Character::isUnicodeIdentifierStart) &&
133-
newName.chars().skip(1).allMatch(Character::isUnicodeIdentifierPart)) {
132+
newName.chars().limit(1).allMatch(Character::isJavaIdentifierStart) &&
133+
newName.chars().skip(1).allMatch(Character::isJavaIdentifierPart)) {
134134
rename(ps, binding, newName);
135135
window.setVisible(false);
136136
} else {
@@ -332,4 +332,4 @@ void dispose() {
332332
window.dispose();
333333
}
334334
}
335-
}
335+
}

0 commit comments

Comments
 (0)