Skip to content

Commit f8c9339

Browse files
hansonrhansonr
authored andcommitted
method fix -- re-enables Proxy
1 parent 0afb37f commit f8c9339

File tree

1 file changed

+4
-5
lines changed
  • sources/net.sf.j2s.java.core/src/java/lang/reflect

1 file changed

+4
-5
lines changed

sources/net.sf.j2s.java.core/src/java/lang/reflect/Method.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,22 +109,21 @@ public Object invoke(Object receiver, Object... args)
109109
// proxy does
110110
Object[] a = Class.getArgumentArray(parameterTypes, args, isProxy);
111111
Object c = (isProxy ? receiver : this.Class_);
112-
Object m = null;
112+
Object m = null, val = null;
113113
/**
114114
* @j2sNative
115115
*
116116
* if (!this.isProxy) c = c.$clazz$;
117117
* m= c[this.signature] || c.prototype && c.prototype[this.signature];
118-
* if (m != null) {
119-
* m = this.wrap$O(m.apply(receiver,a));
120-
* }
118+
* val = (m == null ? null : m.apply(receiver,a));
119+
* if (val != null && !this.isProxy) val = this.wrap$O(val);
121120
*/
122121
if (m == null) {
123122
String message = "Method " + getDeclaringClass().getName()
124123
+ "." + signature + " was not found";
125124
throw new IllegalArgumentException(message);
126125
}
127-
return m;
126+
return val;
128127
}
129128

130129
Object wrap(Object o) {

0 commit comments

Comments
 (0)