Author: jleroux
Date: Fri Oct  1 21:16:32 2010
New Revision: 1003655

URL: http://svn.apache.org/viewvc?rev=1003655&view=rev
Log:
Improves performance of regexp, from an Adam's advice on dev ML

Modified:
    
ofbiz/trunk/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java

Modified: 
ofbiz/trunk/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java?rev=1003655&r1=1003654&r2=1003655&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java
 (original)
+++ 
ofbiz/trunk/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java
 Fri Oct  1 21:16:32 2010
@@ -668,7 +668,7 @@ public class CommunicationEventServices 
             Address[] addressesTo = wrapper.getTo();
             Address[] addressesCC = wrapper.getCc();
             Address[] addressesBCC = wrapper.getBcc();
-            String messageId = wrapper.getMessageId().replaceAll("<|>", "");;
+            String messageId = wrapper.getMessageId().replaceAll("[<>]", "");;
 
             String aboutThisEmail = "message [" + messageId + "] from [" +
                 (addressesFrom[0] == null? "not found" : 
addressesFrom[0].toString()) + "] to [" +
@@ -794,7 +794,7 @@ public class CommunicationEventServices 
             if (inReplyTo != null && inReplyTo[0] != null) {
                 GenericValue parentCommEvent = null;
                 try {
-                    List<GenericValue> events = 
delegator.findByAnd("CommunicationEvent", UtilMisc.toMap("messageId", 
inReplyTo[0].replaceAll("<|>", "")));
+                    List<GenericValue> events = 
delegator.findByAnd("CommunicationEvent", UtilMisc.toMap("messageId", 
inReplyTo[0].replaceAll("[<>]", "")));
                     parentCommEvent = EntityUtil.getFirst(events);
                 } catch (GenericEntityException e) {
                     Debug.logError(e, module);
@@ -855,7 +855,7 @@ public class CommunicationEventServices 
                 headerString.append(headerLines.nextElement());
             }
             String header = headerString.toString();
-            commEventMap.put("headerString", header.replaceAll("<|>", ""));
+            commEventMap.put("headerString", header.replaceAll("[<>]", ""));
 
             result = dispatcher.runSync("createCommunicationEvent", 
commEventMap);
             communicationEventId = (String)result.get("communicationEventId");


Reply via email to