cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Giacomo Pati <pati_giac...@yahoo.com>
Subject Re: [C2]: Bug in SitemapHandler (Handler.java)
Date Wed, 04 Oct 2000 14:18:28 GMT

--- Carsten Ziegeler <cziegeler@sundn.de> wrote:
> Hello,
> 
> creeping through the subsitemaps, I found this simple bug in the
> SitemapHandler (org.apache.cocoon.sitemap.Handler) Construtor:
> 
>     protected Handler (String source, boolean check_reload)
>     throws FileNotFoundException {
>         this.check_reload = check_reload;
>         String s = null;
>         if (source.charAt(source.length() - 1) == File.separatorChar)
> {
>             s = source + "sitemap.xmap";
>             this.sourceFile = new File (s);
>         } else {
>             sourceFile = new File (source);
>             if (!sourceFile.isFile()) {
>                 s = source + File.separatorChar + "sitemap.xmap";
>                 sourceFile = new File (s);
>             }
> !!! The following is not called, if "source" ends with the
> File.separatorChar:
> 
>             if (!sourceFile.canRead()) {
>                 throw new FileNotFoundException ("file " + s + " not
> found or cannot be opened for reading");
>             }
>         }
>     }
> 
> I think the last lines should be read like this:
>         }
>         if (!sourceFile.canRead()) {
>                 throw new FileNotFoundException ("file " + s + " not
> found or cannot be opened for reading");
>         }
>     }

Cool, one bug less :)

Will apply it tonight. Thanks.

Giacomo

=====
--
PWR GmbH, Organisation & Entwicklung      Tel:   +41 (0)1 856 2202
Giacomo Pati, CTO/CEO                     Fax:   +41 (0)1 856 2201
Hintereichenstrasse 7                     Mailto:Giacomo.Pati@pwr.ch
CH-8166 Niederweningen                    Web:   http://www.pwr.ch

__________________________________________________
Do You Yahoo!?
Yahoo! Photos - 35mm Quality Prints, Now Get 15 Free!
http://photos.yahoo.com/

Mime
View raw message