From a1906e8bbfa426ed1adfe751608bc74f1d4d2ab7 Mon Sep 17 00:00:00 2001 From: Matthias Klose Date: Wed, 19 Dec 2012 17:03:15 +0000 Subject: Import GNU Classpath (20121202). 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. From-SVN: r194618 --- libjava/classpath/java/lang/Short.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'libjava/classpath/java/lang/Short.java') diff --git a/libjava/classpath/java/lang/Short.java b/libjava/classpath/java/lang/Short.java index ec87f933e93..fae9fe7635b 100644 --- a/libjava/classpath/java/lang/Short.java +++ b/libjava/classpath/java/lang/Short.java @@ -372,6 +372,23 @@ public final class Short extends Number implements Comparable return value - s.value; } + /** + * Compares two unboxed short values. + * The result is positive if the first is greater, negative if the second + * is greater, and 0 if the two are equal. + * + * @param x First value to compare. + * @param y Second value to compare. + * + * @return positive int if the first value is greater, negative if the second + * is greater, and 0 if the two are equal. + * @since 1.7 + */ + public static int compare(short x, short y) + { + return Short.valueOf(x).compareTo(Short.valueOf(y)); + } + /** * Reverse the bytes in val. * @since 1.5 -- cgit v1.2.1