| Article: |
Subverting Java Access Protection for Unit Testing | |
| Subject: | reason for getDeclaredFields() | |
| Date: | 2009-02-19 09:29:16 | |
| From: | mgobeil | |
|
I disagree with "The reason for the existence of two methods (instead of a single method that returns all fields, including inherited ones) seems to be so that simple dynamic lookup of public fields can be achieved easily (using getField() and getFields()) and generally does the right thing. If a program wants to see the private fields, it will probably want to handle inherited fields specially (for example, an object-oriented debugger)."
|
||
Women in Technology
Hear us Roar
