| Chunk |
|---|
| Conflicting content |
|---|
assertEquals(-1, url.getPort());
}
<<<<<<< HEAD
/**
* Android's URL.equals() works as if the network is down. This is different
* from the RI, which does potentially slow and inconsistent DNS lookups in
* URL.equals.
*/
public void testEqualsDoesNotDoHostnameResolution() throws Exception {
for (InetAddress inetAddress : InetAddress.getAllByName("localhost")) {
String address = inetAddress.getHostAddress();
if (inetAddress instanceof Inet6Address) {
address = "[" + address + "]";
}
URL urlByHostName = new URL("http://localhost/foo?bar=baz#quux");
URL urlByAddress = new URL("http://" + address + "/foo?bar=baz#quux");
assertFalse("Expected " + urlByHostName + " to not equal " + urlByAddress,
urlByHostName.equals(urlByAddress));
}
}
public void testEqualsCaseMapping() throws Exception {
assertEquals(new URL("HTTP://localhost/foo?bar=baz#quux"),
new URL("HTTP://localhost/foo?bar=baz#quux"));
assertTrue(new URL("http://localhost/foo?bar=baz#quux").equals(
new URL("http://LOCALHOST/foo?bar=baz#quux")));
assertFalse(new URL("http://localhost/foo?bar=baz#quux").equals(
new URL("http://localhost/FOO?bar=baz#quux")));
assertFalse(new URL("http://localhost/foo?bar=baz#quux").equals(
new URL("http://localhost/foo?BAR=BAZ#quux")));
assertFalse(new URL("http://localhost/foo?bar=baz#quux").equals(
new URL("http://localhost/foo?bar=baz#QUUX")));
=======
public void testEqualsWithNullHost() throws Exception {
assertFalse(new URL("file", null, -1, "/a/").equals(new URL("file:/a/")));
assertFalse(new URL("http", null, 80, "/a/").equals(new URL("http:/a/")));
>>>>>>> 6dfa1ea0c5ba920ad12a2f0dbd051c89860e8eac
}
} |
| Solution content |
|---|
assertEquals(-1, url.getPort());
}
/**
* Android's URL.equals() works as if the network is down. This is different
* from the RI, which does potentially slow and inconsistent DNS lookups in
* URL.equals.
*/
public void testEqualsDoesNotDoHostnameResolution() throws Exception {
for (InetAddress inetAddress : InetAddress.getAllByName("localhost")) {
String address = inetAddress.getHostAddress();
if (inetAddress instanceof Inet6Address) {
address = "[" + address + "]";
}
URL urlByHostName = new URL("http://localhost/foo?bar=baz#quux");
URL urlByAddress = new URL("http://" + address + "/foo?bar=baz#quux");
assertFalse("Expected " + urlByHostName + " to not equal " + urlByAddress,
urlByHostName.equals(urlByAddress));
}
}
public void testEqualsCaseMapping() throws Exception {
assertEquals(new URL("HTTP://localhost/foo?bar=baz#quux"),
new URL("HTTP://localhost/foo?bar=baz#quux"));
assertTrue(new URL("http://localhost/foo?bar=baz#quux").equals(
new URL("http://LOCALHOST/foo?bar=baz#quux")));
assertFalse(new URL("http://localhost/foo?bar=baz#quux").equals(
new URL("http://localhost/FOO?bar=baz#quux")));
assertFalse(new URL("http://localhost/foo?bar=baz#quux").equals(
new URL("http://localhost/foo?BAR=BAZ#quux")));
assertFalse(new URL("http://localhost/foo?bar=baz#quux").equals(
new URL("http://localhost/foo?bar=baz#QUUX")));
}
public void testEqualsWithNullHost() throws Exception {
assertFalse(new URL("file", null, -1, "/a/").equals(new URL("file:/a/")));
assertFalse(new URL("http", null, 80, "/a/").equals(new URL("http:/a/")));
}
} |
| File |
|---|
| URLTest.java |
| Developer's decision |
|---|
| Concatenation |
| Kind of conflict |
|---|
| Comment |
| Method declaration |
| Method invocation |
| Method signature |