cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vadim Gritsenko" <vgritse...@hns.com>
Subject RE: org.apache.cocoon.sitemap.SitemapManager.hasChanged()
Date Fri, 25 Aug 2000 13:43:18 GMT
> From: Giacomo Pati [mailto:pati_giacomo@yahoo.com]
> --- Vadim Gritsenko <vgritsenko@hns.com> wrote:
> > Hi All,
> > 
> > It seems there is error in this method. It returns "true"
> > always now, and I think it should return false sometimes,
> > like this:
> > 
> >  public boolean hasChanged () {
> >   SitemapHandler sitemapHandler = null;
> >   Enumeration enum = sitemaps.elements();
> >   while (enum.hasMoreElements()) {
> >    sitemapHandler = (SitemapHandler) enum.nextElement ();
> >    if (sitemapHandler != null) {
> >     if (sitemapHandler.hasChanged())
> >      return true;
> >    }
> >   }
> >   return false;
> >  }
> 
> I've checked this and cannot reproduce it. It returns false almost al
> the times. It works just as excpected.
> 
> Giacomo

Yes, above piece of code works fine, but in CVS
(CVS $Revision: 1.1.2.8 $ $Date: 2000/08/21 17:35:31 $)
we have the following:

    public boolean hasChanged () {
        SitemapHandler sitemapHandler = null;
        Enumeration enum = sitemaps.elements();
        while (enum.hasMoreElements()) {
            sitemapHandler = (SitemapHandler) enum.nextElement ();
            if (sitemapHandler != null) {
                if (sitemapHandler.hasChanged())
                    return true;
            }
        }
        return true;
    }

which obviously returns true everytime (there is only two "return"s,
and both of them - "true"). I think, this should be corrected.
Please, correct this - if I am right.


Vadim


Mime
View raw message