You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Henning P. Schmiedehausen" <hp...@intermeta.de> on 2004/09/20 11:51:40 UTC
DELIMITER in AbstractConfiguration
Hi,
is there any reason why the DELIMITER field in AbstractConfiguration
is static? Any objection to make it an instance variable? As far as I
can see, this is only used in BaseConfiguration and not exposed in any
interface.
This would allow a CompositeConfiguration to load multiple files with
different delimiters.
Regards
Henning
--
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen INTERMETA GmbH
hps@intermeta.de +49 9131 50 654 0 http://www.intermeta.de/
RedHat Certified Engineer -- Jakarta Turbine Development -- hero for hire
Linux, Java, perl, Solaris -- Consulting, Training, Development
"Fighting for one's political stand is an honorable action, but re-
fusing to acknowledge that there might be weaknesses in one's
position - in order to identify them so that they can be remedied -
is a large enough problem with the Open Source movement that it
deserves to be on this list of the top five problems."
-- Michelle Levesque, "Fundamental Issues with
Open Source Software Development"
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
Re: [configuration] DELIMITER in AbstractConfiguration
Posted by Emmanuel Bourg <sm...@lfjr.net>.
Henning P. Schmiedehausen wrote:
> Same here.
>
> I also pulled a real can of worms trying to do so, because DELIMITER
> is used in static inner classes and these would have to be changed to
> non static, resulting in some inner class methods that currently can
> be called directly having to get a getter in the parent class (the
> PropertyTokenizer class if I remember correctly).
Yes indeed, I first tried to make the inner classes non static, then I
changed my mind and added a delimiter parameter to the constructors. I'm
attaching the resulting patch.
> In the end, it was IMHO not worth the trouble.
It's still a valid idea, let's open a bug report on this, we can address
this later.
Emmanuel Bourg
Re: [configuration] DELIMITER in AbstractConfiguration
Posted by "Henning P. Schmiedehausen" <hp...@intermeta.de>.
Emmanuel Bourg <sm...@lfjr.net> writes:
>I tried to make the delimiter non static but found a problem: you can't
>change the delimiter for a PropertiesConfiguration if you specify the
>file in the constructor, because the file is parsed before you get a
>chance to change the delimiter. You have to create the configuration,
>set the delimiter, and then load the file.
Same here.
I also pulled a real can of worms trying to do so, because DELIMITER
is used in static inner classes and these would have to be changed to
non static, resulting in some inner class methods that currently can
be called directly having to get a getter in the parent class (the
PropertyTokenizer class if I remember correctly).
In the end, it was IMHO not worth the trouble.
>I wonder if it's worth adding a static setDefaultDelimiter() method.
Let's keep it as it is (we might want to rename the DELIMITER to
delimiter though) for 1.0.
Regards
Henning
--
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen INTERMETA GmbH
hps@intermeta.de +49 9131 50 654 0 http://www.intermeta.de/
RedHat Certified Engineer -- Jakarta Turbine Development -- hero for hire
Linux, Java, perl, Solaris -- Consulting, Training, Development
"Fighting for one's political stand is an honorable action, but re-
fusing to acknowledge that there might be weaknesses in one's
position - in order to identify them so that they can be remedied -
is a large enough problem with the Open Source movement that it
deserves to be on this list of the top five problems."
-- Michelle Levesque, "Fundamental Issues with
Open Source Software Development"
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
Re: [configuration] DELIMITER in AbstractConfiguration
Posted by Emmanuel Bourg <sm...@lfjr.net>.
I tried to make the delimiter non static but found a problem: you can't
change the delimiter for a PropertiesConfiguration if you specify the
file in the constructor, because the file is parsed before you get a
chance to change the delimiter. You have to create the configuration,
set the delimiter, and then load the file.
I wonder if it's worth adding a static setDefaultDelimiter() method.
Emmanuel Bourg
Emmanuel Bourg wrote:
> Henning P. Schmiedehausen wrote:
>
>> Hi,
>>
>> is there any reason why the DELIMITER field in AbstractConfiguration
>> is static? Any objection to make it an instance variable? As far as I
>> can see, this is only used in BaseConfiguration and not exposed in any
>> interface.
>>
>> This would allow a CompositeConfiguration to load multiple files with
>> different delimiters.
>>
>> Regards
>> Henning
>
>
> No problem, go ahead.
>
> Emmanuel Bourg
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
Re: [configuration] DELIMITER in AbstractConfiguration
Posted by Emmanuel Bourg <sm...@lfjr.net>.
Henning P. Schmiedehausen wrote:
> Hi,
>
> is there any reason why the DELIMITER field in AbstractConfiguration
> is static? Any objection to make it an instance variable? As far as I
> can see, this is only used in BaseConfiguration and not exposed in any
> interface.
>
> This would allow a CompositeConfiguration to load multiple files with
> different delimiters.
>
> Regards
> Henning
No problem, go ahead.
Emmanuel Bourg
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org