cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vgritse...@apache.org
Subject cvs commit: xml-cocoon2/src/org/apache/cocoon/sitemap AbstractSitemap.java
Date Fri, 22 Jun 2001 14:46:01 GMT
vgritsenko    01/06/22 07:46:00

  Modified:    src/org/apache/cocoon/sitemap AbstractSitemap.java
  Log:
  - fix debug statement (was my fault)
  - check for absence of substituted value as suggested by Steffen Stundzig <steffen@smb-tec.com>
  
  Revision  Changes    Path
  1.10      +10 -8     xml-cocoon2/src/org/apache/cocoon/sitemap/AbstractSitemap.java
  
  Index: AbstractSitemap.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/sitemap/AbstractSitemap.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- AbstractSitemap.java	2001/06/22 11:51:20	1.9
  +++ AbstractSitemap.java	2001/06/22 14:45:58	1.10
  @@ -43,7 +43,7 @@
    * Base class for generated <code>Sitemap</code> classes
    *
    * @author <a href="mailto:Giacomo.Pati@pwr.ch">Giacomo Pati</a>
  - * @version CVS $Revision: 1.9 $ $Date: 2001/06/22 11:51:20 $
  + * @version CVS $Revision: 1.10 $ $Date: 2001/06/22 14:45:58 $
    */
   public abstract class AbstractSitemap extends AbstractLoggable implements Sitemap, Disposable,
ThreadSafe {
       private Context context;
  @@ -282,14 +282,16 @@
                       k--;
                       m = l;
                   }
  -                if (m == -1) {
  -                    result.append(((Object)((Map)list.get(k)).get(s)).toString());
  -                } else {
  -                    result.append(((Object)((Map)list.get(k)).get(s.substring(m + 3))).toString());
  +                if (m != -1) {
  +                    s = s.substring(m + 3);
                   }
  -                // FIXME (DIMS): This causes Exception in the Internationalization sample.
  -                //getLogger().debug("substitute evaluated value for " + ((m == -1) ? s
: s.substring(m + 1)) + " as " +
  -                //    ((Object)((Map)list.get(k)).get((m == -1) ? s : s.substring(m + 1))).toString());
  +                Object value = ((Map)list.get(k)).get(s);
  +                if (value != null){
  +                    result.append(value.toString());
  +                    getLogger().debug("Substitute evaluated value for " + s + " as " +
value);
  +                }else{
  +                    getLogger().warn("Substitute: value not found for " + s + " while evaluating
" + expr);
  +                }
               }
               if (ii < expr.length()) {
                   result.append(expr.substring(ii));
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org


Mime
View raw message