Buggy code:
public class DirectoryScanner implements FileScanner , ResourceFactory , SelectorScanner { private static final boolean ON_VMS = Os . isFamily ( "openvms" ) ; protected static final String [ ] DEFAULTEXCLUDES = new String [ ] { "**//*~" , "**//#*#" , "**//.#*" , "**//%*%" , "**//._*" , "**//CVS" , "**//CVS//**" , "**//.cvsignore" , "**//SCCS" , "**//SCCS//**" , "**//vssver.scc" , "**//.svn" , "**//.svn//**" , "**//.DS_Store" } ; private static final FileUtils FILE_UTILS = FileUtils . getFileUtils ( ) ; private static Vector defaultExcludes = new Vector ( ) ; protected File basedir ; protected String [ ] includes ; protected String [ ] excludes ; protected FileSelector [ ] selectors = null ; protected Vector filesIncluded ; protected Vector filesNotIncluded ; protected Vector filesExcluded ; protected Vector dirsIncluded ; protected Vector dirsNotIncluded ; protected Vector dirsExcluded ; protected Vector filesDeselected ; protected Vector dirsDeselected ; protected boolean haveSlowResults = false ; protected boolean isCaseSensitive = true ; private boolean followSymlinks = true ; protected boolean everythingIncluded = true ; private Set includeNonPatterns = new HashSet ( ) ; private Set excludeNonPatterns = new HashSet ( ) ; private String [ ] includePatterns ; private String [ ] excludePatterns ; private boolean areNonPatternSetsReady = false ; public DirectoryScanner ( ) { } protected static boolean matchPatternStart ( String pattern , String str ) { } protected static boolean matchPatternStart ( String pattern , String str , boolean isCaseSensitive ) { } protected static boolean matchPath ( String pattern , String str ) { } protected static boolean matchPath ( String pattern , String str , boolean isCaseSensitive ) { } public static boolean match ( String pattern , String str ) { } protected static boolean match ( String pattern , String str , boolean isCaseSensitive ) { } public static String [ ] getDefaultExcludes ( ) { } public static boolean addDefaultExclude ( String s ) { } public static boolean removeDefaultExclude ( String s ) { } public static void resetDefaultExcludes ( ) { } public void setBasedir ( String basedir ) { } public void setBasedir ( File basedir ) { } public File getBasedir ( ) { } public boolean isCaseSensitive ( ) { } public void setCaseSensitive ( boolean isCaseSensitive ) { } public boolean isFollowSymlinks ( ) { } public void setFollowSymlinks ( boolean followSymlinks ) { } public void setIncludes ( String [ ] includes ) { } public void setExcludes ( String [ ] excludes ) { } public void addExcludes ( String [ ] excludes ) { } private static String normalizePattern ( String p ) { } public void setSelectors ( FileSelector [ ] selectors ) { } public boolean isEverythingIncluded ( ) { } public void scan ( ) throws IllegalStateException { } private void checkIncludePatterns ( ) { } protected void slowScan ( ) { } protected void scandir ( File dir , String vpath , boolean fast ) { } private void accountForIncludedFile ( String name , File file ) { } private void accountForIncludedDir ( String name , File file , boolean fast ) { } protected boolean isIncluded ( String name ) { } protected boolean couldHoldIncluded ( String name ) { } private boolean isMorePowerfulThanExcludes ( String name , String includepattern ) { } protected boolean isExcluded ( String name ) { } protected boolean isSelected ( String name , File file ) { } public String [ ] getIncludedFiles ( ) { } public int getIncludedFilesCount ( ) { } public String [ ] getNotIncludedFiles ( ) { } public String [ ] getExcludedFiles ( ) { } public String [ ] getDeselectedFiles ( ) { } public String [ ] getIncludedDirectories ( ) { } public int getIncludedDirsCount ( ) { } public String [ ] getNotIncludedDirectories ( ) { } public String [ ] getExcludedDirectories ( ) { } public String [ ] getDeselectedDirectories ( ) { } public void addDefaultExcludes ( ) { } public Resource getResource ( String name ) { File f = DirectoryScanner . FILE_UTILS . resolveFile ( basedir , name ) ; <START_BUG> return new Resource ( name , f . exists ( ) , f . lastModified ( ) , f . isDirectory ( ) ) ; <END_BUG> } private Map fileListMap = new HashMap ( ) ; private String [ ] list ( File file ) { } private File findFileCaseInsensitive ( File base , String path ) { } private File findFileCaseInsensitive ( File base , Vector pathElements ) { } private File findFile ( File base , String path ) { } private File findFile ( File base , Vector pathElements ) { } private boolean isSymlink ( File base , String path ) { } private boolean isSymlink ( File base , Vector pathElements ) { } private Set scannedDirs = new HashSet ( ) ; private boolean hasBeenScanned ( String vpath ) { } private synchronized void clearCaches ( ) { } private synchronized void ensureNonPatternSetsReady ( ) { } private String [ ] fillNonPatternSet ( Set set , String [ ] patterns ) { } }

Fix:
return new Resource ( name , f . exists ( ) , f . lastModified ( ) , f . isDirectory ( ) , f . length ( ) ) ;