jsalvata    2004/01/14 15:59:06

  Modified:    src/core/org/apache/jmeter/gui GuiPackage.java
  Log:
  Fix bug that prevented two different TestBean classes being
  edited in the same JMeter run.
  
  Revision  Changes    Path
  1.19      +31 -19    jakarta-jmeter/src/core/org/apache/jmeter/gui/GuiPackage.java
  
  Index: GuiPackage.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/gui/GuiPackage.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- GuiPackage.java   14 Jan 2004 23:10:30 -0000      1.18
  +++ GuiPackage.java   14 Jan 2004 23:59:06 -0000      1.19
  @@ -108,11 +108,17 @@
       private Map nodesToGui = new HashMap();
       
       /**
  -     * Map from String to JMeterGUIComponent, mapping the fully qualified class
  -     * name of a GUI component to an instance of that component.
  +     * Map from Class to JMeterGUIComponent, mapping the Class of a GUI
  +     * component to an instance of that component.
        */
       private Map guis = new HashMap();
       
  +    /**
  +     * Map from Class to TestBeanGUI, mapping the Class of a TestBean to an
  +     * instance of TestBeanGUI to be used to edit such components.
  +     */
  +    private Map testBeanGUIs= new HashMap();
  +
       /** The currently selected node in the tree. */
       private JMeterTreeNode currentNode = null;
       
  @@ -377,22 +383,28 @@
                  IllegalAccessException,
                  ClassNotFoundException
       {
  -        JMeterGUIComponent comp = (JMeterGUIComponent) guis.get(guiClass);
  -        if (comp == null)
  -        {
  -            if (guiClass == TestBeanGUI.class)
  -            {
  -                comp= new TestBeanGUI(testClass);
  -            }
  -            else
  -            {
  -                comp = (JMeterGUIComponent) guiClass.newInstance();
  -            }
  -            if (!(comp instanceof UnsharedComponent))
  -            {
  -                guis.put(guiClass, comp);
  -            }
  -        }
  +        JMeterGUIComponent comp ;
  +             if (guiClass == TestBeanGUI.class)
  +             {
  +                     comp= (TestBeanGUI) testBeanGUIs.get(testClass); 
  +                     if (comp == null)
  +                     {
  +                             comp= new TestBeanGUI(testClass);
  +                             testBeanGUIs.put(testClass, comp);
  +                     } 
  +             }
  +             else
  +             {
  +                     comp= (JMeterGUIComponent) guis.get(guiClass);
  +                     if (comp == null) 
  +                     {
  +                             comp = (JMeterGUIComponent) guiClass.newInstance();
  +                             if (!(comp instanceof UnsharedComponent))
  +                             {
  +                                     guis.put(guiClass, comp);
  +                             }
  +                     } 
  +             }
           return comp;
       }
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to