Re: [Sablevm-user] jni: LD_LIBRARY_PATH ignored
Brought to you by:
egagnon
|
From: Prof. E. M. G. <eti...@uq...> - 2003-03-21 15:29:44
|
David B=E9langer wrote:
> Properties are simple (key,value) pairs. There cannot be several pairs=
> stored with the same key. I am not sure what SableVM does if one
> is specified several times. It might just use the last value?
All command-line properties (e.g. "--property=3D...") are passed to the c=
lass-library.
In sablevm-class-library, src/java/lang/Runtime.java:
=2E..
private static void insertSystemProperties(Properties p)
{
=2E..
// get command-line passed value. These values may override
// default values above.
int count =3D getPropertyCount();
for (int i =3D 0; i < count; i++)
{
String property =3D getProperty(i);
int equal_position =3D property.indexOf('=3D');
String name =3D property.substring(0, equal_position);
String value;
if (equal_position < property.length())
{
value =3D property.substring(equal_position + 1);
}
else
{
value =3D "";
}
p.setProperty(name, value);
}
=2E..
So, if you pass the same property many times, p.setProperty(name, value) =
will be=20
called appropriately. The semantics of java.util.Properties indicate tha=
t only=20
the last assigned value will be retained.
As you see, I like to keep the native code to a minimum, in SableVM. I t=
ry to=20
do as much as I can in Java. When you modify SableVM, try to do the same=
=2E [I=20
know David already does this:-)]
Etienne
--=20
Etienne M. Gagnon, Ph.D. http://www.info.uqam.ca/~egagnon/
SableVM: http://www.sablevm.org/
SableCC: http://www.sablecc.org/
|