You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by Alexey Varlamov <al...@gmail.com> on 2007/03/19 08:00:31 UTC

[classlib][vmi] managing default properties

I think we should minimize hardcoding classlib specific values to VMs,
and suggest to reconsider the way this issue is fixed.
IMO setting the defaults like
"java.util.prefs.FilePreferencesFactoryImpl" or
"javax.xml.transform.TransformerFactory" should be done during
initialization of respective classlib modules, or, if this is
impossible/inappropriate, added to luni's initialization rather than
to VM startup.
Actually there is a bunch of corresponding FIXME comments in the
modified DRLVM source - let's fix them instead of aggravating.
Should I reopen the JIRA?

--
Alexey

2007/3/17, apetrenko@apache.org <ap...@apache.org>:
> Author: apetrenko
> Date: Sat Mar 17 01:58:05 2007
> New Revision: 519267
>
> URL: http://svn.apache.org/viewvc?view=rev&rev=519267
> Log:
> Patch for HARMONY-3209 "Harmony's default instance of javax.xml.TransformerFactory differs from RI's one"
>
> Modified:
>    harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_properties.cpp
>
> Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_properties.cpp
> URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_properties.cpp?view=diff&rev=519267&r1=519266&r2=519267
> ==============================================================================
> --- harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_properties.cpp (original)
> +++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_properties.cpp Sat Mar 17 01:58:05 2007
> @@ -209,6 +209,10 @@
>  #else
>         "java.util.prefs.FilePreferencesFactoryImpl");
>  #endif
> +    // Property for xalan.jar
> +    properties.set("javax.xml.transform.TransformerFactory",
> +                   "org.apache.xalan.xsltc.trax.TransformerFactoryImpl");
> +
>
>     // Added for compatibility with the external java JDWP agent
>     properties.set("sun.boot.library.path", base_path_buf);
>
>
>

Re: [classlib][vmi] managing default properties

Posted by Alexey Petrenko <al...@gmail.com>.
2007/3/19, Alexey Varlamov <al...@gmail.com>:
> Should I reopen the JIRA?
No, I do not think that we need to reopen HARMONY-3209.
It looks like we need to define a new way for setting default
properties and then move all the classlib specific properties.
So I would prefer a new JIRA: "Move default classlib properties
initialization to classlib"

SY, Alexey

Re: [classlib][vmi] managing default properties

Posted by Alexey Varlamov <al...@gmail.com>.
2007/3/19, Alexey Petrenko <al...@gmail.com>:
> In fact Evgenia has rised this question on dev list a month ago while
> preparing the patch :)
>
> Regarding default properties I agree that we need a way to set default
> classlib properties in classlib. On of the main reasons for this
> approach that Harmony has more VMs then classlibs :)
>
> As a solution I would suggest a DefaultProperties (or smth like that)
> class in java.lang or org.apache.harmony.smth package to incorporate
> all the default properties for classlib.

Java code look inappropriate for properties initialization due to
several reasons:
1) The default values must be truly default - i.e. be restored in case
system properties are reset, be available at startup, etc. This
implies using native VMI.
2) Values may be platform dependent (as FilePreferencesFactoryImpl),
this is better addressed in native.

> Do we really need separate properties for each module?
If this helps to reduce semantic & build dependencies, it worths separation.
Yet the properties in question better fit to luni startup, as neither
xml nor prefs have startup initialization.

>
> SY, Alexey
>
> 2007/3/19, Alexey Varlamov <al...@gmail.com>:
> > I think we should minimize hardcoding classlib specific values to VMs,
> > and suggest to reconsider the way this issue is fixed.
> > IMO setting the defaults like
> > "java.util.prefs.FilePreferencesFactoryImpl" or
> > "javax.xml.transform.TransformerFactory" should be done during
> > initialization of respective classlib modules, or, if this is
> > impossible/inappropriate, added to luni's initialization rather than
> > to VM startup.
> > Actually there is a bunch of corresponding FIXME comments in the
> > modified DRLVM source - let's fix them instead of aggravating.
> > Should I reopen the JIRA?
> >
> > --
> > Alexey
> >
> > 2007/3/17, apetrenko@apache.org <ap...@apache.org>:
> > > Author: apetrenko
> > > Date: Sat Mar 17 01:58:05 2007
> > > New Revision: 519267
> > >
> > > URL: http://svn.apache.org/viewvc?view=rev&rev=519267
> > > Log:
> > > Patch for HARMONY-3209 "Harmony's default instance of javax.xml.TransformerFactory differs from RI's one"
> > >
> > > Modified:
> > >    harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_properties.cpp
> > >
> > > Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_properties.cpp
> > > URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_properties.cpp?view=diff&rev=519267&r1=519266&r2=519267
> > > ==============================================================================
> > > --- harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_properties.cpp (original)
> > > +++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_properties.cpp Sat Mar 17 01:58:05 2007
> > > @@ -209,6 +209,10 @@
> > >  #else
> > >         "java.util.prefs.FilePreferencesFactoryImpl");
> > >  #endif
> > > +    // Property for xalan.jar
> > > +    properties.set("javax.xml.transform.TransformerFactory",
> > > +                   "org.apache.xalan.xsltc.trax.TransformerFactoryImpl");
> > > +
> > >
> > >     // Added for compatibility with the external java JDWP agent
> > >     properties.set("sun.boot.library.path", base_path_buf);
> > >
> > >
> > >
> >
>

Re: [classlib][vmi] managing default properties

Posted by Alexey Petrenko <al...@gmail.com>.
In fact Evgenia has rised this question on dev list a month ago while
preparing the patch :)

Regarding default properties I agree that we need a way to set default
classlib properties in classlib. On of the main reasons for this
approach that Harmony has more VMs then classlibs :)

As a solution I would suggest a DefaultProperties (or smth like that)
class in java.lang or org.apache.harmony.smth package to incorporate
all the default properties for classlib.

Do we really need separate properties for each module?

SY, Alexey

2007/3/19, Alexey Varlamov <al...@gmail.com>:
> I think we should minimize hardcoding classlib specific values to VMs,
> and suggest to reconsider the way this issue is fixed.
> IMO setting the defaults like
> "java.util.prefs.FilePreferencesFactoryImpl" or
> "javax.xml.transform.TransformerFactory" should be done during
> initialization of respective classlib modules, or, if this is
> impossible/inappropriate, added to luni's initialization rather than
> to VM startup.
> Actually there is a bunch of corresponding FIXME comments in the
> modified DRLVM source - let's fix them instead of aggravating.
> Should I reopen the JIRA?
>
> --
> Alexey
>
> 2007/3/17, apetrenko@apache.org <ap...@apache.org>:
> > Author: apetrenko
> > Date: Sat Mar 17 01:58:05 2007
> > New Revision: 519267
> >
> > URL: http://svn.apache.org/viewvc?view=rev&rev=519267
> > Log:
> > Patch for HARMONY-3209 "Harmony's default instance of javax.xml.TransformerFactory differs from RI's one"
> >
> > Modified:
> >    harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_properties.cpp
> >
> > Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_properties.cpp
> > URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_properties.cpp?view=diff&rev=519267&r1=519266&r2=519267
> > ==============================================================================
> > --- harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_properties.cpp (original)
> > +++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_properties.cpp Sat Mar 17 01:58:05 2007
> > @@ -209,6 +209,10 @@
> >  #else
> >         "java.util.prefs.FilePreferencesFactoryImpl");
> >  #endif
> > +    // Property for xalan.jar
> > +    properties.set("javax.xml.transform.TransformerFactory",
> > +                   "org.apache.xalan.xsltc.trax.TransformerFactoryImpl");
> > +
> >
> >     // Added for compatibility with the external java JDWP agent
> >     properties.set("sun.boot.library.path", base_path_buf);
> >
> >
> >
>