jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vladimirsitni...@apache.org
Subject [jmeter] branch master updated: Factor getNamePanel to a local variable
Date Sun, 13 Oct 2019 15:39:31 GMT
This is an automated email from the ASF dual-hosted git repository.

vladimirsitnikov 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 145d719  Factor getNamePanel to a local variable
145d719 is described below

commit 145d719e9854c12b194afe2f7f6861b363cf3078
Author: Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
AuthorDate: Sun Oct 13 19:39:11 2019 +0400

    Factor getNamePanel to a local variable
---
 .../java/org/apache/jmeter/gui/AbstractJMeterGuiComponent.java    | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/core/src/main/java/org/apache/jmeter/gui/AbstractJMeterGuiComponent.java
b/src/core/src/main/java/org/apache/jmeter/gui/AbstractJMeterGuiComponent.java
index 0d4f6ef..26f47a4 100644
--- a/src/core/src/main/java/org/apache/jmeter/gui/AbstractJMeterGuiComponent.java
+++ b/src/core/src/main/java/org/apache/jmeter/gui/AbstractJMeterGuiComponent.java
@@ -139,9 +139,11 @@ public abstract class AbstractJMeterGuiComponent extends JPanel implements
JMete
      */
     @Override
     public String getName() {
-        if (getNamePanel() != null) { // Check is mandatory because some LAFs (Nimbus) call
getName() from
-                                      // super constructor (so can happen before namePanel
field is initialized
-            return getNamePanel().getName();
+        NamePanel namePanel = getNamePanel();
+        // Check is mandatory because some LAFs (Nimbus) call getName() from
+        // super constructor (so can happen before namePanel field is initialized)
+        if (namePanel != null) {
+            return namePanel.getName();
         }
         return ""; // $NON-NLS-1$
     }


Mime
View raw message