hg: jdk7/jsn/jdk: 6717876: Make java.net.NetworkInterface.getIndex() public
Andrew John Hughes
gnu_andrew at member.fsf.org
Wed Aug 27 14:37:47 PDT 2008
On 27/08/2008, Mark Wielaard <mark at klomp.org> wrote:
> On Mon, Aug 25, 2008 at 12:43:59PM +0000, jean-christophe.collet at sun.com wrote:
> > URL: http://hg.openjdk.java.net/jdk7/jsn/jdk/rev/f4289d75cd29
> > 6717876: Make java.net.NetworkInterface.getIndex() public
> > Summary: Make getIndex() and getByIndex() public. Required a name change in native code
> > Reviewed-by: alanb, chegar, michaelm
> This seems to introduce a new public API in the java.net package.
> I was wondering how that works for someone that wants to introduce
> such things in openjdk. I do see the bug report that mentions making
> this public should be done for JDK7. But there seems to missing a real
> justification for adding these new interfaces. Is there any policy for
> introducing such new public interfaces?
> I might be reading this wrongly but it seems the only thing this API
> does is expose some random internal "index" numbers for an
> NetworkInterface. Seeing that there are no guarantees on whether there
> are index numbers in the first place for any or all interfaces it seems
> not that useful imho. An example of how an application would use this
> new interface would be nice to get a better idea in what situations
> this would be used.
I also thought the change was odd, given it adds two methods based on
otherwise undefined 'system specific' values. From the methods given,
there is no information as to how many of these index numbers are in
use. The only way I can see to enumerate them is to get all instances
of NetworkInterface and call getIndex() on each. I assume that the
application of these methods is to resolve ambiguity between two
interfaces with the same name but a different index, but it would be
more helpful if the Javadoc included example usage and some
information on what these numbers might be.
More generally, it's not clear where the decision was made to make
this part of the (as yet non-existent) JDK7 platform JSR. Will there
be more insight into this process from outside Sun in the near future?
Support Free Java!
Contribute to GNU Classpath and the OpenJDK
PGP Key: 94EFD9D8 (http://subkeys.pgp.net)
Fingerprint: F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8
More information about the net-dev