Removal or Refactoring of HttpUtils and QueryString
---------------------------------------------------

                 Key: JSR301-5
                 URL: https://issues.apache.org/jira/browse/JSR301-5
             Project: MyFaces Portlet Bridge
          Issue Type: Improvement
            Reporter: Scott O'Bryan
            Priority: Minor


The Portlet Bridge has two utilitiy classes in the Impl.  These are HTTPUtils 
(which is used only by QueryString) and QueryString (which is used only by the 
PortletExternalContextImpl.  These classes have many utility methods which are 
currently unused and the current structure of QueryString has some performance 
impact on PortletExternalContextImpl.  Furthermore, QueryString and 
PortletExternalContextImpl's usage of it is not compatible with multiple 
parameters in places.

I propose turning QueryString into a Map<String, String[]> implementation (with 
some utility methods) whose toString() function returns the current 
queryString.  This would add a lot of efficiency (or at least correctness) to 
the PortletExternalContextImpl for several reasons:

* Areas where the PortletExternalContextImpl iterates though the parameters and 
appends them one at a time using PortletURL.setParameter(value), this could be 
changed to not use an iterator and simply PortletURL.setParameters(map);

* Areas where the PortletExternalContextImpl iterates though the parameters and 
appends  them one at a time to the ActionResponse.setRenderParameter(value), 
instead we could do use the ActionResponse.setRenderParameters(map) method.

* Areas where we get an Enumeration of keys and then execute mutliple get's for 
the parameter values, we can instead use the entrySet and the iteration 
notation in the for loop.

* Streamlines dead-code which is not currently used and should not be in the 
R.I. when it is released.

Furthermore, this map should be located as a package private class in the same 
package as the PortletExternalContextImpl in order to limit  it's visibility.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to