You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Kevin Zhou (JIRA)" <ji...@apache.org> on 2009/04/24 12:24:30 UTC
[jira] Updated: (HARMONY-6177) [classlib][beans]
java.beans.PropertyDescriptor(String propertyName, Class> beanClass,
String getterName, String setterName) sets the wrong write method
[ https://issues.apache.org/jira/browse/HARMONY-6177?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Kevin Zhou updated HARMONY-6177:
--------------------------------
Attachment: HARMONY-6177.diff
I have a patch to fix this defect. Would you please help to try it?
> [classlib][beans] java.beans.PropertyDescriptor(String propertyName, Class<?> beanClass, String getterName, String setterName) sets the wrong write method
> ----------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-6177
> URL: https://issues.apache.org/jira/browse/HARMONY-6177
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Affects Versions: 5.0M9
> Reporter: Kevin Zhou
> Fix For: 5.0M10
>
> Attachments: HARMONY-6177.diff
>
> Original Estimate: 48h
> Remaining Estimate: 48h
>
> Given a test case [1], RI passes it while HY fails.
> The MockJSplitPane class extends javax.swing.JSplitPane and overwrite its setDividerLocation(int) method.
> The test case creates a java.beans.PropertyDescriptor object using "dividerLocation" propertyName, null read method, and "setDividerLocation" write method.
> Then, RI returns the correct method:
> "public void PropertyDescriptorTest$MockJSplitPane.setDividerLocation(int)"
> but HY returns a homony method but from its super class:
> "public void javax.swing.JSplitPane.setDividerLocation(double)"
> [1] Test Case:
> class MockJSplitPane extends javax.swing.JSplitPane {
> private static final long serialVersionUID = 3109235561744543400L;
> public void setDividerLocation(int dividerLocation) { super.setDividerLocation(dividerLocation); }
> }
> public void test_setWriteMethod_MockJSplitPane() throws Exception {
> Class<?> beanClass = MockJSplitPane.class;
> String propertyName = "dividerLocation";
> String setterName = "setDividerLocation";
> PropertyDescriptor pd = new PropertyDescriptor(propertyName, beanClass, null, setterName);
> assertEquals(propertyName, pd.getName());
> assertNull(pd.getReadMethod());
> Method expectedMethod = beanClass.getMethod(setterName, new Class[] { int.class });
> assertEquals(expectedMethod, pd.getWriteMethod());
> }
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.