[ sisc-Bugs-1432887 ] setting current-class-path produces non-sensical results
"SourceForge.net" <[email protected]> Thu, 16 Feb 2006 05:50:35 -0800
| Newsgroups | gmane.comp.java.sisc.devel |
|---|---|
| Message-ID | <[email protected]> |
Bugs item #1432887, was opened at 2006-02-16 13:50
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=379534&aid=1432887&group_id=23735
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 6
Submitted By: Matthias Radestock (mradestock)
Assigned to: Nobody/Anonymous (nobody)
Summary: setting current-class-path produces non-sensical results
Initial Comment:
Step 1: Create a Java class like this:
public class Foo {
static {
System.out.println("Bah!");
}
}
Step 2: Compile it and place it somewhere where it is
*not* reachable by SISC's default class loader.
Step 3: Run SISC and execute the following
(import s2j)
(current-class-path '("<dir-containing-class>"))
(define x (java-class '|Foo|))
(current-class-path '("<dir-containing-class>"))
(define y (java-class '|Foo|))
(eqv? x y)
Result:
"Bah!" gets displayed twice, and the eqv? check returns
false, both indicating that we ended up with two
instances of the same class.
Initial analysis:
|current-class-path| always creates a fresh class
loader. Since classes are bound to their loading class
loader, resolving the same class names in two different
class loaders will result in two instances of the same
class.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=379534&aid=1432887&group_id=23735
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642