From: <cg...@us...> - 2009-08-17 00:17:42
|
Revision: 6685 http://jython.svn.sourceforge.net/jython/?rev=6685&view=rev Author: cgroves Date: 2009-08-17 00:17:36 +0000 (Mon, 17 Aug 2009) Log Message: ----------- WHERE_PLACEHOLDER could hold on to a reference to a type for a while, and it's causing static initialization problems. Screw using a static array and just pass in null if we don't want to know where the item was found. Modified Paths: -------------- trunk/jython/src/org/python/core/PyType.java Modified: trunk/jython/src/org/python/core/PyType.java =================================================================== --- trunk/jython/src/org/python/core/PyType.java 2009-08-16 23:39:05 UTC (rev 6684) +++ trunk/jython/src/org/python/core/PyType.java 2009-08-17 00:17:36 UTC (rev 6685) @@ -90,9 +90,6 @@ /** Mapping of Java classes to their TypeBuilders. */ private static Map<Class<?>, TypeBuilder> classToBuilder; - /** Used by {@link #lookup} to call {@link #lookup_where} without allocating an array */ - private static final PyObject[] WHERE_PLACEHOLDER = new PyObject[1]; - protected PyType(PyType subtype) { super(subtype); } @@ -1046,7 +1043,7 @@ * @return found object or null */ public PyObject lookup(String name) { - return lookup_where(name, WHERE_PLACEHOLDER); + return lookup_where(name, null); } public PyObject lookup_where(String name, PyObject[] where) { @@ -1059,7 +1056,9 @@ if (dict != null) { PyObject obj = dict.__finditem__(name); if (obj != null) { - where[0] = t; + if (where != null) { + where[0] = t; + } return obj; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |