Buggy code:
public class RelativePortalURLImpl implements PortalURL { private static final Logger LOG = LoggerFactory . getLogger ( RelativePortalURLImpl . class ) ; private static final boolean isDebug = RelativePortalURLImpl . LOG . isDebugEnabled ( ) ; private static final boolean isTrace = RelativePortalURLImpl . LOG . isTraceEnabled ( ) ; private String urlBase ; private String servletPath ; private String renderPath ; private String cacheLevel ; private String resourceID ; private int cloneId = 0 ; private static int cloneCtr = 0 ; private PublicRenderParameterMapper prpMapper = null ; private HashSet < String > portletIds = new HashSet < String > ( ) ; private HashMap < String , String > versionMap = new HashMap < String , String > ( ) ; private HashMap < String , Boolean > v3Map = new HashMap < String , Boolean > ( ) ; private PortalURLParser urlParser ; HttpServletRequest servletRequest ; boolean reqParamsProcessed = false ; private Map < String , WindowState > windowStates = new HashMap < String , WindowState > ( ) ; private Map < String , PortletMode > portletModes = new HashMap < String , PortletMode > ( ) ; private HashSet < PortalURLParameter > parameters = new HashSet < PortalURLParameter > ( ) ; URLType type = URLType . Portal ; String targetWindow = null ; public RelativePortalURLImpl ( String urlBase , String contextPath , String servletName , PortalURLParser urlParser , HttpServletRequest req ) { } private RelativePortalURLImpl ( ) { } protected void handleServletRequestParams ( ) { if ( ( ( ( ! ( reqParamsProcessed ) ) && ( ( servletRequest ) != null ) ) && ( ( targetWindow ) != null ) ) && ( ( type ) != ( URLType . Portal ) ) ) { reqParamsProcessed = true ; try { servletRequest . setCharacterEncoding ( "UTF-8" ) ; } catch ( Exception e ) { } Map < String , String [ ] > parms = servletRequest . getParameterMap ( ) ; if ( ! ( parms . isEmpty ( ) ) ) { String ptype = PortalURLParameter . PARAM_TYPE_RENDER ; if ( ( ( ( type ) == ( URLType . Action ) ) || ( ( type ) == ( URLType . AjaxAction ) ) ) || ( ( type ) == ( URLType . PartialAction ) ) ) { ptype = PortalURLParameter . PARAM_TYPE_ACTION ; } else if ( ( type ) == ( URLType . Resource ) ) { ptype = PortalURLParameter . PARAM_TYPE_RESOURCE ; } for ( String parm : parms . keySet ( ) ) { if ( ( ( type ) == ( URLType . Render ) ) && ( ( targetWindow ) != null ) ) { int index = prpMapper . getIndex ( targetWindow , parm ) ; if ( index >= 0 ) { prpMapper . setValues ( index , parms . get ( parm ) ) ; if ( RelativePortalURLImpl . isDebug ) { StringBuilder txt = new StringBuilder ( "Added<seq2seq4repair_space>public<seq2seq4repair_space>parameter:<seq2seq4repair_space>" ) ; txt . append ( parm ) . append ( ",<seq2seq4repair_space>Values:<seq2seq4repair_space>" ) . append ( Arrays . toString ( parms . get ( parm ) ) ) ; txt . append ( ( ",<seq2seq4repair_space>Clone<seq2seq4repair_space>ID:<seq2seq4repair_space>" + ( cloneId ) ) ) ; RelativePortalURLImpl . LOG . debug ( txt . toString ( ) ) ; } continue ; } } PortalURLParameter pup = new PortalURLParameter ( targetWindow , parm , parms . get ( parm ) , ptype ) ; if ( parameters . contains ( pup ) ) { parameters . remove ( pup ) ; } parameters . add ( pup ) ; if ( RelativePortalURLImpl . isDebug ) { StringBuilder txt = new StringBuilder ( "Added<seq2seq4repair_space>private<seq2seq4repair_space>parameter:<seq2seq4repair_space>" ) ; txt . append ( parm ) . append ( ",<seq2seq4repair_space>Values:<seq2seq4repair_space>" ) . append ( Arrays . toString ( parms . get ( parm ) ) ) ; <START_BUG> txt . append ( parm ) . append ( ",<seq2seq4repair_space>Type:<seq2seq4repair_space>" ) . append ( ptype ) ; <END_BUG> txt . append ( ( ",<seq2seq4repair_space>Clone<seq2seq4repair_space>ID:<seq2seq4repair_space>" + ( cloneId ) ) ) ; RelativePortalURLImpl . LOG . debug ( txt . toString ( ) ) ; } } } } } public void setRenderPath ( String renderPath ) { } public String getRenderPath ( ) { } protected void addParameter ( PortalURLParameter param ) { } public void setParameter ( PortalURLParameter param ) { } public Collection < PortalURLParameter > getParameters ( ) { } public Map < String , PortletMode > getPortletModes ( ) { } public PortletMode getPortletMode ( String windowId ) { } public void setPortletMode ( String windowId , PortletMode portletMode ) { } public Map < String , WindowState > getWindowStates ( ) { } public WindowState getWindowState ( String windowId ) { } public void setWindowState ( String windowId , WindowState windowState ) { } public void clearParameters ( String windowId ) { } public void setCacheability ( String cacheLevel ) { } public String getCacheability ( ) { } public void setResourceID ( String resourceID ) { } public String getResourceID ( ) { } public String toString ( ) { } public String toURL ( boolean absolute ) { } @ Deprecated public String getServerURI ( ) { } public String getServletPath ( ) { } public synchronized PortalURL clone ( ) { } public PageConfig getPageConfig ( ServletContext servletContext ) { } public synchronized void merge ( PortalURL url , String windowId ) { } public void addPublicRenderParameter ( PortalURLPublicParameter pup ) { } public void setPublicRenderParameterMapper ( PublicRenderParameterMapper prpm ) { } public PublicRenderParameterMapper getPublicRenderParameterMapper ( ) { } public void setPortletIds ( Collection < String > portletIds ) { } public Collection < String > getPortletIds ( ) { } public void setVersion ( String portletId , String version ) { } public String getVersion ( String portletId ) { } public boolean isVersion3 ( String portletId ) { } public void setType ( URLType type ) { }

Fix:
txt . append ( ",<seq2seq4repair_space>Type:<seq2seq4repair_space>" ) . append ( ptype ) ;