FULL PRODUCT VERSION :
Java 7u2
A DESCRIPTION OF THE PROBLEM :
Bad performance when a bean method from the PropertyDescriptor is invoked.
see https://forums.oracle.com/forums/thread.jspa?forumID=933&threadID=2322123
REGRESSION. Last worked in version 6u29
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Execute the provided test case - with Java 6 it takes around 100ms with Java 7 around 5000ms.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Execution time around 100ms
ACTUAL -
Execution time around 5000ms
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.beans.PropertyDescriptor;
import javax.swing.JComponent;
import javax.swing.JPanel;
public class PropertyDescriptorTest
{
public static void main(String[] args)
{
JComponent c = new JPanel();
String name = "name";
long start = System.currentTimeMillis();
try
{
for (int i=0; i<1000; i++)
new PropertyDescriptor(name, c.getClass()).getReadMethod().invoke(c);
}
catch (Exception e)
{
e.printStackTrace();
}
long stop = System.currentTimeMillis();
System.err.println(stop-start);
}
}
---------- END SOURCE ----------