openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From allee8...@apache.org
Subject svn commit: r1199919 - /openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/ResultPacker.java
Date Wed, 09 Nov 2011 19:02:11 GMT
Author: allee8285
Date: Wed Nov  9 19:02:10 2011
New Revision: 1199919

URL: http://svn.apache.org/viewvc?rev=1199919&view=rev
Log:
OPENJPA-2071 Guarded NPE against isInterface call from ResultPacker constructor with null
parameter

Modified:
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/ResultPacker.java

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/ResultPacker.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/ResultPacker.java?rev=1199919&r1=1199918&r2=1199919&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/ResultPacker.java
(original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/ResultPacker.java
Wed Nov  9 19:02:10 2011
@@ -173,12 +173,14 @@ public class ResultPacker {
     }
     
     boolean isInterface(Class<?> intf, Class<?> actual) {
-    	Class<?>[] intfs = actual.getInterfaces();
-    	for (Class<?> c : intfs) {
-    		if (c == intf)
-    			return true;
-    	}
-    	return false;
+        if (actual != null) {
+            Class<?>[] intfs = actual.getInterfaces();
+            for (Class<?> c : intfs) {
+                if (c == intf)
+                    return true;
+            }
+        }
+        return false;
     }
 
     /**



Mime
View raw message