From 6fec1adc6432eeafcdea2ab165989e170cb6e64e Mon Sep 17 00:00:00 2001 From: doko Date: Wed, 19 Dec 2012 17:03:15 +0000 Subject: 2012-12-19 Matthias Klose Import GNU Classpath (20121202). * Regenerate class and header files. * Regenerate auto* files. * sources.am, gcj/javaprims.h: Regenerate. * gnu/java/nio/FileLockImpl.java (close): New override. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@194618 138bc75d-0d04-0410-961f-82ee72b054a4 --- libjava/classpath/java/lang/Boolean.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'libjava/classpath/java/lang/Boolean.java') diff --git a/libjava/classpath/java/lang/Boolean.java b/libjava/classpath/java/lang/Boolean.java index f2eaf412592..0e4afa813bf 100644 --- a/libjava/classpath/java/lang/Boolean.java +++ b/libjava/classpath/java/lang/Boolean.java @@ -236,6 +236,21 @@ public final class Boolean implements Serializable, Comparable return value == other.value ? 0 : (value ? 1 : -1); } + /** + * Compares two unboxed boolean values. + * + * @param x First value to compare. + * @param y Second value to compare. + * @return 0 if both Booleans represent the same value, a positive number + * if this Boolean represents true and the other false, and a negative + * number otherwise. + * @since 1.7 + */ + public static int compare(boolean x, boolean y) + { + return Boolean.valueOf(x).compareTo(Boolean.valueOf(y)); + } + /** * If the String argument is "true", ignoring case, return true. * Otherwise, return false. -- cgit v1.2.3