Fix renaming from RGB to Rgb.java and others

This commit is contained in:
Federico Bond
2014-09-18 17:36:00 -03:00
parent 7905f0b2c9
commit a878ec4a36

View File

@@ -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() + "\"");