From a878ec4a36addaa6b34f8bd810fc6e07129fc7cb Mon Sep 17 00:00:00 2001 From: Federico Bond Date: Thu, 18 Sep 2014 17:36:00 -0300 Subject: [PATCH] Fix renaming from RGB to Rgb.java and others --- app/src/processing/app/Sketch.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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() + "\"");