From: Brian Z. <bz...@zi...> - 2005-06-22 13:36:57
|
I've tested the patch and it looks good to me. I'll commit it. thanks, brian Mike Garcia wrote: > hi Berlin, > > If you need StringBuffer to work for you here is a work-around that I tested and it > works. You'll have to rebuild jython. In PyJavaClass.java change the method > setMethods(Class, Method[]) from: > /************************************************************/ > private void setMethods(Class c, Method[] methods) { > for (int i=0; i<methods.length; i++) { > Method method = methods[i]; > Class dc = method.getDeclaringClass(); > if (dc != c) > continue; > if (ignoreMethod(method)) > continue; > addMethod(method); > } > } > /************************************************************/ > TO: > /************************************************************/ > private void setMethods(Class c, Method[] methods) { > for (int i=0; i<methods.length; i++) { > Method method = methods[i]; > Class dc = method.getDeclaringClass(); > /* ADD */ > int mods = dc.getModifiers(); > if (Modifier.isInterface(mods) || > Modifier.isAbstract(mods) ) > continue; > /* END ADD */ > if (dc != c) > continue; > if (ignoreMethod(method)) > continue; > addMethod(method); > } > } > /************************************************************/ > > This works and I attached a simple test for ya. If this could be incorporated into > the jython 2.2a2 tip, that would be great. I can't envision any problems arising > out of this fix. Maybe Brian or Frank can state otherwise. > > Mike > |