jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1776637 - in /jmeter/trunk/src/components/org/apache/jmeter/visualizers: SamplerResultTab.java SearchTextExtension.java
Date Fri, 30 Dec 2016 20:43:16 GMT
Author: pmouawad
Date: Fri Dec 30 20:43:16 2016
New Revision: 1776637

URL: http://svn.apache.org/viewvc?rev=1776637&view=rev
Log:
sonar : fix code smell (Remove useless assignment)
and false-positive

Modified:
    jmeter/trunk/src/components/org/apache/jmeter/visualizers/SamplerResultTab.java
    jmeter/trunk/src/components/org/apache/jmeter/visualizers/SearchTextExtension.java

Modified: jmeter/trunk/src/components/org/apache/jmeter/visualizers/SamplerResultTab.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/visualizers/SamplerResultTab.java?rev=1776637&r1=1776636&r2=1776637&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/visualizers/SamplerResultTab.java (original)
+++ jmeter/trunk/src/components/org/apache/jmeter/visualizers/SamplerResultTab.java Fri Dec
30 20:43:16 2016
@@ -290,7 +290,7 @@ public abstract class SamplerResultTab i
                 statsBuff.append("ContentType: ").append(sampleResult.getContentType()).append(NL);
//$NON-NLS-1$
                 statsBuff.append("DataEncoding: ").append(sampleResult.getDataEncodingNoDefault()).append(NL);
//$NON-NLS-1$
                 statsDoc.insertString(statsDoc.getLength(), statsBuff.toString(), null);
-                statsBuff = null; // Done
+                statsBuff = null; // NOSONAR Help gc
                 
                 // Tabbed results: fill table
                 resultModel.addRow(new RowResult(JMeterUtils.getParsedLabel("view_results_thread_name"),
sampleResult.getThreadName())); //$NON-NLS-1$

Modified: jmeter/trunk/src/components/org/apache/jmeter/visualizers/SearchTextExtension.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/visualizers/SearchTextExtension.java?rev=1776637&r1=1776636&r2=1776637&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/visualizers/SearchTextExtension.java (original)
+++ jmeter/trunk/src/components/org/apache/jmeter/visualizers/SearchTextExtension.java Fri
Dec 30 20:43:16 2016
@@ -238,21 +238,10 @@ public class SearchTextExtension impleme
     }
 
     private Pattern createPattern(String textToFind) {
-        String textToFindQ = null;
-        if (regexpChkBox.isSelected()) {
-            textToFindQ = textToFind;
-        }
-        else {
-            // desactivate or not specials regexp char
-            textToFindQ = Pattern.quote(textToFind);
-        }
-        
-        Pattern pattern = null;
-        if (caseChkBox.isSelected()) {
-            pattern = Pattern.compile(textToFindQ);
-        } else {
-            pattern = Pattern.compile(textToFindQ, Pattern.CASE_INSENSITIVE);
-        }
+        // desactivate or not specials regexp char
+        String textToFindQ = regexpChkBox.isSelected() ? textToFind : Pattern.quote(textToFind);
       
+        Pattern pattern = caseChkBox.isSelected() ? Pattern.compile(textToFindQ) :
+            Pattern.compile(textToFindQ, Pattern.CASE_INSENSITIVE);
         return pattern;
     }
     



Mime
View raw message