Configuration reading bug?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Configuration reading bug?

jax-4
Hi,

I have the following scenario.

filename: key.properties
key1=\\\\myfolder\\
key2=\\\\myfolder2\\
key3=file:d:\\myfolder3
key4=\\\\myfolder4\\

When CompositeConfiguration load the files through the
following,

compositeconfiguration.add(new
PropertiesConfiguration(key.properties));

The resulting keys loaded are as follows
Key: Key1
Value:
\\myfolderkey2=\\myfolder2Key3=file:d:\myfolder3

Key: Key4
Value: \\myfolder4\


Some of the keys are merged into a single key, causing
lost of information. From a visual point of view, it
seems to be the \\ at the end thats causing the
problem.

Pls advice.

Rdgs,
jax

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Configuration reading bug?

Emmanuel Bourg-3
Hi Jax, thank you for reporting this issue, it looks like a conflict
between the character escaping code and the multiline values code. To
work around this bug I suggest that you replace your path separators
with the unix path separator. Your values will be shorter and the
configuration should still work on Windows:

key1=\\\\myfolder/
key2=\\\\myfolder2/
key3=file:d:/myfolder3
key4=\\\\myfolder4/

Emmanuel Bourg


jax wrote:

> Hi,
>
> I have the following scenario.
>
> filename: key.properties
> key1=\\\\myfolder\\
> key2=\\\\myfolder2\\
> key3=file:d:\\myfolder3
> key4=\\\\myfolder4\\
>
> When CompositeConfiguration load the files through the
> following,
>
> compositeconfiguration.add(new
> PropertiesConfiguration(key.properties));
>
> The resulting keys loaded are as follows
> Key: Key1
> Value:
> \\myfolderkey2=\\myfolder2Key3=file:d:\myfolder3
>
> Key: Key4
> Value: \\myfolder4\
>
>
> Some of the keys are merged into a single key, causing
> lost of information. From a visual point of view, it
> seems to be the \\ at the end thats causing the
> problem.
>
> Pls advice.
>
> Rdgs,
> jax

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Configuration reading bug?

jax-4
In reply to this post by jax-4
Sadly, its a requirement to keep the path seperators
as it is due to some internal processing involved.

Is there earlier versions of Configuration that is
without this bug?

For now, I am looking into possibilities of adding
other escape characters right at the end. Eg: adding
\t or \n and to make them transparent to the string
that would be retrieved, maybe by trimming. At least
this would be done till a version of Configuration
without such bugs is released.

PS: Should i file this bug at bugzilla?

rdgs,
jax
--- Emmanuel Bourg <[hidden email]> wrote:

> Hi Jax, thank you for reporting this issue, it looks
> like a conflict
> between the character escaping code and the
> multiline values code. To
> work around this bug I suggest that you replace your
> path separators
> with the unix path separator. Your values will be
> shorter and the
> configuration should still work on Windows:
>
> key1=\\\\myfolder/
> key2=\\\\myfolder2/
> key3=file:d:/myfolder3
> key4=\\\\myfolder4/
>
> Emmanuel Bourg
>
>
> jax wrote:
> > Hi,
> >
> > I have the following scenario.
> >
> > filename: key.properties
> > key1=\\\\myfolder\\
> > key2=\\\\myfolder2\\
> > key3=file:d:\\myfolder3
> > key4=\\\\myfolder4\\
> >
> > When CompositeConfiguration load the files through
> the
> > following,
> >
> > compositeconfiguration.add(new
> > PropertiesConfiguration(key.properties));
> >
> > The resulting keys loaded are as follows
> > Key: Key1
> > Value:
> > \\myfolderkey2=\\myfolder2Key3=file:d:\myfolder3
> >
> > Key: Key4
> > Value: \\myfolder4\
> >
> >
> > Some of the keys are merged into a single key,
> causing
> > lost of information. From a visual point of view,
> it
> > seems to be the \\ at the end thats causing the
> > problem.
> >
> > Pls advice.
> >
> > Rdgs,
> > jax
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [hidden email]
> For additional commands, e-mail:
> [hidden email]
>
>


               
__________________________________
Do you Yahoo!?
Yahoo! Small Business - Try our new Resources site
http://smallbusiness.yahoo.com/resources/

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Configuration reading bug?

Emmanuel Bourg-3
jax wrote:
> Sadly, its a requirement to keep the path seperators
> as it is due to some internal processing involved.
>
> Is there earlier versions of Configuration that is
> without this bug?

I think it's a rather old issue inherited from the ExtendedProperties in
commons-collections. It was fixed in commons-collections in 2003 but
wasn't ported to Configuration. All versions of Configuration are
affected by this bug.

> For now, I am looking into possibilities of adding
> other escape characters right at the end. Eg: adding
> \t or \n and to make them transparent to the string
> that would be retrieved, maybe by trimming. At least
> this would be done till a version of Configuration
> without such bugs is released.

And what about storing your configuration in a XML file in the meantime ?

> PS: Should i file this bug at bugzilla?

I just filed Bug 35119 to cover this issue.

http://issues.apache.org/bugzilla/show_bug.cgi?id=35119

Emmanuel Bourg

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]