This is an automated email from the ASF dual-hosted git repository.

fschumacher pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jmeter.git


The following commit(s) were added to refs/heads/master by this push:
     new 2340756d31 Fix Aggregated Graph component to cope with empty names of 
samplers/controllers
2340756d31 is described below

commit 2340756d3162f5381c4e3708510992c079207cb9
Author: Felix Schumacher <[email protected]>
AuthorDate: Tue Nov 29 20:40:46 2022 +0100

    Fix Aggregated Graph component to cope with empty names of 
samplers/controllers
    
    Related to #5740
    Closes #5741
---
 .../src/main/java/org/apache/jmeter/visualizers/AxisGraph.java       | 5 ++++-
 xdocs/changes.xml                                                    | 1 +
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git 
a/src/components/src/main/java/org/apache/jmeter/visualizers/AxisGraph.java 
b/src/components/src/main/java/org/apache/jmeter/visualizers/AxisGraph.java
index 5725557a00..e261b00cb0 100644
--- a/src/components/src/main/java/org/apache/jmeter/visualizers/AxisGraph.java
+++ b/src/components/src/main/java/org/apache/jmeter/visualizers/AxisGraph.java
@@ -351,12 +351,15 @@ public class AxisGraph extends JPanel {
                 _maxLength = 3;
             }
             // if the "Title of Graph" is empty, we can assume some default
-            if (_title.length() == 0 ) {
+            if (_title.isEmpty()) {
                 _title = JMeterUtils.getResString("aggregate_graph_title"); 
//$NON-NLS-1$
             }
             // if the labels are too long, they'll be "squeezed" to make the 
chart viewable.
             for (int i = 0; i < _xAxisLabels.length; i++) {
                 String label = _xAxisLabels[i];
+                if (label.isEmpty()) {
+                    label = "<empty>";
+                }
                 _xAxisLabels[i]=squeeze(label, _maxLength);
             }
             this.setPreferredSize(new Dimension(_width,_height));
diff --git a/xdocs/changes.xml b/xdocs/changes.xml
index 3182bd1b0b..eb8dd6ec0d 100644
--- a/xdocs/changes.xml
+++ b/xdocs/changes.xml
@@ -135,6 +135,7 @@ Summary
 
 <h3>Listeners</h3>
 <ul>
+  <li><issue>5740</issues><pr>5741</pr>Fix Aggregated Graph component to cope 
with empty names of samplers</li>
 </ul>
 
 <h3>Timers, Assertions, Config, Pre- &amp; Post-Processors</h3>

Reply via email to