Skip to content

Commit a8401d1

Browse files
committed
fix handleSaveAs() inversion
1 parent aa58ae8 commit a8401d1

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

app/src/processing/app/Sketch.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,6 @@ public boolean save() throws IOException {
840840
* Also removes the previously-generated .class and .jar files,
841841
* because they can cause trouble.
842842
*/
843-
@SuppressWarnings("BooleanMethodIsAlwaysInverted")
844843
public boolean saveAs() throws IOException {
845844
String newParentDir = null;
846845
String newSketchName = null;

app/src/processing/app/ui/Editor.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2171,20 +2171,20 @@ protected void handleSaveImpl() {
21712171
public boolean handleSaveAs() {
21722172
statusNotice(Language.text("editor.status.saving"));
21732173
try {
2174-
//noinspection StatementWithEmptyBody
2175-
if (!sketch.saveAs()) {
2174+
if (sketch.saveAs()) {
21762175
// No longer showing "Done" message except in cases where a
21772176
// progress bar is necessary. Message will come from Sketch.
21782177
//statusNotice(Language.text("editor.status.saving.done"));
2178+
return true;
2179+
21792180
} else {
21802181
statusNotice(Language.text("editor.status.saving.canceled"));
2181-
return false;
21822182
}
21832183
} catch (Exception e) {
21842184
// show the error as a message in the window
21852185
statusError(e);
21862186
}
2187-
return true;
2187+
return false;
21882188
}
21892189

21902190

java/src/processing/mode/java/JavaEditor.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,6 @@ public void toggleBreakpoint(int lineIndex) {
659659
}
660660

661661

662-
663662
public boolean handleSaveAs() {
664663
//System.out.println("handleSaveAs");
665664
String oldName = getSketch().getCode(0).getFileName();

todo.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ X https://github.com/processing/processing4/issues/608
44
X set all build.xml files to use Java 17
55
X also fix several that still had tabs instead of spaces
66
X update to JDK 17.0.6+10 from https://adoptium.net/
7+
X fix inversion of handleSaveAs() introduced in:
8+
X https://github.com/processing/processing4/commit/aef561a8eb8fa894c5a22c611279a5092e2dbb28
79

810
manager
911
X add 'exports' to the library parameters
@@ -21,6 +23,8 @@ _ https://github.com/processing/processing4/issues/647
2123
_ lots of folders remaining in 'old' for Modes
2224
_ were these shut off during debug? need to be moving these to trash (maybe only on startup)
2325

26+
_ opening p5jsMode sketch with no local.properties throws an NPE
27+
2428
design
2529
X tool tips for errors/warnings not picking up correct colors
2630
X also fix the margins and border

0 commit comments

Comments
 (0)