[GLASSFISH-18419] Inspect JDK 7 getMethods()/getDeclaredMethods() usage Created: 28/Feb/12  Updated: 20/Dec/16  Resolved: 21/Feb/13

Status: Closed
Project: glassfish
Component/s: rest-interface
Affects Version/s: 4.0_dev
Fix Version/s: None

Type: Task Priority: Major
Reporter: Joe Di Pol Assignee: Jason Lee
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
is related to GLASSFISH-19417 ReST resource fails randomly Closed


Recent JDK 7 releases have altered the order of methods returned by the
Class.getMethods() and Class.getDeclaredMethods() calls. The order is
no longer stable and can change from one JVM run to the next.

This caused a number of sporadic bugs to appear during 3.1.2 development
when running with JDK 7. Those have been fixed, but further inspection
of the source has found a number of cases where we use getMethods() and

Each of these cases should be visually inspected to see if the code is
making any assumptions on the order of methods returned by get*Methods().
In particular it should handle the case of multiple methods having the
same name.

For more details on what to look for and how to fix it see this document:


Please inspect the following files for their use of getMethods() /
getDeclaredMethods() to ensure the code is not making any assumptions
with respect to the order of methods returned. Create bugs for
any issues that need to be fixed and link them to this task. Once you
have completed inspection update this task with status and close it.

Admin Console Common
GlassFish Admin REST Service
PaaS Console Plugin System
PaaS Console Web App

Comment by Anissa Lam [ 12/Feb/13 ]

I checked the JSONUtil.java under Admin Console Common, its not relying on the ordered returned by getMethods().

The PaaS console mentioned above is not part of the source code now.

Jason will have to look at those under Admin REST Service.
I am changing the component to rest-interface.

Comment by Jason Lee [ 21/Feb/13 ]

The REST interface does not depend on any specific order in the data returned from either of these methods.

Generated at Tue Apr 25 11:29:15 UTC 2017 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.