You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2012/11/07 00:19:37 UTC

svn commit: r1406394 - /tomcat/trunk/java/org/apache/tomcat/util/IntrospectionUtils.java

Author: markt
Date: Tue Nov  6 23:19:36 2012
New Revision: 1406394

URL: http://svn.apache.org/viewvc?rev=1406394&view=rev
Log:
Fix warnings in IntrospectionUtils.
One functional change to replace a debug message and a subsequent NPE with an IAE

Modified:
    tomcat/trunk/java/org/apache/tomcat/util/IntrospectionUtils.java

Modified: tomcat/trunk/java/org/apache/tomcat/util/IntrospectionUtils.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/IntrospectionUtils.java?rev=1406394&r1=1406393&r2=1406394&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/IntrospectionUtils.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/IntrospectionUtils.java Tue Nov  6 23:19:36 2012
@@ -40,6 +40,8 @@ public final class IntrospectionUtils {
     public static boolean setProperty(Object o, String name, String value) {
         return setProperty(o,name,value,true);
     }
+
+    @SuppressWarnings("null") // setPropertyMethodVoid is not null when used
     public static boolean setProperty(Object o, String name, String value,
             boolean invokeSetProperty) {
         if (log.isDebugEnabled())
@@ -308,6 +310,8 @@ public final class IntrospectionUtils {
         return methods;
     }
 
+    @SuppressWarnings("null") // Neither params nor methodParams can be null
+                              // when comparing their lengths
     public static Method findMethod(Class<?> c, String name,
             Class<?> params[]) {
         Method methods[] = findMethods(c);
@@ -341,9 +345,9 @@ public final class IntrospectionUtils {
     public static Object callMethod1(Object target, String methodN,
             Object param1, String typeParam1, ClassLoader cl) throws Exception {
         if (target == null || param1 == null) {
-            if (log.isDebugEnabled())
-                log.debug("IntrospectionUtils: Assert: Illegal params " +
-                        target + " " + param1);
+            throw new IllegalArgumentException(
+                    "IntrospectionUtils: Assert: Illegal params " +
+                    target + " " + param1);
         }
         if (log.isDebugEnabled())
             log.debug("IntrospectionUtils: callMethod1 " +



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org