You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by Andrew Zhang <zh...@gmail.com> on 2006/08/15 12:17:12 UTC

[classlib][general] Where to put configuration files? (was Re: [jira] Commented: (HARMONY-1051) [classlib][nio_char] Use system classloader as an alternative to load charset provider classes when thread's context classloader fails to load them.)

On 8/15/06, Paulex Yang (JIRA) <ji...@apache.org> wrote:
>
>    [
> http://issues.apache.org/jira/browse/HARMONY-1051?page=comments#action_12428052]
>
> Paulex Yang commented on HARMONY-1051:
> --------------------------------------
>
> Andrew, I have some concern on this patch:
> 1. It has no regression test, I knew this regression may be a little
> complex, but it's still possible to mock a thread context loader to test the
> exceptional case.


We need a configuration file (.jar) in classpath to run the test for this
case. In fact, all service provider class tests have the same requirement.

The question comes out: which folder is the proper place to hold these jar
files?

I suggest  <module>/src/test/resources/ or
<module>src/test/resources/configuration/, just like serialization ser
files.

Any suggestions/comments/objections?

Thanks!



2. The static field contextClassLoader is not thread safe,while the spec of
> Charset require the thread safety.
>
> So would you please provide another patch for this? any problem, please
> let me know, thank you.
>
> > [classlib][nio_char] Use system classloader as an alternative to load
> charset provider classes when thread's context classloader fails to load
> them.
> >
> ----------------------------------------------------------------------------------------------------------------------------------------------------
> >
> >                 Key: HARMONY-1051
> >                 URL: http://issues.apache.org/jira/browse/HARMONY-1051
> >             Project: Harmony
> >          Issue Type: Improvement
> >          Components: Classlib
> >            Reporter: Andrew Zhang
> >         Assigned To: Paulex Yang
> >         Attachments: Harmony-1051.diff
> >
> >
> > As we dicussed on the mailing list[1],  using system classloader as an
> alternative to load charset provider classes when thread's context
> classloader fails to load them will be a good choice to follow RI while
> keeping compliant with spec.
> > I'll upload a patch for this improvement soon.
> > Thanks!
> > Best regards,
> > Andrew
> > [1] mailing list thread: [classlib][nio-charset] RI is inconsistent with
> spec when loading charset provider
>
> --
> This message is automatically generated by JIRA.
> -
> If you think it was sent incorrectly contact one of the administrators:
> http://issues.apache.org/jira/secure/Administrators.jspa
> -
> For more information on JIRA, see: http://www.atlassian.com/software/jira
>
>
>


-- 
Andrew Zhang
China Software Development Lab, IBM

Re: [classlib][general] Where to put configuration files? (was Re: [jira] Commented: (HARMONY-1051) [classlib][nio_char] Use system classloader as an alternative to load charset provider classes when thread's context classloader fails to load them.)

Posted by Andrew Zhang <zh...@gmail.com>.
On 8/16/06, Paulex Yang <pa...@gmail.com> wrote:
>
> Andrew Zhang wrote:
> > On 8/15/06, Paulex Yang (JIRA) <ji...@apache.org> wrote:
> >>
> >>    [
> >>
> http://issues.apache.org/jira/browse/HARMONY-1051?page=comments#action_12428052
> ]
> >>
> >>
> >> Paulex Yang commented on HARMONY-1051:
> >> --------------------------------------
> >>
> >> Andrew, I have some concern on this patch:
> >> 1. It has no regression test, I knew this regression may be a little
> >> complex, but it's still possible to mock a thread context loader to
> >> test the
> >> exceptional case.
> >
> >
> > We need a configuration file (.jar) in classpath to run the test for
> this
> > case. In fact, all service provider class tests have the same
> > requirement.
> >
> > The question comes out: which folder is the proper place to hold these
> > jar
> > files?
> >
> > I suggest  <module>/src/test/resources/ or
> > <module>src/test/resources/configuration/, just like serialization ser
> > files.
> IIUC, the jar file needs to be in classpath, and it's different with ser
> files, which only requires that directory is in classpath. I suggest a
> special directory for these kind of jar so that all of them can be added
> by build file easily(or IDE classpath configuration file), say,
> test/resources/jars (may be followed by /common, /windows, /linux, etc).
> Comments?


Agree. test/resources/jars sounds reasonable. If no one objects, I'll create
such folder for nio_char module.

>
> > Any suggestions/comments/objections?
> >
> > Thanks!
> >
> >
> >
> > 2. The static field contextClassLoader is not thread safe,while the
> > spec of
> >> Charset require the thread safety.
> >>
> >> So would you please provide another patch for this? any problem, please
> >> let me know, thank you.
> >>
> >> > [classlib][nio_char] Use system classloader as an alternative to load
> >> charset provider classes when thread's context classloader fails to
> load
> >> them.
> >> >
> >>
> ----------------------------------------------------------------------------------------------------------------------------------------------------
> >>
> >> >
> >> >                 Key: HARMONY-1051
> >> >                 URL:
> http://issues.apache.org/jira/browse/HARMONY-1051
> >> >             Project: Harmony
> >> >          Issue Type: Improvement
> >> >          Components: Classlib
> >> >            Reporter: Andrew Zhang
> >> >         Assigned To: Paulex Yang
> >> >         Attachments: Harmony-1051.diff
> >> >
> >> >
> >> > As we dicussed on the mailing list[1],  using system classloader as
> an
> >> alternative to load charset provider classes when thread's context
> >> classloader fails to load them will be a good choice to follow RI while
> >> keeping compliant with spec.
> >> > I'll upload a patch for this improvement soon.
> >> > Thanks!
> >> > Best regards,
> >> > Andrew
> >> > [1] mailing list thread: [classlib][nio-charset] RI is inconsistent
> >> with
> >> spec when loading charset provider
> >>
> >> --
> >> This message is automatically generated by JIRA.
> >> -
> >> If you think it was sent incorrectly contact one of the administrators:
> >> http://issues.apache.org/jira/secure/Administrators.jspa
> >> -
> >> For more information on JIRA, see:
> >> http://www.atlassian.com/software/jira
> >>
> >>
> >>
> >
> >
>
>
> --
> Paulex Yang
> China Software Development Lab
> IBM
>
>
>
> ---------------------------------------------------------------------
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
>
>


-- 
Andrew Zhang
China Software Development Lab, IBM

Re: [classlib][general] Where to put configuration files? (was Re: [jira] Commented: (HARMONY-1051) [classlib][nio_char] Use system classloader as an alternative to load charset provider classes when thread's context classloader fails to load them.)

Posted by Paulex Yang <pa...@gmail.com>.
Andrew Zhang wrote:
> On 8/15/06, Paulex Yang (JIRA) <ji...@apache.org> wrote:
>>
>>    [
>> http://issues.apache.org/jira/browse/HARMONY-1051?page=comments#action_12428052] 
>>
>>
>> Paulex Yang commented on HARMONY-1051:
>> --------------------------------------
>>
>> Andrew, I have some concern on this patch:
>> 1. It has no regression test, I knew this regression may be a little
>> complex, but it's still possible to mock a thread context loader to 
>> test the
>> exceptional case.
>
>
> We need a configuration file (.jar) in classpath to run the test for this
> case. In fact, all service provider class tests have the same 
> requirement.
>
> The question comes out: which folder is the proper place to hold these 
> jar
> files?
>
> I suggest  <module>/src/test/resources/ or
> <module>src/test/resources/configuration/, just like serialization ser
> files.
IIUC, the jar file needs to be in classpath, and it's different with ser 
files, which only requires that directory is in classpath. I suggest a 
special directory for these kind of jar so that all of them can be added 
by build file easily(or IDE classpath configuration file), say, 
test/resources/jars (may be followed by /common, /windows, /linux, etc). 
Comments?
>
> Any suggestions/comments/objections?
>
> Thanks!
>
>
>
> 2. The static field contextClassLoader is not thread safe,while the 
> spec of
>> Charset require the thread safety.
>>
>> So would you please provide another patch for this? any problem, please
>> let me know, thank you.
>>
>> > [classlib][nio_char] Use system classloader as an alternative to load
>> charset provider classes when thread's context classloader fails to load
>> them.
>> >
>> ---------------------------------------------------------------------------------------------------------------------------------------------------- 
>>
>> >
>> >                 Key: HARMONY-1051
>> >                 URL: http://issues.apache.org/jira/browse/HARMONY-1051
>> >             Project: Harmony
>> >          Issue Type: Improvement
>> >          Components: Classlib
>> >            Reporter: Andrew Zhang
>> >         Assigned To: Paulex Yang
>> >         Attachments: Harmony-1051.diff
>> >
>> >
>> > As we dicussed on the mailing list[1],  using system classloader as an
>> alternative to load charset provider classes when thread's context
>> classloader fails to load them will be a good choice to follow RI while
>> keeping compliant with spec.
>> > I'll upload a patch for this improvement soon.
>> > Thanks!
>> > Best regards,
>> > Andrew
>> > [1] mailing list thread: [classlib][nio-charset] RI is inconsistent 
>> with
>> spec when loading charset provider
>>
>> -- 
>> This message is automatically generated by JIRA.
>> -
>> If you think it was sent incorrectly contact one of the administrators:
>> http://issues.apache.org/jira/secure/Administrators.jspa
>> -
>> For more information on JIRA, see: 
>> http://www.atlassian.com/software/jira
>>
>>
>>
>
>


-- 
Paulex Yang
China Software Development Lab
IBM



---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: [classlib][general] Where to put configuration files? (was Re: [jira] Commented: (HARMONY-1051) [classlib][nio_char] Use system classloader as an alternative to load charset provider classes when thread's context classloader fails to load them.)

Posted by "Jimmy, Jing Lv" <fi...@gmail.com>.
Andrew Zhang wrote:
> On 8/15/06, Paulex Yang (JIRA) <ji...@apache.org> wrote:
>>
>>    [
>> http://issues.apache.org/jira/browse/HARMONY-1051?page=comments#action_12428052] 
>>
>>
>> Paulex Yang commented on HARMONY-1051:
>> --------------------------------------
>>
>> Andrew, I have some concern on this patch:
>> 1. It has no regression test, I knew this regression may be a little
>> complex, but it's still possible to mock a thread context loader to 
>> test the
>> exceptional case.
> 
> 
> We need a configuration file (.jar) in classpath to run the test for this
> case. In fact, all service provider class tests have the same requirement.
> 
> The question comes out: which folder is the proper place to hold these jar
> files?
> 
> I suggest  <module>/src/test/resources/ or
> <module>src/test/resources/configuration/, just like serialization ser
> files.
> 

Instrument also need a resources folder to put the resource jars, 
currently I'm planning to put them in 
<module>/src/test/resources/org/apache/harmony/tests/instrument 
according to our tradition naming scheme.

I guess add a "configuration" can be better. In this way, I may add 
"runtime" to instrument resource.

> Any suggestions/comments/objections?
> 
> Thanks!
> 
> 
> 
> 2. The static field contextClassLoader is not thread safe,while the spec of
>> Charset require the thread safety.
>>
>> So would you please provide another patch for this? any problem, please
>> let me know, thank you.
>>
>> > [classlib][nio_char] Use system classloader as an alternative to load
>> charset provider classes when thread's context classloader fails to load
>> them.
>> >
>> ---------------------------------------------------------------------------------------------------------------------------------------------------- 
>>
>> >
>> >                 Key: HARMONY-1051
>> >                 URL: http://issues.apache.org/jira/browse/HARMONY-1051
>> >             Project: Harmony
>> >          Issue Type: Improvement
>> >          Components: Classlib
>> >            Reporter: Andrew Zhang
>> >         Assigned To: Paulex Yang
>> >         Attachments: Harmony-1051.diff
>> >
>> >
>> > As we dicussed on the mailing list[1],  using system classloader as an
>> alternative to load charset provider classes when thread's context
>> classloader fails to load them will be a good choice to follow RI while
>> keeping compliant with spec.
>> > I'll upload a patch for this improvement soon.
>> > Thanks!
>> > Best regards,
>> > Andrew
>> > [1] mailing list thread: [classlib][nio-charset] RI is inconsistent 
>> with
>> spec when loading charset provider
>>
>> -- 
>> This message is automatically generated by JIRA.
>> -
>> If you think it was sent incorrectly contact one of the administrators:
>> http://issues.apache.org/jira/secure/Administrators.jspa
>> -
>> For more information on JIRA, see: http://www.atlassian.com/software/jira
>>
>>
>>
> 
> 


-- 

Best Regards!

Jimmy, Jing Lv
China Software Development Lab, IBM

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org