[
http://www.stripesframework.org/jira/browse/STS-909?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Ben Gunter resolved STS-909.
----------------------------
Resolution: Fixed
Fix Version/s: Release 1.5.8
Assignee: Ben Gunter
> UrlBuilder reuse with setEvent
> ------------------------------
>
> Key: STS-909
> URL: http://www.stripesframework.org/jira/browse/STS-909
> Project: Stripes
> Issue Type: Improvement
> Reporter: Alessio Stalla
> Assignee: Ben Gunter
> Priority: Minor
> Fix For: Release 1.5.8
>
> Attachments: patch.txt
>
>
> A single instance of UrlBuilder can not be reused multiple times if you set
> the event to different values with setEvent. I.e., the following test doesn't
> pass:
> UrlBuilder urlBuilder = new UrlBuilder(Locale.getDefault(), "", false);
> urlBuilder.setEvent("first");
> assertEquals("?first=", urlBuilder.toString());
> urlBuilder.setEvent("second");
> assertEquals("?second=", urlBuilder.toString()); //Here,
> urlBuilder.toString() returns "?first="
> The same pattern is at least partially supported with parameters because
> calling addParameter clears the cached toString() result (although there is
> no way of removing an added parameter).
> The attached patch resolves the issue with a trivial change. There is no
> impact on existing "correct" code; if there's code in the wild that works on
> the assumption that calling setEvent() after a toString() does not actually
> change the event, that code will break.
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development