Cleanup/minimize JsUtils cast usages.

PiperOrigin-RevId: 356884581
Change-Id: I625eaabfd5bea972663a909a7532bc8e1ce81522
diff --git a/user/super/com/google/gwt/emul/java/lang/String.java b/user/super/com/google/gwt/emul/java/lang/String.java
index 3aba0d3..7b4872b 100644
--- a/user/super/com/google/gwt/emul/java/lang/String.java
+++ b/user/super/com/google/gwt/emul/java/lang/String.java
@@ -376,8 +376,8 @@
   public int compareTo(String other) {
     // Trick compiler into thinking that these are double so what we could do arithmetic comparison
     // which is supported on underlying JavaScript strings.
-    double a = JsUtils.unsafeCastToDouble(checkNotNull(this));
-    double b = JsUtils.unsafeCastToDouble(checkNotNull(other));
+    double a = JsUtils.<Double>uncheckedCast(this);
+    double b = JsUtils.<Double>uncheckedCast(other);
     return a == b ? 0 : (a < b ? -1 : 1);
   }
 
diff --git a/user/super/com/google/gwt/emul/javaemul/internal/HashCodes.java b/user/super/com/google/gwt/emul/javaemul/internal/HashCodes.java
index fa7cb68..8e4bdd4 100644
--- a/user/super/com/google/gwt/emul/javaemul/internal/HashCodes.java
+++ b/user/super/com/google/gwt/emul/javaemul/internal/HashCodes.java
@@ -24,9 +24,9 @@
       case "string":
         return JsUtils.<String>uncheckedCast(o).hashCode();
       case "number":
-        return Double.hashCode(JsUtils.unsafeCastToDouble(o));
+        return JsUtils.<Double>uncheckedCast(o).hashCode();
       case "boolean":
-        return Boolean.hashCode(JsUtils.unsafeCastToBoolean(o));
+        return JsUtils.<Boolean>uncheckedCast(o).hashCode();
       default:
         return o == null ? 0 : getObjectIdentityHashCode(o);
     }