Here are the two remaining methods.
2006-07-19 Sven de Marothy <[EMAIL PROTECTED]>
* java/net/Inet6Address.java:
(getScopedId, getScopedInterface): New methods.
On Wed, 2006-07-19 at 15:40 +0200, Sven de Marothy wrote:
> On Tue, 2006-07-18 at 09:53 -0600, Tom Tromey wrote:
> > >>>>> "Sven" == Sven de Marothy <[EMAIL PROTECTED]> writes:
> >
> > Sven> + * @status Updated to 1.5. Serialization compatibility is tested.
> >
> > According to JAPI it looks as though we're still missing a couple
> > methods: getScopeId and getScopedInterface.
>
> Ah right. :) I'd implemented this and accidentally deleted it and had to
> do it all again. I must've forgotten them the second time around.
>
> No problem, it's a trivial fix.
>
> /Sven
>
>
--
Sven de Marothy <[EMAIL PROTECTED]>
Index: java/net/Inet6Address.java
===================================================================
RCS file: /sources/classpath/classpath/java/net/Inet6Address.java,v
retrieving revision 1.12
diff -U3 -r1.12 Inet6Address.java
--- java/net/Inet6Address.java 18 Jul 2006 02:58:14 -0000 1.12
+++ java/net/Inet6Address.java 19 Jul 2006 16:19:44 -0000
@@ -242,6 +242,7 @@
* Creates a scoped Inet6Address where the scope has an integer id.
*
* @throws UnkownHostException if the address is an invalid number of bytes.
+ * @since 1.5
*/
public static Inet6Address getByAddress(String host, byte[] addr,
int scopeId)
@@ -261,6 +262,7 @@
* NetworkInterface.
*
* @throws UnkownHostException if the address is an invalid number of bytes.
+ * @since 1.5
*/
public static Inet6Address getByAddress(String host, byte[] addr,
NetworkInterface nif)
@@ -276,6 +278,36 @@
}
/**
+ * Returns the <code>NetworkInterface</code> of the address scope
+ * if it is a scoped address and the scope is given in the form of a
+ * NetworkInterface.
+ * (I.e. the address was created using the
+ * getByAddress(String, byte[], NetworkInterface) method)
+ * Otherwise this method returns <code>null</code>.
+ * @since 1.5
+ */
+ public NetworkInterface getScopedInterface()
+ {
+ return nif;
+ }
+
+ /**
+ * Returns the scope ID of the address scope if it is a scoped adress using
+ * an integer to identify the scope.
+ *
+ * Otherwise this method returns 0.
+ * @since 1.5
+ */
+ public int getScopeId()
+ {
+ // check scope_id_set because some JDK-serialized objects seem to have
+ // scope_id set to a nonzero value even when scope_id_set == false
+ if( scope_id_set )
+ return scope_id;
+ return 0;
+ }
+
+ /**
* Returns the IP address string in textual presentation
*/
public String getHostAddress()