Spec update for Class#getDeclaredMethods() (original) (raw)

Rémi Forax forax at univ-mlv.fr
Thu Jul 16 12:47:14 UTC 2009


Florian Weimer a écrit :

I suggest to replace:

| The elements [methods] in the array returned are not sorted and are | not in any particular order. with: | If the class is a compiled Java class, the elements in the array are | sorted according to the order of declaration in the source code. | Otherwise, the elements are not in any particular order. There is a growing amount of code which relies on predictable method order, so backwards compatibility concerns implicitly dictate the ordering. The proposed change makes this explicit. The other reflection methods should be updated in a similar fashion

This sentences was conscientiously added between 1.1 and 1.2 and I know a small VM that returns the method using the vtable ordering for getMethod.

Your suggestion implies that potentially all VM implementors should change some parts of their VM data structures. Doesn't seem realistic, isn't it.

Rémi



More information about the core-libs-dev mailing list