You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jmeter.apache.org by se...@apache.org on 2012/01/03 18:08:12 UTC

svn commit: r1226870 - /jmeter/trunk/src/core/org/apache/jmeter/testbeans/gui/GenericTestBeanCustomizer.java

Author: sebb
Date: Tue Jan  3 17:08:11 2012
New Revision: 1226870

URL: http://svn.apache.org/viewvc?rev=1226870&view=rev
Log:
Make inner class static to simplify serialisation (Findbugs)

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=1226870&r1=1226869&r2=1226870&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 Tue Jan  3 17:08:11 2012
@@ -199,7 +199,7 @@ public class GenericTestBeanCustomizer e
 
         // Get and sort the property descriptors:
         descriptors = beanInfo.getPropertyDescriptors();
-        Arrays.sort(descriptors, new PropertyComparator());
+        Arrays.sort(descriptors, new PropertyComparator(beanInfo));
 
         // Obtain the propertyEditors:
         editors = new PropertyEditor[descriptors.length];
@@ -605,7 +605,7 @@ public class GenericTestBeanCustomizer e
      * @param descriptor
      * @return the group String.
      */
-    private String group(PropertyDescriptor d) {
+    private static String group(PropertyDescriptor d) {
         String group = (String) d.getValue(GROUP);
         if (group == null){
             group = DEFAULT_GROUP;
@@ -631,9 +631,14 @@ public class GenericTestBeanCustomizer e
     /**
      * Comparator used to sort properties for presentation in the GUI.
      */
-    private class PropertyComparator implements Comparator<PropertyDescriptor>, Serializable {
+    private static class PropertyComparator implements Comparator<PropertyDescriptor>, Serializable {
         private static final long serialVersionUID = 240L;
 
+        private final BeanInfo beanInfo;
+        public PropertyComparator(BeanInfo beanInfo) {
+            this.beanInfo = beanInfo;
+        }
+
         public int compare(PropertyDescriptor d1, PropertyDescriptor d2) {
             int result;