[ 
https://issues.apache.org/jira/browse/LUCENE-3847?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13222208#comment-13222208
 ] 

Uwe Schindler edited comment on LUCENE-3847 at 3/5/12 8:09 AM:
---------------------------------------------------------------

As far as I remember, the main problem with the Map interface in Properties is 
the values coming from the parent "defaults" object. When you wrap another 
properties object with one that has the other one as "defaults" given in ctor, 
then your are fcked up if you are using the Map interface. Which is not the 
case for system properties, but that's not guaranteed (e.g. the Java JVM could 
set some basic properties in another Properties object and make the changes 
available only through the overlayed properties object).

To fix the "defaults" problem I would go with the Enumeration<?> (works in Java 
5, too) in a "for(Enumeration<?> e=propertyNames(); e.hasMoreElements();)" loop.

If you use the Set interface, the inherited props would not have been seen and 
the system may *delete* properties which are in a parent/"defaults" properties 
object.
                
      was (Author: thetaphi):
    As far as I remember, the main problem with the Map interface in Properties 
is the values coming from the parent object (passed in Parameter). When you 
wrap another properties object with one that has the other one as "defaults" 
given in ctor, then your are fcked up if you are using the Map interface. Which 
is not the case for system properties, but that's not guaranteed (e.g. the Java 
JVM could set some basic properties in another Properties object and make the 
changes available only through the overlayed properties object).

To fix the "defaults" problem I would go with the Enumeration<?> (works in Java 
5, too) in a "for(Enumeration<?> e=propertyNames(); e.hasMoreElements();)" loop.

If you use the Set interface, the inherited props would not have been seen and 
the system may *delete* properties which are in a parent/"defaults" properties 
object.
                  
> LuceneTestCase should check for modifications on System properties
> ------------------------------------------------------------------
>
>                 Key: LUCENE-3847
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3847
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: general/test
>            Reporter: Dawid Weiss
>            Assignee: Dawid Weiss
>            Priority: Minor
>             Fix For: 3.6, 4.0
>
>         Attachments: LUCENE-3847.patch
>
>
> - fail the test if changes have been detected.
> - revert the state of system properties before the suite.
> - cleanup after the suite.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to