From: Finn B. <bc...@us...> - 2000-11-10 19:09:43
|
Update of /cvsroot/jython/jython/Tools/jythonc In directory slayer.i.sourceforge.net:/tmp/cvs-serv31349 Modified Files: proxies.py Log Message: wrapThrows(): Do not generate a "catch (java.lang.Throwable)" if it is already generated based on throws method signature clause. Index: proxies.py =================================================================== RCS file: /cvsroot/jython/jython/Tools/jythonc/proxies.py,v retrieving revision 2.5 retrieving revision 2.6 diff -C2 -r2.5 -r2.6 *** proxies.py 2000/10/28 19:17:36 2.5 --- proxies.py 2000/11/10 15:15:17 2.6 *************** *** 88,91 **** --- 88,92 ---- if len(throws) == 0: return stmt catches = [] + throwableFound = 0 for i in range(len(throws)): throw = throws[i] *************** *** 94,102 **** body = jast.Block([jast.Throw(excname)]) catches.append( (exctype, excname, body) ) ! body = jast.Block([jast.Invoke(jast.Identifier("inst"), "_jthrow", [jast.Identifier("t")]), nullReturn(retType)]) ! catches.append( ("java.lang.Throwable", jast.Identifier("t"), body) ) return jast.TryCatches(jast.Block([stmt]), catches) --- 95,106 ---- body = jast.Block([jast.Throw(excname)]) catches.append( (exctype, excname, body) ) + if throw == "java.lang.Throwable": + throwableFound = 1 ! if not throwableFound: ! body = jast.Block([jast.Invoke(jast.Identifier("inst"), "_jthrow", [jast.Identifier("t")]), nullReturn(retType)]) ! catches.append( ("java.lang.Throwable", jast.Identifier("t"), body) ) return jast.TryCatches(jast.Block([stmt]), catches) |