Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 400240 - FastBeanUtility.getDeclaredPublicMethods() filter of non public methods.
Summary: FastBeanUtility.getDeclaredPublicMethods() filter of non public methods.
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Scout (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 402301
  Show dependency tree
 
Reported: 2013-02-07 12:13 EST by Jeremie Bresson CLA
Modified: 2021-08-19 11:08 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jeremie Bresson CLA 2013-02-07 12:13:10 EST
The current implementation of getDeclaredPublicMethods(Class) filter nonpublic methods by replacing them with null.

There is no indication of this behavior and this is not what a consumer of this method would expect.

For this class:

  public static class MyBean {
    public Long getId() {
      return null;
    }

    private void myMethod() {
    }

    public void setId(Long id) {
    }

  }


The expected result is
[
    public void MyBean.getId(),
    public void MyBean setId()
]

And not (current implemtation):
[
    public void MyBean.getId(),
    null,
    public void MyBean setId()
]


There is no guarantee that the SDK do not add some additional private methods. 

I had a case with a private method added by test coverage tool). The array length was no longer as expected in my test.
Comment 2 Jeremie Bresson CLA 2013-02-12 06:02:49 EST
Patch reviewed and merged by Ken Lee for 3.9.0 M6.
Comment 3 Jeremie Bresson CLA 2013-03-07 08:02:32 EST
Verified, unit test work as expected. Other unit test from bug 402301 also work when code is instrumented with additional private methods.
Comment 4 Matthias Zimmermann CLA 2013-07-08 17:25:36 EDT
Bug closed, shipped with 3.9.0 (Kepler)