Author: dmitri Date: Sat Oct 29 12:11:37 2005 New Revision: 329470 URL: http://svn.apache.org/viewcvs?rev=329470&view=rev Log: Fixed a synchronization issue described in this bug report:
http://issues.apache.org/bugzilla/show_bug.cgi?id=34552 Modified: jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/JXPathBasicBeanInfo.java Modified: jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/JXPathBasicBeanInfo.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/JXPathBasicBeanInfo.java?rev=329470&r1=329469&r2=329470&view=diff ============================================================================== --- jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/JXPathBasicBeanInfo.java (original) +++ jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/JXPathBasicBeanInfo.java Sat Oct 29 12:11:37 2005 @@ -80,14 +80,15 @@ bi = Introspector.getBeanInfo(clazz, Object.class); } PropertyDescriptor[] pds = bi.getPropertyDescriptors(); - propertyDescriptors = new PropertyDescriptor[pds.length]; - System.arraycopy(pds, 0, propertyDescriptors, 0, pds.length); - Arrays.sort(propertyDescriptors, new Comparator() { + PropertyDescriptor[] descriptors = new PropertyDescriptor[pds.length]; + System.arraycopy(pds, 0, descriptors, 0, pds.length); + Arrays.sort(descriptors, new Comparator() { public int compare(Object left, Object right) { return ((PropertyDescriptor) left).getName().compareTo( ((PropertyDescriptor) right).getName()); } }); + propertyDescriptors = descriptors; } catch (IntrospectionException ex) { ex.printStackTrace(); @@ -99,10 +100,11 @@ public PropertyDescriptor getPropertyDescriptor(String propertyName) { if (propertyNames == null) { PropertyDescriptor[] pds = getPropertyDescriptors(); - propertyNames = new String[pds.length]; + String[] names = new String[pds.length]; for (int i = 0; i < pds.length; i++) { - propertyNames[i] = pds[i].getName(); + names[i] = pds[i].getName(); } + propertyNames = names; } for (int i = 0; i < propertyNames.length; i++) { --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]