Hi Vadim,

        Thanks for your response. :)

On Thu, Dec 20, 2001 at 01:19:19PM -0500, Vadim Gritsenko wrote:
> 
> This parameters object you are referring is read-only by semantics, but
> not by syntax. It is used as an optimization, instead of writing:
> 
> >   if (isSelected("userstatus", "permitted", listOfMaps,
> >                new Parameters(), objectModel)) {
> 
> sitemap uses static instance. The solution is to have unmodifiable
> wrapper parameters class available, as it is done in java collections
> library. Then, sitemap could be modified to use it:
> 
> >   /** An empty <code>Parameter</code> used to pass to the sitemap
> components
> > */
> >   private Parameters emptyParam =
> >       Parameters.unmodifiableParameters(new Parameters());
> 
> Hope this is clear enough,

        Yes, all clear.
        
        Currently, unmodifiableParameters doesn't exist in the
        Avalon Parameters class (I don't have a problem implementing
        it though), but I've attached a diff which does something
        similar, just via a constructor and the Parameters.makeReadOnly()
        method.

        What do you think ?

        Cheers,

        Marcus

-- 
        .....
     ,,$$$$$$$$$,      Marcus Crafter
    ;$'      '$$$$:    Computer Systems Engineer
    $:         $$$$:   ManageSoft GmbH
     $       o_)$$$:   82-84 Mainzer Landstrasse
     ;$,    _/\ &&:'   60327 Frankfurt Germany
       '     /( &&&
           \_&&&&'     Email : [EMAIL PROTECTED]
          &&&&.        Business Hours : +49 69 9757 200
    &&&&&&&:
Index: src/org/apache/cocoon/components/language/markup/sitemap/java/sitemap.xsl
===================================================================
RCS file: 
/home/cvspublic/xml-cocoon2/src/org/apache/cocoon/components/language/markup/sitemap/java/sitemap.xsl,v
retrieving revision 1.11.2.42
diff -u -r1.11.2.42 sitemap.xsl
--- src/org/apache/cocoon/components/language/markup/sitemap/java/sitemap.xsl   
2001/12/13 17:11:54     1.11.2.42
+++ src/org/apache/cocoon/components/language/markup/sitemap/java/sitemap.xsl   
+2001/12/20 19:57:48
@@ -136,7 +136,12 @@
       }
 
       /** An empty &lt;code&gt;Parameter&lt;/code&gt; used to pass to the sitemap 
components */
-      private Parameters emptyParam = new Parameters();
+      private final Parameters emptyParam;
+
+      public <xsl:value-of select="@file-name"/> () {
+          emptyParam = new Parameters();
+          emptyParam.makeReadOnly();
+      }
 
       /** HashMap relating labels to view names */
       private HashMap view_label_map = new HashMap(<xsl:value-of 
select="count(/map:sitemap/map:views/map:view[@from-label])"/>);

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to