Author: chris.laprun(a)jboss.com
Date: 2008-10-15 12:18:33 -0400 (Wed, 15 Oct 2008)
New Revision: 12069
Modified:
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/WSRPPortletURL.java
Log:
- Replaced "magic" numbers for better robustness.
Modified:
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/WSRPPortletURL.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/WSRPPortletURL.java 2008-10-15
15:29:28 UTC (rev 12068)
+++
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/WSRPPortletURL.java 2008-10-15
16:18:33 UTC (rev 12069)
@@ -200,7 +200,7 @@
if (encodedURL.length() > urlTypeLength)
{
// truncate again once the value is extracted
- encodedURL = encodedURL.substring(urlTypeLength + 1); // +1 for the param
separator
+ encodedURL = encodedURL.substring(urlTypeLength + PARAM_SEPARATOR.length());
// extract the other parameters
params = extractParams(encodedURL, originalURL, customModes,
customWindowStates);
@@ -439,7 +439,7 @@
}
// extract param value
- String value = param.substring(equalsIndex + 1, param.length()); // +1 to ignore
"="
+ String value = param.substring(equalsIndex + EQUALS.length(), param.length());
// check that the given mode is valid if the param is supposed to be one
if (WSRPRewritingConstants.MODE.equals(name))
@@ -454,7 +454,7 @@
}
params.put(name, value);
- encodedURL = encodedURL.substring(endParamIndex + 1); // +1 for the param
separator
+ encodedURL = encodedURL.substring(endParamIndex + PARAM_SEPARATOR.length());
}
return params;
}
Show replies by date