Skip to content

Commit c8dfbca

Browse files
committed
Use cached URLPatternParser instead of creating new one - thanks to fcaputo for the patch
1 parent 9476830 commit c8dfbca

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎core/src/main/java/com/ocpsoft/pretty/faces/beans/ExtractedValuesURLBuilder.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public URL buildURL(final UrlMapping mapping)
5454
{
5555
FacesContext context = FacesContext.getCurrentInstance();
5656

57-
URLPatternParser parser = new URLPatternParser(mapping.getPattern());
57+
URLPatternParser parser = mapping.getPatternParser();
5858
List<PathParameter> parameters = parser.getPathParameters();
5959
List<String> parameterValues = new ArrayList<String>();
6060
for (PathParameter injection : parameters)

‎core/src/main/java/com/ocpsoft/pretty/faces/util/PrettyURLBuilder.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ public String build(final UrlMapping urlMapping, final boolean encodeUrl, final
185185
String result = "";
186186
if (urlMapping != null)
187187
{
188-
URLPatternParser parser = new URLPatternParser(urlMapping.getPattern());
188+
URLPatternParser parser = urlMapping.getPatternParser();
189189
List<String> pathParams = new ArrayList<String>();
190190
List<QueryParameter> queryParams = new ArrayList<QueryParameter>();
191191

0 commit comments

Comments
 (0)