jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1199920 - /jmeter/trunk/src/core/org/apache/jmeter/testbeans/gui/GenericTestBeanCustomizer.java
Date Wed, 09 Nov 2011 19:03:55 GMT
Author: sebb
Date: Wed Nov  9 19:03:55 2011
New Revision: 1199920

URL: http://svn.apache.org/viewvc?rev=1199920&view=rev
Log:
Property Editor override was being done in the wrong place

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/testbeans/gui/GenericTestBeanCustomizer.java

Modified: jmeter/trunk/src/core/org/apache/jmeter/testbeans/gui/GenericTestBeanCustomizer.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/testbeans/gui/GenericTestBeanCustomizer.java?rev=1199920&r1=1199919&r2=1199920&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/testbeans/gui/GenericTestBeanCustomizer.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/testbeans/gui/GenericTestBeanCustomizer.java Wed
Nov  9 19:03:55 2011
@@ -192,30 +192,31 @@ public class GenericTestBeanCustomizer e
             }
 
             PropertyEditor propertyEditor;
-            Class<?> editorClass = descriptor.getPropertyEditorClass();
-            if (log.isDebugEnabled()) {
-                log.debug("Property " + name + " has editor class " + editorClass);
-            }
-
-            if (editorClass != null) {
-                try {
-                    propertyEditor = (PropertyEditor) editorClass.newInstance();
-                } catch (InstantiationException e) {
-                    log.error("Can't create property editor.", e);
-                    throw new Error(e.toString());
-                } catch (IllegalAccessException e) {
-                    log.error("Can't create property editor.", e);
-                    throw new Error(e.toString());
-                }
+            Object guiType = descriptor.getValue(GUITYPE);
+            if (guiType instanceof GuiEditor) {
+                propertyEditor = ((GuiEditor) guiType).getInstance(descriptor);         
  
             } else {
-                Class<?> c = descriptor.getPropertyType();
-                propertyEditor = PropertyEditorManager.findEditor(c);
-            }
-
-            if (log.isDebugEnabled()) {
-                log.debug("Property " + name + " has property editor " + propertyEditor);
+                Class<?> editorClass = descriptor.getPropertyEditorClass();
+                if (log.isDebugEnabled()) {
+                    log.debug("Property " + name + " has editor class " + editorClass);
+                }
+    
+                if (editorClass != null) {
+                    try {
+                        propertyEditor = (PropertyEditor) editorClass.newInstance();
+                    } catch (InstantiationException e) {
+                        log.error("Can't create property editor.", e);
+                        throw new Error(e.toString());
+                    } catch (IllegalAccessException e) {
+                        log.error("Can't create property editor.", e);
+                        throw new Error(e.toString());
+                    }
+                } else {
+                    Class<?> c = descriptor.getPropertyType();
+                    propertyEditor = PropertyEditorManager.findEditor(c);
+                }
             }
-
+            
             if (propertyEditor == null) {
                 log.warn("No editor for property: " + name 
                         + " type: " + descriptor.getPropertyType()
@@ -225,6 +226,10 @@ public class GenericTestBeanCustomizer e
                 continue;
             }
 
+            if (log.isDebugEnabled()) {
+                log.debug("Property " + name + " has property editor " + propertyEditor);
+            }
+
             if (!propertyEditor.supportsCustomEditor()) {
                 propertyEditor = createWrapperEditor(propertyEditor, descriptor);
 
@@ -287,20 +292,15 @@ public class GenericTestBeanCustomizer e
         boolean notOther = notOther(descriptor);
 
         PropertyEditor guiEditor;
-        Object guiType = descriptor.getValue(GUITYPE);
-        if (guiType instanceof GuiEditor) {
-            guiEditor = ((GuiEditor) guiType).getInstance(descriptor);            
+        if (notNull && tags == null) {
+            guiEditor = new FieldStringEditor();
         } else {
-            if (notNull && tags == null) {
-                guiEditor = new FieldStringEditor();
-            } else {
-                ComboStringEditor e = new ComboStringEditor();
-                e.setNoUndefined(notNull);
-                e.setNoEdit(notExpression && notOther);
-                e.setTags(tags);
-    
-                guiEditor = e;
-            }
+            ComboStringEditor e = new ComboStringEditor();
+            e.setNoUndefined(notNull);
+            e.setNoEdit(notExpression && notOther);
+            e.setTags(tags);
+
+            guiEditor = e;
         }
 
         WrapperEditor wrapper = new WrapperEditor(typeEditor, guiEditor,



Mime
View raw message