< prev index next >

src/java.base/share/classes/sun/nio/ch/MembershipKeyImpl.java

Print this page
rev 57536 : [mq]: Cleanup

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2020, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -61,10 +61,14 @@
         this.group = group;
         this.interf = interf;
         this.source = source;
     }
 
+    int interfaceIndex() {
+        return interf.getIndex();
+    }
+
     /**
      * MembershipKey will additional context for IPv4 membership
      */
     static class Type4 extends MembershipKeyImpl {
         private final int groupAddress;

@@ -101,35 +105,28 @@
     /**
      * MembershipKey will additional context for IPv6 membership
      */
     static class Type6 extends MembershipKeyImpl {
         private final byte[] groupAddress;
-        private final int index;
         private final byte[] sourceAddress;
 
         Type6(MulticastChannel ch,
               InetAddress group,
               NetworkInterface interf,
               InetAddress source,
               byte[] groupAddress,
-              int index,
               byte[] sourceAddress)
         {
             super(ch, group, interf, source);
             this.groupAddress = groupAddress;
-            this.index = index;
             this.sourceAddress = sourceAddress;
         }
 
         byte[] groupAddress() {
             return groupAddress;
         }
 
-        int index() {
-            return index;
-        }
-
         byte[] source() {
             return sourceAddress;
         }
     }
 
< prev index next >