jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1775416 - /jmeter/trunk/src/jorphan/org/apache/jorphan/util/JOrphanUtils.java
Date Wed, 21 Dec 2016 13:35:50 GMT
Author: pmouawad
Date: Wed Dec 21 13:35:50 2016
New Revision: 1775416

URL: http://svn.apache.org/viewvc?rev=1775416&view=rev
Log:
Bug 54525 - Search Feature : Enhance it with ability to replace
Part 1 : create replace that counts number of replacements
Fix sonar error

Modified:
    jmeter/trunk/src/jorphan/org/apache/jorphan/util/JOrphanUtils.java

Modified: jmeter/trunk/src/jorphan/org/apache/jorphan/util/JOrphanUtils.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/jorphan/org/apache/jorphan/util/JOrphanUtils.java?rev=1775416&r1=1775415&r2=1775416&view=diff
==============================================================================
--- jmeter/trunk/src/jorphan/org/apache/jorphan/util/JOrphanUtils.java (original)
+++ jmeter/trunk/src/jorphan/org/apache/jorphan/util/JOrphanUtils.java Wed Dec 21 13:35:50
2016
@@ -632,13 +632,12 @@ public final class JOrphanUtils {
         java.util.regex.Pattern pattern = caseSensitive ? 
                 java.util.regex.Pattern.compile(regex) :  
                 java.util.regex.Pattern.compile(regex, java.util.regex.Pattern.CASE_INSENSITIVE);
-        String previousText = null;
         String newText = source;
         replacement = Matcher.quoteReplacement(replacement);
         Matcher matcher = pattern.matcher(newText);
         int totalReplaced = 0;
-        while(!newText.equals(previousText)) {
-            previousText = newText;
+        while(true) {
+            String previousText = newText;
             newText = matcher.replaceFirst(replacement);
             matcher = pattern.matcher(newText);
             if(newText.equals(previousText)) {



Mime
View raw message