You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-dev@portals.apache.org by Christof Dallermassl <cd...@hyperwave.com> on 2004/05/07 17:08:58 UTC

bug in org.apache.pluto.core.impl.PortletURLImpl.setParameter

Hi!

I think I found a bug in the following method of class 
org.apache.pluto.core.impl.PortletURLImpl:

    public void setParameter(String name, String value)
    {
        if (name == null || value == null) {
            throw new IllegalArgumentException("name and value must not be 
null");
        }
        parameters.put( name, value);
    }

but the "parameters" map should have a String[] as a value, but here a String 
is set.

As theses parameters are passed to the  
org.apache.pluto.services.information.PortletURLProvider#setParameters 
method, at least the javadoc of this method is not  correct, as it states 
that the values are String[]s. I think, in the setParameter method of 
org.apache.pluto.core.impl.PortletURLImp a

parameters.put( name, new String[] {value}); 
instead of
parameters.put(name,value);

should do, what has to be done, although previously set values would be 
destroyed then. as the method's name is setParameter this is ok for me (and 
the setParameter(String, String[]) method exists.

regards,
Christof

-- 
---------------------------------------------------------------------------
Christof Dallermassl, Software Developer
Hyperwave Research & Development, Albrechtgasse 9, A-8010 Graz, Austria
Tel. +43 316 82 09 18 - 634, Fax +43 316 82 09 18 - 99
mailto: christof.dallermassl@hyperwave.com
http://www.hyperwave.com
---------------------------------------------------------------------------

Re: bug in org.apache.pluto.core.impl.PortletURLImpl.setParameter

Posted by Michael Blum <bl...@apache.org>.
I agree. Thank you for informing us about the bug. I opened a bug report 
no. 28922 for you and fixed it as proposed.

Michael
	

Christof Dallermassl wrote:
> Hi!
> 
> I think I found a bug in the following method of class 
> org.apache.pluto.core.impl.PortletURLImpl:
> 
>     public void setParameter(String name, String value)
>     {
>         if (name == null || value == null) {
>             throw new IllegalArgumentException("name and value must not be 
> null");
>         }
>         parameters.put( name, value);
>     }
> 
> but the "parameters" map should have a String[] as a value, but here a String 
> is set.
> 
> As theses parameters are passed to the  
> org.apache.pluto.services.information.PortletURLProvider#setParameters 
> method, at least the javadoc of this method is not  correct, as it states 
> that the values are String[]s. I think, in the setParameter method of 
> org.apache.pluto.core.impl.PortletURLImp a
> 
> parameters.put( name, new String[] {value}); 
> instead of
> parameters.put(name,value);
> 
> should do, what has to be done, although previously set values would be 
> destroyed then. as the method's name is setParameter this is ok for me (and 
> the setParameter(String, String[]) method exists.
> 
> regards,
> Christof
>