Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1209)

Unified Diff: mojo/public/java/src/org/chromium/mojo/system/Pair.java

Issue 250773005: Adding mojo_test_apk in the fyi waterfall. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix instrumentation issue. Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/mojo.gyp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/java/src/org/chromium/mojo/system/Pair.java
diff --git a/mojo/public/java/src/org/chromium/mojo/system/Pair.java b/mojo/public/java/src/org/chromium/mojo/system/Pair.java
index c302aed680819645064e4cbdd94eb02e1fd52895..2ead0204f9c0a9ab95961e73b0cc9f6b1a56ca28 100644
--- a/mojo/public/java/src/org/chromium/mojo/system/Pair.java
+++ b/mojo/public/java/src/org/chromium/mojo/system/Pair.java
@@ -4,7 +4,6 @@
package org.chromium.mojo.system;
-import java.util.Objects;
/**
* A pair of object.
@@ -29,6 +28,13 @@ public class Pair<F, S> {
}
/**
+ * equals() that handles null values.
+ */
+ private boolean equals(Object o1, Object o2) {
+ return o1 == null ? o2 == null : o1.equals(o2);
+ }
+
+ /**
* @see Object#equals(Object)
*/
@Override
@@ -37,7 +43,7 @@ public class Pair<F, S> {
return false;
}
Pair<?, ?> p = (Pair<?, ?>) o;
- return Objects.equals(p.first, first) && Objects.equals(p.second, second);
+ return equals(first, p.first) && equals(second, p.second);
}
/**
@@ -55,7 +61,7 @@ public class Pair<F, S> {
* @param b the second element of the pair.
* @return the pair containing a and b.
*/
- public static <A, B, C extends A, D extends B> Pair<A, B> create(C a, D b) {
+ public static <A, B> Pair<A, B> create(A a, B b) {
return new Pair<A, B>(a, b);
}
}
« no previous file with comments | « mojo/mojo.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698