You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jmeter.apache.org by "vlsi (via GitHub)" <gi...@apache.org> on 2023/05/10 10:20:36 UTC

[GitHub] [jmeter] vlsi commented on a diff in pull request #5901: Fix NumberFormatException when counter is empty or not a digit on Proxy Settings panel

vlsi commented on code in PR #5901:
URL: https://github.com/apache/jmeter/pull/5901#discussion_r1189695822


##########
src/protocol/http/src/main/java/org/apache/jmeter/protocol/http/proxy/gui/ProxyControlGui.java:
##########
@@ -691,6 +698,17 @@ void enableRestart() {
         }
     }
 
+    void setSetCounters() {
+        if ((counterValue.getText().length() > 0) && NumberUtils.isParsable(counterValue.getText())) {
+            Proxy.setCounter(Integer.parseInt(counterValue.getText()));
+        } else {
+            JOptionPane.showMessageDialog(this,
+                    //"Counter isn't a number value.", "Error on counter value", JOptionPane.WARNING_MESSAGE);
+                    JMeterUtils.getResString("proxy_settings_counter_error_digits"), // $NON-NLS-1$
+                    JMeterUtils.getResString("proxy_settings_counter_error_invalid_data"), // $NON-NLS-1$
+                    JOptionPane.WARNING_MESSAGE);

Review Comment:
   Ok, I see the number was already parsed without evaluating the properties, so supporting `${..}` there would be a different issue



-- 
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: dev-unsubscribe@jmeter.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org