You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jmeter.apache.org by pm...@apache.org on 2016/12/21 14:14:58 UTC

svn commit: r1775429 - /jmeter/trunk/src/components/org/apache/jmeter/assertions/gui/HTMLAssertionGui.java

Author: pmouawad
Date: Wed Dec 21 14:14:58 2016
New Revision: 1775429

URL: http://svn.apache.org/viewvc?rev=1775429&view=rev
Log:
Sonar : Fix code smells

Modified:
    jmeter/trunk/src/components/org/apache/jmeter/assertions/gui/HTMLAssertionGui.java

Modified: jmeter/trunk/src/components/org/apache/jmeter/assertions/gui/HTMLAssertionGui.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/assertions/gui/HTMLAssertionGui.java?rev=1775429&r1=1775428&r2=1775429&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/assertions/gui/HTMLAssertionGui.java (original)
+++ jmeter/trunk/src/components/org/apache/jmeter/assertions/gui/HTMLAssertionGui.java Wed Dec 21 14:14:58 2016
@@ -21,7 +21,6 @@ package org.apache.jmeter.assertions.gui
 import java.awt.BorderLayout;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
-import java.awt.event.FocusEvent;
 import java.awt.event.KeyEvent;
 import java.awt.event.KeyListener;
 
@@ -263,59 +262,6 @@ public class HTMLAssertionGui extends Ab
     }
 
     /**
-     * This method is called if one of the threshold field looses the focus
-     *
-     * @param inEvent The {@link FocusEvent} with detailed information about the focus loss
-     */
-    public void focusLost(FocusEvent inEvent) {
-        log.debug("HTMLAssertionGui.focusLost() called");
-
-        String errorThresholdString = errorThresholdField.getText();
-        if (errorThresholdString != null) {
-            if (!isThresholdValid(errorThresholdString)) {
-                log.warn("HTMLAssertionGui: Error threshold Not a valid number!");
-                JOptionPane.showMessageDialog(null, "Threshold for errors is invalid", "Error",
-                        JOptionPane.ERROR_MESSAGE);
-            }
-        }
-
-        String warningThresholdString = warningThresholdField.getText();
-        if (warningThresholdString != null) {
-            if (!isThresholdValid(warningThresholdString)) {
-                log.warn("HTMLAssertionGui: Warning threshold Not a valid number!");
-                JOptionPane.showMessageDialog(null, "Threshold for warnings is invalid", "Error",
-                        JOptionPane.ERROR_MESSAGE);
-            }
-        }
-    }
-
-    /**
-     * @param errorThresholdString Threshold as String
-     * @return boolean
-     */
-    private boolean isThresholdValid(String errorThresholdString) {
-        boolean isValid = true;
-        try {
-            if (Long.parseLong(errorThresholdString) < 0) {
-                isValid = false;
-            }
-        } catch (NumberFormatException ex) {
-            isValid = false;
-        }
-        return isValid;
-    }
-
-    /**
-     * Method gets called when one of the threshold fields gains focus
-     * 
-     * @param e The {@link FocusEvent} with detailed information about the focus gain
-     * @see java.awt.event.FocusListener#focusGained(java.awt.event.FocusEvent)
-     */
-    public void focusGained(FocusEvent e) {
-        // NOOP
-    }
-
-    /**
      * This method is called from errors-only checkbox
      *
      * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)