Fix a few of our FindBugs "high" warnings.

RuleBasedBreakIterator was breaking the equals/hashCode contract.

Various classes were calling toString on arrays, which isn't very useful.

GregorianCalendar was missing a null/instanceof check. (FindBugs complained about
the former, but the super.equals would actually take care of that. The lack of
the explicit "instanceof" did mean that we could throw ClassCastException if you
had a Calendar that wasn't a GregorianCalendar, though. [Not easily testable,
and I hope we'll replace our calendars with ICU4J's before we actually have
another Calendar subclass.])

Collator's cache was broken, but luckily never had anything inserted into it
anyway.
diff --git a/icu/src/main/java/com/ibm/icu4jni/text/RuleBasedBreakIterator.java b/icu/src/main/java/com/ibm/icu4jni/text/RuleBasedBreakIterator.java
index 4d38f2b..e532ac4 100644
--- a/icu/src/main/java/com/ibm/icu4jni/text/RuleBasedBreakIterator.java
+++ b/icu/src/main/java/com/ibm/icu4jni/text/RuleBasedBreakIterator.java
@@ -58,7 +58,12 @@
         
         return result && iter.equals(this.charIter);
     }
-    
+
+    @Override
+    public int hashCode() {
+        return 42; // No-one uses RuleBasedBreakIterator as a hash key.
+    }
+
     @Override
     public int current() {
         return NativeBreakIterator.currentImpl(this.addr);
diff --git a/icu/src/main/java/com/ibm/icu4jni/util/LocaleData.java b/icu/src/main/java/com/ibm/icu4jni/util/LocaleData.java
index 24d3323..87f9bc2 100644
--- a/icu/src/main/java/com/ibm/icu4jni/util/LocaleData.java
+++ b/icu/src/main/java/com/ibm/icu4jni/util/LocaleData.java
@@ -17,6 +17,7 @@
 package com.ibm.icu4jni.util;
 
 import java.text.DateFormat;
+import java.util.Arrays;
 
 /**
  * Passes locale-specific from ICU native code to Java.
@@ -66,12 +67,12 @@
         return "LocaleData[" +
                 "firstDayOfWeek=" + firstDayOfWeek + "," +
                 "minimalDaysInFirstWeek=" + minimalDaysInFirstWeek + "," +
-                "amPm=" + amPm + "," +
-                "eras=" + eras + "," +
-                "longMonthNames=" + longMonthNames + "," +
-                "shortMonthNames=" + shortMonthNames + "," +
-                "longWeekdayNames=" + longWeekdayNames + "," +
-                "shortWeekdayNames=" + shortWeekdayNames + "," +
+                "amPm=" + Arrays.toString(amPm) + "," +
+                "eras=" + Arrays.toString(eras) + "," +
+                "longMonthNames=" + Arrays.toString(longMonthNames) + "," +
+                "shortMonthNames=" + Arrays.toString(shortMonthNames) + "," +
+                "longWeekdayNames=" + Arrays.toString(longWeekdayNames) + "," +
+                "shortWeekdayNames=" + Arrays.toString(shortWeekdayNames) + "," +
                 "fullTimeFormat=" + fullTimeFormat + "," +
                 "longTimeFormat=" + longTimeFormat + "," +
                 "mediumTimeFormat=" + mediumTimeFormat + "," +
diff --git a/luni/src/main/java/java/util/GregorianCalendar.java b/luni/src/main/java/java/util/GregorianCalendar.java
index 6547d85..18a10ad 100644
--- a/luni/src/main/java/java/util/GregorianCalendar.java
+++ b/luni/src/main/java/java/util/GregorianCalendar.java
@@ -993,6 +993,12 @@
      */
     @Override
     public boolean equals(Object object) {
+        if (!(object instanceof GregorianCalendar)) {
+            return false;
+        }
+        if (object == this) {
+            return true;
+        }
         return super.equals(object)
                 && gregorianCutover == ((GregorianCalendar) object).gregorianCutover;
     }
diff --git a/text/src/main/java/java/text/Bidi.java b/text/src/main/java/java/text/Bidi.java
index 7939dea..9195a0f 100644
--- a/text/src/main/java/java/text/Bidi.java
+++ b/text/src/main/java/java/text/Bidi.java
@@ -641,8 +641,8 @@
     public String toString() {
         // BEGIN android-changed
         return super.toString()
-                + "[direction: " + direction + " baselevel: " + baseLevel //$NON-NLS-1$ //$NON-NLS-2$
-                + " length: " + length + " runs: " + (unidirectional ? "null" : runs.toString()) + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+                + "[direction: " + direction + " baseLevel: " + baseLevel
+                + " length: " + length + " runs: " + Arrays.toString(runs) + "]";
         // END android-changed
     }
 }
diff --git a/text/src/main/java/java/text/Collator.java b/text/src/main/java/java/text/Collator.java
index e954b8b..f324231 100644
--- a/text/src/main/java/java/text/Collator.java
+++ b/text/src/main/java/java/text/Collator.java
@@ -157,29 +157,6 @@
      */
     public static final int IDENTICAL = 3;
 
-    private static int CACHE_SIZE;
-
-    static {
-        // CACHE_SIZE includes key and value, so needs to be double
-        String cacheSize = AccessController
-                .doPrivileged(new PrivilegedAction<String>() {
-                    public String run() {
-                        return System.getProperty("collator.cache"); //$NON-NLS-1$
-                    }
-                });
-        if (cacheSize != null) {
-            try {
-                CACHE_SIZE = Integer.parseInt(cacheSize);
-            } catch (NumberFormatException e) {
-                CACHE_SIZE = 6;
-            }
-        } else {
-            CACHE_SIZE = 6;
-        }
-    }
-
-    private static Vector<Collator> cache = new Vector<Collator>(CACHE_SIZE);
-
     // Wrapper class of ICU4JNI Collator
     com.ibm.icu4jni.text.Collator icuColl;
 
@@ -332,15 +309,9 @@
      * @return the collator for {@code locale}.
      */
     public static Collator getInstance(Locale locale) {
-        String key = locale.toString();
-        for (int i = cache.size() - 1; i >= 0; i -= 2) {
-            if (cache.elementAt(i).equals(key)) {
-                return (Collator) (cache.elementAt(i - 1)).clone();
-            }
-        }
-
-        return new RuleBasedCollator(com.ibm.icu4jni.text.Collator
-                .getInstance(locale));
+        // BEGIN android-changed: removed non-functional cache.
+        return new RuleBasedCollator(com.ibm.icu4jni.text.Collator.getInstance(locale));
+        // END android-changed
     }
 
     /**