cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carsten Ziegeler" <cziege...@sundn.de>
Subject [C2]: Bug in SitemapHandler (Handler.java)
Date Wed, 04 Oct 2000 11:41:01 GMT
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");
        }
    }

Regards
Carsten Ziegeler

Open Source Group              sunShine - Lighting up e:Business
================================================================
Carsten Ziegeler, S&N AG, Klingenderstrasse 5, D-33100 Paderborn
www.sundn.de                           mailto:cziegeler@sundn.de 
================================================================


Mime
View raw message