harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zhouke...@apache.org
Subject svn commit: r1001153 - in /harmony/enhanced/java/trunk/classlib/modules/beans/src: main/java/java/beans/Statement.java test/java/org/apache/harmony/beans/tests/java/beans/StatementTest.java
Date Sat, 25 Sep 2010 07:16:30 GMT
Author: zhoukevin
Date: Sat Sep 25 07:16:30 2010
New Revision: 1001153

URL: http://svn.apache.org/viewvc?rev=1001153&view=rev
Log:
This patch fixes an unexpected NoSuchMethodException thrown by java.beans.Statement class.
Also, add a test case to reproduce this problem.

Modified:
    harmony/enhanced/java/trunk/classlib/modules/beans/src/main/java/java/beans/Statement.java
    harmony/enhanced/java/trunk/classlib/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/StatementTest.java

Modified: harmony/enhanced/java/trunk/classlib/modules/beans/src/main/java/java/beans/Statement.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/trunk/classlib/modules/beans/src/main/java/java/beans/Statement.java?rev=1001153&r1=1001152&r2=1001153&view=diff
==============================================================================
--- harmony/enhanced/java/trunk/classlib/modules/beans/src/main/java/java/beans/Statement.java
(original)
+++ harmony/enhanced/java/trunk/classlib/modules/beans/src/main/java/java/beans/Statement.java
Sat Sep 25 07:16:30 2010
@@ -656,7 +656,7 @@ public class Statement {
                 }
                 return (bestDist != INFINITY ? bestDist + 1 : INFINITY);
             }
-            return (superDist != INFINITY ? superDist + 1 : INFINITY);
+            return (superDist != INFINITY ? superDist + 2 : INFINITY);
         }
     }
 }

Modified: harmony/enhanced/java/trunk/classlib/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/StatementTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/trunk/classlib/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/StatementTest.java?rev=1001153&r1=1001152&r2=1001153&view=diff
==============================================================================
--- harmony/enhanced/java/trunk/classlib/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/StatementTest.java
(original)
+++ harmony/enhanced/java/trunk/classlib/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/StatementTest.java
Sat Sep 25 07:16:30 2010
@@ -1313,4 +1313,37 @@ public class StatementTest extends TestC
             assertTrue(receivedArguments.isEmpty());
         }
     }
+
+    public interface IMockObjectA {
+    }
+
+    public class MockObjectA implements IMockObjectA {
+    }
+
+    public interface IMockAccess<E> {
+        public void setProperty(E e);
+    }
+
+    public class MockAccess implements IMockAccess<IMockObjectA> {
+
+        private IMockObjectA property;
+
+        public void setProperty(IMockObjectA prop) {
+            property = prop;
+        }
+
+        public IMockObjectA getProperty() {
+            return property;
+        }
+
+    }
+
+    public void testExecute_ObjectInterface() throws Exception {
+        MockAccess mockAccess = new MockAccess();
+        MockObjectA mockObjectA = new MockObjectA();
+        new Statement(mockAccess, "setProperty", new Object[] { mockObjectA })
+                .execute();
+        assertSame(mockObjectA, mockAccess.getProperty());
+    }
+
 }



Mime
View raw message