Message624

Author ianzsk
Recipients
Date 2002-03-18.08:41:49
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Firstly I want to say -- fantastic work guys!!!
Now to the problem :-(.

If a Java constructor uses <Class>.newInstance() within
its body and <Class> is a PyProxy class then. a
Type Error occurs from within in Py.initProxy(...).

I think the problem is because the
ThreadState.{get/push/pop}InitializingProxy()
methods are being "subverted" 
by the direct call to Class.newInstance() below:


#****** Jython 2.1 part
# File xx.py
from x import X,Y
class PyX(X): pass
class PyY(Y): pass
PyX.useClass(PyY)
X() # OK
PyX() # Not OK prints 'TypeError: Proxy instance reused'

//*****Java part
// File x/X.java
package x;
public class X {
	static Class myClass;
	// register a class to construct
	public static void useClass(Class cls) {
		myClass=cls;
	}
	Object o;
	public X() throws Exception {
		o=myClass.newInstance();
	}
}
// File x/Y.java
package x;
public class Y { public Y() {} }

History
Date User Action Args
2008-02-20 17:17:04adminlinkissue531256 messages
2008-02-20 17:17:04admincreate