Merge pull request #2825 from federicobond/rename-fix

Fix renaming from RGB to Rgb.java and others
This commit is contained in:
Ben Fry
2014-11-14 15:25:55 -07:00

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