On Sat, Jan 10, 2009 at 9:17 AM, Matthew Toseland <[email protected]> wrote: > On Tuesday 23 December 2008 08:22, [email protected] wrote: >> Author: j16sdiz >> Date: 2008-12-23 08:22:21 +0000 (Tue, 23 Dec 2008) >> New Revision: 24760 >> >> Modified: >> trunk/plugins/XMLSpider/IndexWriter.java >> Log: >> fix create index >> >> Modified: trunk/plugins/XMLSpider/IndexWriter.java >> =================================================================== >> --- trunk/plugins/XMLSpider/IndexWriter.java 2008-12-23 08:08:44 UTC (rev > 24759) >> +++ trunk/plugins/XMLSpider/IndexWriter.java 2008-12-23 08:22:21 UTC (rev > 24760) >> @@ -49,8 +49,9 @@ >> try { >> time_taken = System.currentTimeMillis(); >> >> - if (!(new >> File(xmlSpider.getConfig().getIndexDir()).mkdirs())) { >> - Logger.error(this, "Cannot create index >> directory: " + > xmlSpider.getConfig().getIndexDir()); >> + File indexDir = new >> File(xmlSpider.getConfig().getIndexDir()); >> + if (!indexDir.exists() && !indexDir.isDirectory() && >> !indexDir.mkdirs()) > { > > This is wrong. Shortcut evaluation: mkdirs() is called only if indexDir both > doesn't exist and isn't a directory. If it does exist, even if it's not a > directory, the rest is ignored
please fix this, i can't commit at the moment. > >> + Logger.error(this, "Cannot create index >> directory: " + indexDir); >> return; >> } > > _______________________________________________ > Devl mailing list > [email protected] > http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl > _______________________________________________ Devl mailing list [email protected] http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
