Revision: 8460
Author: [email protected]
Date: Mon Aug 2 13:26:01 2010
Log: Add a file check to handle edge cases like broken symbolic links when
scanning directories for resources.
Review at http://gwt-code-reviews.appspot.com/711803
Review by: [email protected]
http://code.google.com/p/google-web-toolkit/source/detail?r=8460
Modified:
/trunk/dev/core/src/com/google/gwt/dev/resource/impl/DirectoryClassPathEntry.java
/trunk/dev/core/src/com/google/gwt/dev/resource/impl/FileResource.java
=======================================
---
/trunk/dev/core/src/com/google/gwt/dev/resource/impl/DirectoryClassPathEntry.java
Sat Jul 31 10:16:08 2010
+++
/trunk/dev/core/src/com/google/gwt/dev/resource/impl/DirectoryClassPathEntry.java
Mon Aug 2 13:26:01 2010
@@ -81,7 +81,7 @@
private void descendToFindResources(TreeLogger logger,
PathPrefixSet pathPrefixSet, Map<AbstractResource, PathPrefix>
resources,
File dir, String dirPath) {
- assert (dir.isDirectory());
+ assert (dir.isDirectory()) : dir + " is not a directory";
// Assert: this directory is included in the path prefix set.
@@ -99,7 +99,7 @@
Messages.NOT_DESCENDING_INTO_DIR.log(logger,
child.getAbsolutePath(),
null);
}
- } else {
+ } else if (child.isFile()) {
PathPrefix prefix = null;
if ((prefix = pathPrefixSet.includesResource(childPath)) != null) {
Messages.INCLUDING_FILE.log(logger, childPath, null);
@@ -108,6 +108,8 @@
} else {
Messages.EXCLUDING_FILE.log(logger, childPath, null);
}
+ } else {
+ Messages.EXCLUDING_FILE.log(logger, childPath, null);
}
}
}
=======================================
--- /trunk/dev/core/src/com/google/gwt/dev/resource/impl/FileResource.java
Sat Jul 31 10:16:08 2010
+++ /trunk/dev/core/src/com/google/gwt/dev/resource/impl/FileResource.java
Mon Aug 2 13:26:01 2010
@@ -31,7 +31,7 @@
public FileResource(DirectoryClassPathEntry classPathEntry,
String abstractPathName, File file) {
- assert (file.isFile());
+ assert (file.isFile()) : file + " is not a file.";
this.classPathEntry = classPathEntry;
this.abstractPathName = abstractPathName;
this.file = file;
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors