Skip to content

Commit dda1eca

Browse files
author
dyrby76
committed
StringBuffer ambiguity bug #1145660 fixed. Earlier the choice of suitable methods in reflectionutility was handled incorrectly. We now sort out the bridge methods first.
git-svn-id: file:///tmp/test-svn/trunk@2897 fe72c1cf-3628-48e9-8b72-1c46755d3cff
1 parent 2d246c4 commit dda1eca

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

dynamicjava/src/koala/Version.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
* This file is copied to Version.java by the build process, which also
5454
* fills in the right values of the date and time.
5555
*
56-
* This javadoc corresponds to build drjava-20050206-2235;
56+
* This javadoc corresponds to build drjava-20050225-2221;
5757
*
5858
* @version $Id$
5959
*/
@@ -62,7 +62,7 @@ public abstract class Version {
6262
* This string will be automatically expanded upon "ant commit".
6363
* Do not edit it by hand!
6464
*/
65-
private static final String BUILD_TIME_STRING = "20050206-2235";
65+
private static final String BUILD_TIME_STRING = "20050225-2221";
6666

6767
/** A {@link Date} version of the build time. */
6868
private static final Date BUILD_TIME = _getBuildDate();

dynamicjava/src/koala/dynamicjava/util/ReflectionUtilities.java

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -355,12 +355,14 @@ public static Field getOuterField(Class<?> cl, String name)
355355
*/
356356
protected static Method selectTheMostSpecificMethod(List<Method> list) {
357357
if (list.isEmpty()) return null;
358-
358+
359359
Iterator<Method> it = list.iterator();
360360
Method best = it.next();
361361
Method ambiguous = null; // there is no ambiguous other method at first
362362
while (it.hasNext()) {
363363
Method curr = it.next();
364+
if(TigerUtilities.isBridge(curr)) continue; //If the method is a bridge method, dont consider it, go to the next
365+
364366
Class<?>[] a1 = best.getParameterTypes();
365367
Class<?>[] a2 = curr.getParameterTypes();
366368

@@ -402,14 +404,6 @@ else if (better2) {
402404
}
403405
}
404406
if (ambiguous != null) {
405-
boolean bestBridge = TigerUtilities.isBridge(best);
406-
boolean ambiBridge = TigerUtilities.isBridge(ambiguous);
407-
if (bestBridge && !ambiBridge) {
408-
return ambiguous;
409-
}
410-
else if (!bestBridge && ambiBridge) {
411-
return best;
412-
}
413407
throw new AmbiguousMethodException(best, ambiguous);
414408
}
415409
return best;

0 commit comments

Comments
 (0)