Skip to content

Commit 33ff09f

Browse files
committed
partial fix for GRAILS-9273 "DirectoryWatcher: files are incorrectly considered "new" if their extension wasn't watched for that directory"
1 parent 1c6d4cf commit 33ff09f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

grails-core/src/main/groovy/org/codehaus/groovy/grails/compiler/GrailsProjectWatcher.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,9 @@ public void onChange(File file) {
146146

147147
public void onNew(File file) {
148148
LOG.info("File [" + file + "] added. Applying changes to application.");
149-
if (!file.getName().toLowerCase().endsWith(".properties")) {
150-
// only sleep for source files, not i18n files
149+
String fileName = file.getName();
150+
if (fileName.endsWith(".groovy") || fileName.endsWith(".java")) {
151+
// only wait a bit for source files to give the user a chance to make the class valid
151152
sleep(5000);
152153
}
153154
compileIfSource(file);

0 commit comments

Comments
 (0)