--- a/langtools/test/tools/javac/diags/CheckExamples.java Mon Dec 13 14:08:01 2010 -0800
+++ b/langtools/test/tools/javac/diags/CheckExamples.java Mon Dec 13 15:11:00 2010 -0800
@@ -129,12 +129,17 @@
File testSrc = new File(System.getProperty("test.src"));
File examples = new File(testSrc, "examples");
for (File f: examples.listFiles()) {
- if (f.isDirectory() || f.isFile() && f.getName().endsWith(".java"))
+ if (isValidExample(f))
results.add(new Example(f));
}
return results;
}
+ boolean isValidExample(File f) {
+ return (f.isDirectory() && f.list().length > 0) ||
+ (f.isFile() && f.getName().endsWith(".java"));
+ }
+
/**
* Get the contents of the "not-yet" list.
*/