Author: mposolda
Date: 2012-02-06 17:37:11 -0500 (Mon, 06 Feb 2012)
New Revision: 1376
Modified:
idm/trunk/picketlink-idm-core/src/main/java/org/picketlink/idm/impl/helper/Tools.java
Log:
JBEPP-980 little improvement to compile regex Pattern only once
Modified:
idm/trunk/picketlink-idm-core/src/main/java/org/picketlink/idm/impl/helper/Tools.java
===================================================================
---
idm/trunk/picketlink-idm-core/src/main/java/org/picketlink/idm/impl/helper/Tools.java 2012-02-06
22:27:39 UTC (rev 1375)
+++
idm/trunk/picketlink-idm-core/src/main/java/org/picketlink/idm/impl/helper/Tools.java 2012-02-06
22:37:11 UTC (rev 1376)
@@ -42,7 +42,7 @@
*/
public class Tools
{
- private static final String DN_REGEX = "([^=,\\\\]*(\\\\.)?)+";
+ private static final Pattern DN_PATTERN =
Pattern.compile("([^=,\\\\]*(\\\\.)?)+");
private static Logger log = Logger.getLogger(Tools.class.getName());
@@ -307,8 +307,7 @@
StringBuilder result = new StringBuilder();
int last = 0;
- Pattern pattern = Pattern.compile(DN_REGEX);
- Matcher m = pattern.matcher(inputlc);
+ Matcher m = DN_PATTERN.matcher(inputlc);
while (m.find())
{
if (m.group().length() == 0)
Show replies by date