commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1391003 - in /commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3: AnnotationUtils.java ArrayUtils.java ObjectUtils.java event/EventListenerSupport.java
Date Thu, 27 Sep 2012 13:34:33 GMT
Author: sebb
Date: Thu Sep 27 13:34:33 2012
New Revision: 1391003

URL: http://svn.apache.org/viewvc?rev=1391003&view=rev
Log:
Document some @SuppressWarning annotations

Modified:
    commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/AnnotationUtils.java
    commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ArrayUtils.java
    commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ObjectUtils.java
    commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/event/EventListenerSupport.java

Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/AnnotationUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/AnnotationUtils.java?rev=1391003&r1=1391002&r2=1391003&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/AnnotationUtils.java
(original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/AnnotationUtils.java
Thu Sep 27 13:34:33 2012
@@ -73,8 +73,7 @@ public class AnnotationUtils {
             Class<? extends Annotation> annotationType = null;
             for (Class<?> iface : ClassUtils.getAllInterfaces(cls)) {
                 if (Annotation.class.isAssignableFrom(iface)) {
-                    @SuppressWarnings("unchecked")
-                    //because we just checked the assignability
+                    @SuppressWarnings("unchecked") // OK because we just checked the assignability
                     Class<? extends Annotation> found = (Class<? extends Annotation>)
iface;
                     annotationType = found;
                     break;

Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ArrayUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ArrayUtils.java?rev=1391003&r1=1391002&r2=1391003&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ArrayUtils.java (original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ArrayUtils.java Thu Sep
27 13:34:33 2012
@@ -4961,8 +4961,7 @@ public class ArrayUtils {
      * (index < 0 || index >= array.length), or if the array is {@code null}.
      * @since 3.0.1
      */
-    @SuppressWarnings("unchecked")
-    // removeAll() always creates an array of the same type as its input
+    @SuppressWarnings("unchecked") // removeAll() always creates an array of the same type
as its input
     public static <T> T[] removeAll(T[] array, int... indices) {
         return (T[]) removeAll((Object) array, clone(indices));
     }

Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ObjectUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ObjectUtils.java?rev=1391003&r1=1391002&r2=1391003&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ObjectUtils.java (original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/ObjectUtils.java Thu
Sep 27 13:34:33 2012
@@ -536,7 +536,7 @@ public class ObjectUtils {
                         + obj.getClass().getName(), e.getCause());
                 }
             }
-            @SuppressWarnings("unchecked")
+            @SuppressWarnings("unchecked") // OK because input is of type T
             final T checked = (T) result;
             return checked;
         }

Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/event/EventListenerSupport.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/event/EventListenerSupport.java?rev=1391003&r1=1391002&r2=1391003&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/event/EventListenerSupport.java
(original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/event/EventListenerSupport.java
Thu Sep 27 13:34:33 2012
@@ -245,12 +245,12 @@ public class EventListenerSupport<L> imp
      * @throws ClassNotFoundException if the class cannot be resolved
      */
     private void readObject(ObjectInputStream objectInputStream) throws IOException, ClassNotFoundException
{
-        @SuppressWarnings("unchecked")
+        @SuppressWarnings("unchecked") // Will throw CCE here if not correct
         L[] listeners = (L[]) objectInputStream.readObject();
 
         this.listeners = new CopyOnWriteArrayList<L>(listeners);
 
-        @SuppressWarnings("unchecked")
+        @SuppressWarnings("unchecked") // Will throw CCE here if not correct
         Class<L> listenerInterface = (Class<L>) listeners.getClass().getComponentType();
 
         initializeTransientFields(listenerInterface, Thread.currentThread().getContextClassLoader());
@@ -262,7 +262,7 @@ public class EventListenerSupport<L> imp
      * @param classLoader the class loader to be used
      */
     private void initializeTransientFields(Class<L> listenerInterface, ClassLoader
classLoader) {
-        @SuppressWarnings("unchecked")
+        @SuppressWarnings("unchecked") // Will throw CCE here if not correct
         L[] array = (L[]) Array.newInstance(listenerInterface, 0);
         this.prototypeArray = array;
         createProxy(listenerInterface, classLoader);



Mime
View raw message