Author: fschumacher
Date: Mon Feb 12 16:42:16 2018
New Revision: 1824015

URL: http://svn.apache.org/viewvc?rev=1824015&view=rev
Log:
Join if statements

Part of #356 on Github. Contributed by Graham Russell (graham at ham1.co.uk)

Modified:
    jmeter/trunk/src/components/org/apache/jmeter/extractor/HtmlExtractor.java
    jmeter/trunk/src/core/org/apache/jmeter/control/WhileController.java
    jmeter/trunk/src/core/org/apache/jmeter/engine/ConvertListeners.java
    
jmeter/trunk/src/core/org/apache/jmeter/gui/action/SelectTemplatesDialog.java
    jmeter/trunk/src/core/org/apache/jmeter/gui/tree/JMeterTreeListener.java

Modified: 
jmeter/trunk/src/components/org/apache/jmeter/extractor/HtmlExtractor.java
URL: 
http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/extractor/HtmlExtractor.java?rev=1824015&r1=1824014&r2=1824015&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/extractor/HtmlExtractor.java 
(original)
+++ jmeter/trunk/src/components/org/apache/jmeter/extractor/HtmlExtractor.java 
Mon Feb 12 16:42:16 2018
@@ -170,11 +170,9 @@ public class HtmlExtractor extends Abstr
             if(!StringUtils.isEmpty(inputString)) {
                 getExtractorImpl().extract(expression, attribute, matchNumber, 
inputString, result, found, "-1");
             } else {
-                if(inputString==null) {
-                    if (log.isWarnEnabled()) {
-                        log.warn("No variable '{}' found to process by 
CSS/JQuery Extractor '{}', skipping processing",
-                                getVariableName(), getName());
-                    }
+                if (inputString==null && log.isWarnEnabled()) {
+                    log.warn("No variable '{}' found to process by CSS/JQuery 
Extractor '{}', skipping processing",
+                            getVariableName(), getName());
                 }
                 return Collections.emptyList();
             } 

Modified: jmeter/trunk/src/core/org/apache/jmeter/control/WhileController.java
URL: 
http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/control/WhileController.java?rev=1824015&r1=1824014&r2=1824015&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/control/WhileController.java 
(original)
+++ jmeter/trunk/src/core/org/apache/jmeter/control/WhileController.java Mon 
Feb 12 16:42:16 2018
@@ -98,10 +98,8 @@ public class WhileController extends Gen
      */
     @Override
     public Sampler next(){
-        if (isFirst()){
-            if (endOfLoop(false)){
-                return null;
-            }
+        if (isFirst() && endOfLoop(false)) {
+            return null;
         }
         return super.next();
     }

Modified: jmeter/trunk/src/core/org/apache/jmeter/engine/ConvertListeners.java
URL: 
http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/engine/ConvertListeners.java?rev=1824015&r1=1824014&r2=1824015&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/engine/ConvertListeners.java 
(original)
+++ jmeter/trunk/src/core/org/apache/jmeter/engine/ConvertListeners.java Mon 
Feb 12 16:42:16 2018
@@ -54,10 +54,8 @@ public class ConvertListeners implements
     @Override
     public void addNode(Object node, HashTree subTree) {
         for (Object item : subTree.list()) {
-            if (item instanceof AbstractThreadGroup) {
-                if (log.isDebugEnabled()) {
-                    log.debug("num threads = {}", ((AbstractThreadGroup) 
item).getNumThreads());
-                }
+            if (item instanceof AbstractThreadGroup && log.isDebugEnabled()) {
+                log.debug("num threads = {}", ((AbstractThreadGroup) 
item).getNumThreads());
             }
             if (item instanceof Remoteable) {
                 if (item instanceof RemoteThreadsListenerTestElement){

Modified: 
jmeter/trunk/src/core/org/apache/jmeter/gui/action/SelectTemplatesDialog.java
URL: 
http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/gui/action/SelectTemplatesDialog.java?rev=1824015&r1=1824014&r2=1824015&view=diff
==============================================================================
--- 
jmeter/trunk/src/core/org/apache/jmeter/gui/action/SelectTemplatesDialog.java 
(original)
+++ 
jmeter/trunk/src/core/org/apache/jmeter/gui/action/SelectTemplatesDialog.java 
Mon Feb 12 16:42:16 2018
@@ -232,14 +232,12 @@ public class SelectTemplatesDialog exten
 
     @Override
     public void hyperlinkUpdate(HyperlinkEvent e) {
-        if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
-            if (java.awt.Desktop.isDesktopSupported()) {
-                try {
-                    java.awt.Desktop.getDesktop().browse(e.getURL().toURI());
-                } catch (Exception ex) {
-                    log.error("Error opening URL in browser: {}", e.getURL());
-                } 
-            }
+        if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED && 
java.awt.Desktop.isDesktopSupported()) {
+            try {
+                java.awt.Desktop.getDesktop().browse(e.getURL().toURI());
+            } catch (Exception ex) {
+                log.error("Error opening URL in browser: {}", e.getURL());
+            } 
         }
     }
 

Modified: 
jmeter/trunk/src/core/org/apache/jmeter/gui/tree/JMeterTreeListener.java
URL: 
http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/gui/tree/JMeterTreeListener.java?rev=1824015&r1=1824014&r2=1824015&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/gui/tree/JMeterTreeListener.java 
(original)
+++ jmeter/trunk/src/core/org/apache/jmeter/gui/tree/JMeterTreeListener.java 
Mon Feb 12 16:42:16 2018
@@ -173,14 +173,12 @@ public class JMeterTreeListener implemen
             log.debug("mouse pressed, updating currentPath");
             currentPath = tree.getPathForLocation(e.getX(), e.getY());
         }
-        if (selRow != -1) {
-            if (isRightClick(e)) {
-                if (tree.getSelectionCount() < 2) {
-                    tree.setSelectionPath(currentPath);
-                }
-                log.debug("About to display pop-up");
-                displayPopUp(e);
+        if (selRow != -1 && isRightClick(e)) {
+            if (tree.getSelectionCount() < 2) {
+                tree.setSelectionPath(currentPath);
             }
+            log.debug("About to display pop-up");
+            displayPopUp(e);
         }
     }
 


Reply via email to