You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ibatis.apache.org by cb...@apache.org on 2008/08/31 19:21:20 UTC

svn commit: r690737 - in /ibatis/trunk/java/ibatis-2: ./ ibatis-2-core/build/version.properties ibatis-2-core/src/com/ibatis/common/beans/ClassInfo.java ibatis-2-docs/en/

Author: cbegin
Date: Sun Aug 31 10:21:20 2008
New Revision: 690737

URL: http://svn.apache.org/viewvc?rev=690737&view=rev
Log:
Fixed Java 5 generic bridge methods

Modified:
    ibatis/trunk/java/ibatis-2/   (props changed)
    ibatis/trunk/java/ibatis-2/ibatis-2-core/build/version.properties
    ibatis/trunk/java/ibatis-2/ibatis-2-core/src/com/ibatis/common/beans/ClassInfo.java
    ibatis/trunk/java/ibatis-2/ibatis-2-docs/en/   (props changed)

Propchange: ibatis/trunk/java/ibatis-2/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Sun Aug 31 10:21:20 2008
@@ -3,3 +3,6 @@
 ibatis-2.ipr
 ibatis-2.iws
 jpetstore-5.iml
+ibderby
+out
+derby.log

Modified: ibatis/trunk/java/ibatis-2/ibatis-2-core/build/version.properties
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/ibatis-2/ibatis-2-core/build/version.properties?rev=690737&r1=690736&r2=690737&view=diff
==============================================================================
--- ibatis/trunk/java/ibatis-2/ibatis-2-core/build/version.properties (original)
+++ ibatis/trunk/java/ibatis-2/ibatis-2-core/build/version.properties Sun Aug 31 10:21:20 2008
@@ -1,5 +1,5 @@
 #Build version info
-#Sun Aug 17 09:13:51 MDT 2008
+#Sun Aug 31 11:18:20 MDT 2008
 version=2.3.3.x-build
-buildDate=2008/08/17 09\:13
-buildNum=722
+buildDate=2008/08/31 11\:18
+buildNum=723

Modified: ibatis/trunk/java/ibatis-2/ibatis-2-core/src/com/ibatis/common/beans/ClassInfo.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/ibatis-2/ibatis-2-core/src/com/ibatis/common/beans/ClassInfo.java?rev=690737&r1=690736&r2=690737&view=diff
==============================================================================
--- ibatis/trunk/java/ibatis-2/ibatis-2-core/src/com/ibatis/common/beans/ClassInfo.java (original)
+++ ibatis/trunk/java/ibatis-2/ibatis-2-core/src/com/ibatis/common/beans/ClassInfo.java Sun Aug 31 10:21:20 2008
@@ -99,7 +99,7 @@
   }
 
   private void addGetMethods(Class cls) {
-    Method[] methods = getAllMethodsForClass(cls);
+    Method[] methods = getClassMethods(cls);
     for (int i = 0; i < methods.length; i++) {
       Method method = methods[i];
       String name = method.getName();
@@ -124,7 +124,7 @@
 
   private void addSetMethods(Class cls) {
     Map conflictingSetters = new HashMap();
-    Method[] methods = getAllMethodsForClass(cls);
+    Method[] methods = getClassMethods(cls);
     for (int i = 0; i < methods.length; i++) {
       Method method = methods[i];
       String name = method.getName();
@@ -225,19 +225,6 @@
     getTypes.put(field.getName(), field.getType());
   }
 
-  private Method[] getAllMethodsForClass(Class cls) {
-    if (cls.isInterface()) {
-      // interfaces only have public methods - so the
-      // simple call is all we need (this will also get superinterface methods)
-      return cls.getMethods();
-    } else {
-      // need to get all the declared methods in this class
-      // and any super-class - then need to set access appropriatly
-      // for private methods
-      return getClassMethods(cls);
-    }
-  }
-
   /**
    * This method returns an array containing all methods
    * declared in this class and any superclass.
@@ -269,22 +256,23 @@
   }
 
   private void addUniqueMethods(HashMap uniqueMethods, Method[] methods) {
-    for (int i = 0; i < methods.length; i++) {
-      Method currentMethod = methods[i];
-      String signature = getSignature(currentMethod);
-      // check to see if the method is already known
-      // if it is known, then an extended class must have
-      // overridden a method
-      if (!uniqueMethods.containsKey(signature)) {
-        if (canAccessPrivateMethods()) {
-          try {
-            currentMethod.setAccessible(true);
-          } catch (Exception e) {
-            // Ignored. This is only a final precaution, nothing we can do.
+    for (Method currentMethod : methods) {
+      if (!currentMethod.isBridge()) {
+        String signature = getSignature(currentMethod);
+        // check to see if the method is already known
+        // if it is known, then an extended class must have
+        // overridden a method
+        if (!uniqueMethods.containsKey(signature)) {
+          if (canAccessPrivateMethods()) {
+            try {
+              currentMethod.setAccessible(true);
+            } catch (Exception e) {
+              // Ignored. This is only a final precaution, nothing we can do.
+            }
           }
-        }
 
-        uniqueMethods.put(signature, currentMethod);
+          uniqueMethods.put(signature, currentMethod);
+        }
       }
     }
   }

Propchange: ibatis/trunk/java/ibatis-2/ibatis-2-docs/en/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sun Aug 31 10:21:20 2008
@@ -0,0 +1 @@
+iBATIS-SqlMaps-2_en.odt