|
From: <no...@so...> - 2000-12-16 17:03:06
|
Bug #122820, was updated on 2000-Nov-18 11:12
Here is a current snapshot of the bug.
Project: Jython
Category: Core
Status: Closed
Resolution: Fixed
Bug Group: None
Priority: 1
Submitted by: bckfnn
Assigned to : pedronis
Summary: jclass instances cached (?); creates problems
Details: I extended java.lang.ClassLoader with my own implementation that
locally loads new copies of everything except system classes. This
is so that I could fire up a JVM once and re-run my code over and
over again, grabbing the new versions of my code each time.
You can trust me that (a) my ClassLoader works; and (b) I have
tried this in pure Java code, and it works fine. If you can
immediately see how this is taking place, then we're ok; if not,
then pls email me and I will send you my code.
(I tried going through the JPython source code to pinpoint the
portions responsible, but I couldn't find them.)
I have reproduced this on Solaris 2.6 with Sun JDK 1.2, which
tells me that this is probably not platform dependent.
Here is a JPython session illustrating what I mean --
==========
akudo: [src/corba] > jpython
JPython 1.1beta2 on java1.2
Copyright (C) 1997-1999 Corporation for National Research Initiatives
>>> import edu.umn.genomics.util
>>> cl = edu.umn.genomics.util.ClasspathClassLoader()
>>> cl
edu.umn.genomics.util.ClasspathClassLoader@984dff91
>>> cl.loadClass('edu.umn.genomics.util.test.SimpleTestClass')
<jclass edu.umn.genomics.util.test.SimpleTestClass at -2094399598>
>>> del(cl)
>>> cl = edu.umn.genomics.util.ClasspathClassLoader()
>>> cl
edu.umn.genomics.util.ClasspathClassLoader@b9a5ff91
>>> cl.loadClass('edu.umn.genomics.util.test.SimpleTestClass')
<jclass edu.umn.genomics.util.test.SimpleTestClass at -2094399598>
==========
As you can see, although I had a different instance of my class
ClaspathClassLoader, the resulting jclass object is identical to
the one I first obtained, leading me to believe that they are
cached in some way.
Assuming this to be a "feature", I think it limits the use of
Java Reflection in JPython; it should at least be a configurable
option.
Follow-Ups:
Date: 2000-Dec-16 09:02
By: pedronis
Comment:
Fixed by new internal tables design.
-------------------------------------------------------
For detailed info, follow this link:
http://sourceforge.net/bugs/?func=detailbug&bug_id=122820&group_id=12867
|