harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r417012 - in /incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang: Boolean.java Byte.java Character.java Double.java Enum.java Float.java Integer.java Long.java Short.java ThreadLocal.java Void.java
Date Sun, 25 Jun 2006 11:29:49 GMT
Author: ndbeyer
Date: Sun Jun 25 04:29:49 2006
New Revision: 417012

URL: http://svn.apache.org/viewvc?rev=417012&view=rev
Log:
Add SuppressWarnings annotations.

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Boolean.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Byte.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Character.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Double.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Enum.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Float.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Integer.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Long.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Short.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/ThreadLocal.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Void.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Boolean.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Boolean.java?rev=417012&r1=417011&r2=417012&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Boolean.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Boolean.java
Sun Jun 25 04:29:49 2006
@@ -33,8 +33,9 @@
 	/**
      * The java.lang.Class that represents this class.
      */
-    public static final Class<Boolean> TYPE = (Class<Boolean>)new boolean[0].getClass()
-            .getComponentType();
+    @SuppressWarnings("unchecked")
+    public static final Class<Boolean> TYPE = (Class<Boolean>) new boolean[0]
+            .getClass().getComponentType();
 
 	// Note: This can't be set to "boolean.class", since *that* is
 	// defined to be "java.lang.Boolean.TYPE";

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Byte.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Byte.java?rev=417012&r1=417011&r2=417012&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Byte.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Byte.java
Sun Jun 25 04:29:49 2006
@@ -54,7 +54,8 @@
 	/**
 	 * The java.lang.Class that represents this class.
 	 */
-	public static final Class<Byte> TYPE = (Class<Byte>) new byte[0].getClass()
+    @SuppressWarnings("unchecked")
+    public static final Class<Byte> TYPE = (Class<Byte>) new byte[0].getClass()
             .getComponentType();
 
 	// Note: This can't be set to "byte.class", since *that* is

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Character.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Character.java?rev=417012&r1=417011&r2=417012&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Character.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Character.java
Sun Jun 25 04:29:49 2006
@@ -82,10 +82,10 @@
 	public static final int MAX_RADIX = 36;
 
 	/**
-	 * The maximum possible radix used for conversions between Characters and
-	 * integers.
+	 * The <code>char</code> {@link Class} object.
 	 */
-	public static final Class<Character> TYPE = (Class<Character>) new char[0]
+    @SuppressWarnings("unchecked")
+    public static final Class<Character> TYPE = (Class<Character>) new char[0]
             .getClass().getComponentType();
 
 	// Note: This can't be set to "char.class", since *that* is

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Double.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Double.java?rev=417012&r1=417011&r2=417012&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Double.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Double.java
Sun Jun 25 04:29:49 2006
@@ -73,8 +73,9 @@
 	 * The java.lang.Class that represents this class.
      * @since 1.1
 	 */
-	public static final Class<Double> TYPE = (Class<Double>) new double[0].getClass()
-			.getComponentType();
+    @SuppressWarnings("unchecked")
+    public static final Class<Double> TYPE = (Class<Double>) new double[0]
+            .getClass().getComponentType();
 
 	// Note: This can't be set to "double.class", since *that* is
 	// defined to be "java.lang.Double.TYPE";

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Enum.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Enum.java?rev=417012&r1=417011&r2=417012&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Enum.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Enum.java
Sun Jun 25 04:29:49 2006
@@ -130,13 +130,14 @@
      * 
      * @return the class object representing the constant's enum type.
      */
+    @SuppressWarnings("unchecked")
     public final Class<E> getDeclaringClass() {
-        Class myClass = getClass();
-        Class mySuperClass = myClass.getSuperclass();
+        Class<?> myClass = getClass();
+        Class<?> mySuperClass = myClass.getSuperclass();
         if (Enum.class == mySuperClass) {
-            return myClass;
+            return (Class<E>)myClass;
         }
-        return mySuperClass;
+        return (Class<E>)mySuperClass;
     }
 
     /**
@@ -179,6 +180,7 @@
      * Helper to invoke the values() static method on T and answer the result.
      * Returns null if there is a problem.
      */
+    @SuppressWarnings("unchecked")
     static <T extends Enum<T>> T[] getValues(final Class<T> enumType) {
         try {
             Method values = AccessController

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Float.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Float.java?rev=417012&r1=417011&r2=417012&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Float.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Float.java
Sun Jun 25 04:29:49 2006
@@ -72,7 +72,8 @@
 	 * The java.lang.Class that represents this class.
      * @since 1.1
 	 */
-	public static final Class<Float> TYPE = (Class<Float>) new float[0]
+    @SuppressWarnings("unchecked")
+    public static final Class<Float> TYPE = (Class<Float>) new float[0]
             .getClass().getComponentType();
 
 	// Note: This can't be set to "float.class", since *that* is

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Integer.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Integer.java?rev=417012&r1=417011&r2=417012&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Integer.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Integer.java
Sun Jun 25 04:29:49 2006
@@ -66,7 +66,8 @@
 	/**
 	 * The java.lang.Class that represents this class.
 	 */
-	public static final Class<Integer> TYPE = (Class<Integer>) new int[0]
+    @SuppressWarnings("unchecked")
+    public static final Class<Integer> TYPE = (Class<Integer>) new int[0]
             .getClass().getComponentType();
 
 	// Note: This can't be set to "int.class", since *that* is

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Long.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Long.java?rev=417012&r1=417011&r2=417012&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Long.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Long.java
Sun Jun 25 04:29:49 2006
@@ -56,7 +56,8 @@
 	/**
 	 * The java.lang.Class that represents this class.
 	 */
-	public static final Class<Long> TYPE = (Class<Long>) new long[0].getClass()
+    @SuppressWarnings("unchecked")
+    public static final Class<Long> TYPE = (Class<Long>) new long[0].getClass()
             .getComponentType();
 
 	// Note: This can't be set to "long.class", since *that* is

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Short.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Short.java?rev=417012&r1=417011&r2=417012&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Short.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Short.java
Sun Jun 25 04:29:49 2006
@@ -59,7 +59,8 @@
 	/**
 	 * The java.lang.Class that represents this class.
 	 */
-	public static final Class<Short> TYPE = (Class<Short>) new short[0]
+    @SuppressWarnings("unchecked")
+    public static final Class<Short> TYPE = (Class<Short>) new short[0]
             .getClass().getComponentType();
 
 	// Note: This can't be set to "short.class", since *that* is

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/ThreadLocal.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/ThreadLocal.java?rev=417012&r1=417011&r2=417012&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/ThreadLocal.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/ThreadLocal.java
Sun Jun 25 04:29:49 2006
@@ -35,6 +35,7 @@
 	 * Return the value of this variable under
 	 * <code>Thread.currentThread()</code>
 	 */
+    @SuppressWarnings("unchecked")
 	public T get() {
 		return (T)Thread.currentThread().getThreadLocal(this);
 	}

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Void.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Void.java?rev=417012&r1=417011&r2=417012&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Void.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Void.java
Sun Jun 25 04:29:49 2006
@@ -27,11 +27,13 @@
      * The {@link Class} instance that represents primitive type
      * <code>void</code>.
      */
-    public static final Class<Void> TYPE;
-	// Note: This can't be set to "void.class", since *that* is
-	// defined to be "java.lang.Void.TYPE";
+    public static final Class<Void> TYPE = lookupType();
 
-	static {
+    // Note: This can't be set to "void.class", since *that* is
+    // defined to be "java.lang.Void.TYPE";
+
+    @SuppressWarnings("unchecked")
+    private static Class<Void> lookupType() {
         Class<?> voidType = null;
         try {
             Method method = Runnable.class.getMethod("run", new Class[0]);
@@ -39,7 +41,7 @@
         } catch (Exception e) {
             throw new RuntimeException(e);
         }
-        TYPE = (Class<Void>) voidType;
+        return (Class<Void>) voidType;
     }
 
 	private Void() {



Mime
View raw message