Skip to content

Commit 813071c

Browse files
committed
clean a couple warnings
1 parent 9a5caf3 commit 813071c

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

app/src/processing/app/Sketch.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -405,16 +405,14 @@ public void keyTyped(KeyEvent event) {
405405
// the Enter key event. Since the text field is the default component
406406
// in the dialog, OK doesn't consume Enter key event, by default.
407407
Container parent = field.getParent();
408-
while (!(parent instanceof JOptionPane)) {
408+
while (!(parent instanceof JOptionPane pane)) {
409409
parent = parent.getParent();
410410
}
411-
JOptionPane pane = (JOptionPane) parent;
412411
final JPanel pnlBottom = (JPanel)
413412
pane.getComponent(pane.getComponentCount() - 1);
414413
for (int i = 0; i < pnlBottom.getComponents().length; i++) {
415414
Component component = pnlBottom.getComponents()[i];
416-
if (component instanceof JButton) {
417-
final JButton okButton = (JButton) component;
415+
if (component instanceof final JButton okButton) {
418416
if (okButton.getText().equalsIgnoreCase("OK")) {
419417
ActionListener[] actionListeners =
420418
okButton.getActionListeners();
@@ -1049,19 +1047,19 @@ public boolean isSaving() {
10491047
* a good bit of refactoring (that should be done at some point).
10501048
* As a result, this method will return 'true' before the full "Save As"
10511049
* has completed, which will cause problems in weird cases.
1052-
*
1050+
* <p/>
10531051
* For instance, the threading will cause problems while saving an untitled
10541052
* sketch that has an enormous data folder while quitting. The save thread to
10551053
* move those data folder files won't have finished before this returns true,
10561054
* and the PDE may quit before the SwingWorker completes its job.
1057-
*
1055+
* <p/>
10581056
* <a href="https://github.com/processing/processing/issues/3843">3843</a>
10591057
*/
10601058
void startSaveAsThread(final File newFolder, final File[] copyItems) {
10611059
saving.set(true);
10621060
EventQueue.invokeLater(() -> {
10631061
final JFrame frame =
1064-
new JFrame("Saving \u201C" + newFolder.getName() + "\u201C\u2026");
1062+
new JFrame("Saving " + newFolder.getName() + "“…");
10651063
frame.setDefaultCloseOperation(WindowConstants.HIDE_ON_CLOSE);
10661064

10671065
Box box = Box.createVerticalBox();
@@ -1785,7 +1783,7 @@ public int getCurrentCodeIndex() {
17851783

17861784
/**
17871785
* Tried to remove in beta 6, but in use by Python Mode.
1788-
* When it's removed there, let me know and I'll remove it here.
1786+
* When it's removed there, let me know, and I'll remove it here.
17891787
*/
17901788
@Deprecated
17911789
public String getMainProgram() {

0 commit comments

Comments
 (0)