pmouawad commented on a change in pull request #700:
URL: https://github.com/apache/jmeter/pull/700#discussion_r812208646



##########
File path: 
src/components/src/main/java/org/apache/jmeter/assertions/JSONPathAssertion.java
##########
@@ -164,8 +166,12 @@ private boolean arrayMatched(JSONArray value) {
     private boolean isEquals(Object subj) {
         if (isUseRegex()) {
             String str = objectToString(subj);
-            Pattern pattern = 
JMeterUtils.getPatternCache().getPattern(getExpectedValue());
-            return JMeterUtils.getMatcher().matches(str, pattern);
+            if (useJavaRegex) {
+                return java.util.regex.Pattern.matches(getExpectedValue(), 
str);
+            } else {
+                Pattern pattern = 
JMeterUtils.getPatternCache().getPattern(getExpectedValue());

Review comment:
       I think we should also have a Cache for java Patterns as compilation has 
a performance penalty no ? 
   Could we have a kind of factory which would give the implementation based on 
useJavaRegex ? 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to