openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gerdo...@apache.org
Subject svn commit: r735259 - /incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/ClassUtil.java
Date Sat, 17 Jan 2009 09:44:09 GMT
Author: gerdogdu
Date: Sat Jan 17 01:44:09 2009
New Revision: 735259

URL: http://svn.apache.org/viewvc?rev=735259&view=rev
Log:
Correction of the getClassMethodWithTypes method.

Modified:
    incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/ClassUtil.java

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/ClassUtil.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/ClassUtil.java?rev=735259&r1=735258&r2=735259&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/ClassUtil.java
(original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/ClassUtil.java
Sat Jan 17 01:44:09 2009
@@ -843,30 +843,41 @@
         int j = 0;
         for (Method method : methods)
         {
-            Class<?>[] defineTypes = method.getParameterTypes();
+            if(method.getName().equals(methodName))
+            {             
+                if(parameterTypes != null && parameterTypes.size() > 0)
+                {
+                    Class<?>[] defineTypes = method.getParameterTypes();
 
-            if (defineTypes.length != parameterTypes.size())
-            {
-                continue;
-            }
+                    if (defineTypes.length != parameterTypes.size())
+                    {
+                        continue;
+                    }
+                    
+                    boolean ok = false;
+                    
+                    for (Class<?> defineType : defineTypes)
+                    {
+                        if (defineType.equals(parameterTypes.get(j)))
+                        {
+                            ok = true;
+                        }
+                        else
+                        {
+                            ok = false;
+                        }
+                    }
 
-            boolean ok = false;
-            for (Class<?> defineType : defineTypes)
-            {
-                if (defineType.equals(parameterTypes.get(j)))
-                {
-                    ok = true;
+                    if (ok)
+                    {
+                        return method;
+                    }                    
                 }
                 else
                 {
-                    ok = false;
+                    return method;
                 }
-            }
-
-            if (ok)
-            {
-                return method;
-            }
+            }         
         }
 
         return null;



Mime
View raw message