diff --git a/app/src/processing/app/Sketch.java b/app/src/processing/app/Sketch.java index 957f785d8..d0f8f17ce 100644 --- a/app/src/processing/app/Sketch.java +++ b/app/src/processing/app/Sketch.java @@ -493,9 +493,10 @@ public class Sketch { // A regression introduced by Florian's bug report (below) years earlier. if (!(renamingCode && sanitaryName.equals(current.getPrettyName()))) { // Make sure no .pde *and* no .java files with the same name already exist + // (other than the one we are currently attempting to rename) // http://processing.org/bugs/bugzilla/543.html for (SketchCode c : code) { - if (sanitaryName.equalsIgnoreCase(c.getPrettyName())) { + if (c != current && sanitaryName.equalsIgnoreCase(c.getPrettyName())) { Base.showMessage("Nope", "A file named \"" + c.getFileName() + "\" already exists at\n" + "\"" + folder.getAbsolutePath() + "\"");