[Jython-checkins] jython: Move the method+signature checking into visitMethods.
frank.wierzbicki
jython-checkins at python.org
Sat Dec 22 20:52:09 CET 2012
http://hg.python.org/jython/rev/a310960970b3
changeset: 6910:a310960970b3
user: Darjus Loktevic <darjus at gmail.com>
date: Sun Nov 18 17:43:51 2012 -0800
summary:
Move the method+signature checking into visitMethods.
files:
src/org/python/compiler/ProxyMaker.java | 50 ++++++------
1 files changed, 26 insertions(+), 24 deletions(-)
diff --git a/src/org/python/compiler/ProxyMaker.java b/src/org/python/compiler/ProxyMaker.java
--- a/src/org/python/compiler/ProxyMaker.java
+++ b/src/org/python/compiler/ProxyMaker.java
@@ -343,11 +343,6 @@
String[] exceptionTypes = mapExceptions(exceptions);
names.add(name);
-
- // make sure we have only one name + signature pair available per method
- if (!namesAndSigs.add(name + sig)) {
- return;
- }
Code code = null;
if (methodAnnotations != null && parameterAnnotations != null) {
@@ -638,27 +633,34 @@
*/
protected void visitMethods(Class<?> klass) throws Exception {
for (Method method : klass.getDeclaredMethods()) {
- int access = method.getModifiers();
- if (Modifier.isStatic(access) || Modifier.isPrivate(access)) {
- continue;
- }
+
+
+ // make sure we have only one name + signature pair available per method
+ if (!namesAndSigs.add(methodString(method))) {
+ continue;
+ }
- if (Modifier.isNative(access)) {
- access = access & ~Modifier.NATIVE;
- }
+ int access = method.getModifiers();
+ if (Modifier.isStatic(access) || Modifier.isPrivate(access)) {
+ continue;
+ }
- if (Modifier.isProtected(access)) {
- access = (access & ~Modifier.PROTECTED) | Modifier.PUBLIC;
- if (Modifier.isFinal(access)) {
- addSuperMethod(method, access);
- continue;
- }
- } else if (Modifier.isFinal(access)) {
- continue;
- } else if (!Modifier.isPublic(access)) {
- continue; // package protected by process of elimination; we can't override
- }
- addMethod(method, access);
+ if (Modifier.isNative(access)) {
+ access = access & ~Modifier.NATIVE;
+ }
+
+ if (Modifier.isProtected(access)) {
+ access = (access & ~Modifier.PROTECTED) | Modifier.PUBLIC;
+ if (Modifier.isFinal(access)) {
+ addSuperMethod(method, access);
+ continue;
+ }
+ } else if (Modifier.isFinal(access)) {
+ continue;
+ } else if (!Modifier.isPublic(access)) {
+ continue; // package protected by process of elimination; we can't override
+ }
+ addMethod(method, access);
}
Class<?> superClass = klass.getSuperclass();
--
Repository URL: http://hg.python.org/jython
More information about the Jython-checkins
mailing list