From: Finn B. <bc...@us...> - 2000-11-17 21:22:19
|
Update of /cvsroot/jython/jython/org/python/core In directory slayer.i.sourceforge.net:/tmp/cvs-serv15971 Modified Files: PyJavaClass.java Log Message: Delay ClassDictInit until the time the class is fully initialized. This fix a situation in applets in IE where the org.python.core classes depends on the initialization sequence of each other. Index: PyJavaClass.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PyJavaClass.java,v retrieving revision 2.24 retrieving revision 2.25 diff -C2 -r2.24 -r2.25 *** PyJavaClass.java 2000/11/17 12:32:43 2.24 --- PyJavaClass.java 2000/11/17 21:22:15 2.25 *************** *** 79,82 **** --- 79,95 ---- init__bases__(proxyClass); init__dict__(); + + if (ClassDictInit.class.isAssignableFrom(proxyClass) + && proxyClass != ClassDictInit.class) { + try { + Method m = proxyClass.getMethod("classDictInit", + new Class[] { PyObject.class }); + m.invoke(null, new Object[] { __dict__ }); + } + catch (Exception exc) { + // System.err.println("Got exception: " + exc + " " + proxyClass); + throw Py.JavaError(exc); + } + } initialized = true; initializing = false; *************** *** 172,188 **** __name__ = c.getName(); ! if (ClassDictInit.class.isAssignableFrom(c) ! && c != ClassDictInit.class) { ! initialize(); ! try { ! Method m = c.getMethod("classDictInit", ! new Class[] { PyObject.class }); ! m.invoke(null, new Object[] { __dict__ }); ! } ! catch (Exception exc) { ! // System.err.println("Got exception: " + exc + " " + c); ! throw Py.JavaError(exc); ! } ! } else if (InitModule.class.isAssignableFrom(c)) { initialize(); try { --- 185,189 ---- __name__ = c.getName(); ! if (InitModule.class.isAssignableFrom(c)) { initialize(); try { *************** *** 681,685 **** if (name == "__dict__") { if (__dict__ == null) ! init__dict__(); return __dict__; } --- 682,686 ---- if (name == "__dict__") { if (__dict__ == null) ! initialize(); return __dict__; } |