jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fschumac...@apache.org
Subject svn commit: r1846344 - /jmeter/trunk/src/core/org/apache/jmeter/gui/util/MenuFactory.java
Date Sun, 11 Nov 2018 10:39:50 GMT
Author: fschumacher
Date: Sun Nov 11 10:39:50 2018
New Revision: 1846344

URL: http://svn.apache.org/viewvc?rev=1846344&view=rev
Log:
Extract duplicate code into private method. No functional change.

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/gui/util/MenuFactory.java

Modified: jmeter/trunk/src/core/org/apache/jmeter/gui/util/MenuFactory.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/gui/util/MenuFactory.java?rev=1846344&r1=1846343&r2=1846344&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/gui/util/MenuFactory.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/gui/util/MenuFactory.java Sun Nov 11 10:39:50
2018
@@ -372,10 +372,7 @@ public final class MenuFactory {
     }
 
     public static JPopupMenu getDefaultConfigElementMenu() {
-        JPopupMenu pop = new JPopupMenu();
-        MenuFactory.addEditMenu(pop, true);
-        MenuFactory.addFileMenu(pop);
-        return pop;
+        return createDefaultPopupMenu();
     }
 
     public static JPopupMenu getDefaultVisualizerMenu() {
@@ -388,27 +385,22 @@ public final class MenuFactory {
     }
 
     public static JPopupMenu getDefaultTimerMenu() {
-        JPopupMenu pop = new JPopupMenu();
-        MenuFactory.addEditMenu(pop, true);
-        MenuFactory.addFileMenu(pop);
-        return pop;
+        return createDefaultPopupMenu();
     }
 
     public static JPopupMenu getDefaultAssertionMenu() {
-        JPopupMenu pop = new JPopupMenu();
-        MenuFactory.addEditMenu(pop, true);
-        MenuFactory.addFileMenu(pop);
-        return pop;
+        return createDefaultPopupMenu();
     }
 
     public static JPopupMenu getDefaultExtractorMenu() {
-        JPopupMenu pop = new JPopupMenu();
-        MenuFactory.addEditMenu(pop, true);
-        MenuFactory.addFileMenu(pop);
-        return pop;
+        return createDefaultPopupMenu();
     }
 
     public static JPopupMenu getDefaultMenu() { // if type is unknown
+        return createDefaultPopupMenu();
+    }
+
+    private static JPopupMenu createDefaultPopupMenu() {
         JPopupMenu pop = new JPopupMenu();
         MenuFactory.addEditMenu(pop, true);
         MenuFactory.addFileMenu(pop);



Mime
View raw message