yangxu998 / guava-libraries

Automatically exported from code.google.com/p/guava-libraries
Apache License 2.0
0 stars 0 forks source link

InetAddresses.toUriString() have to strip scopeid for ipv6 #646

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.
        Enumeration<NetworkInterface>  interfaces
                = NetworkInterface.getNetworkInterfaces();
        while(interfaces.hasMoreElements()) {
            NetworkInterface iface = interfaces.nextElement();
            if( !iface.isUp() )
                continue;
            Enumeration<InetAddress> ifaceAddresses = iface.getInetAddresses();
            while(ifaceAddresses.hasMoreElements()) {
                InetAddress ip = ifaceAddresses.nextElement();
                System.out.println(toUriString(ip));
            }
        }
2.
3.

What is the expected output? What do you see instead?
expected: [2001:638:700:20b9:0:0:1:44]
see: [2001:638:700:20b9:0:0:1:44%2]

What version of the product are you using? On what operating system?
r09, trunk have the same issue.

Please provide any additional information below.

fix attached.

Original issue reported on code.google.com by kofem...@gmail.com on 14 Jun 2011 at 5:07

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks.

Original comment by cpov...@google.com on 22 Jun 2011 at 10:24

GoogleCodeExporter commented 9 years ago

Original comment by cpov...@google.com on 13 Jul 2011 at 6:10

GoogleCodeExporter commented 9 years ago

Original comment by kevinb@google.com on 13 Jul 2011 at 6:18

GoogleCodeExporter commented 9 years ago

Original comment by kevinb@google.com on 13 Jul 2011 at 6:39

GoogleCodeExporter commented 9 years ago
Recent changes to that class may fix this. If not please reopen with additional 
details.

Original comment by fry@google.com on 27 Jul 2011 at 6:07

GoogleCodeExporter commented 9 years ago
This issue has been migrated to GitHub.

It can be found at https://github.com/google/guava/issues/<id>

Original comment by cgdecker@google.com on 1 Nov 2014 at 4:15

GoogleCodeExporter commented 9 years ago

Original comment by cgdecker@google.com on 3 Nov 2014 at 9:09