Hi,

I was looking at TOMEE-2968 [1].

The user has a special character "}" within the password used for the
data source configuration. I replicated the behaviour described in
TOMEE-2968 in a unit test [2].

Debugging the code boils down to PropertyPlaceHolderHelper [3], in
which we are stripping away a prefix ("${") and a suffix ("}") in in
PropertyPlaceHolderHelper#simpleValueAsStringOrCharArray(...).

My questions are:

1.) What is the purpose of this prefix / suffix in
PropertyPlaceHolderHelper? Maybe someone can point me to the relevant
documentation / code to understand it.

2.) Shouldn't we stripping the prefix and suffix only in case both are
contained within a value or is this just a failsafe mechanismn?
Otherwise a single closing curly bracked ("}") would not be allowed in
any kind of properties value manipulated by the
PropertyPlaceHolderHelper. Another possibility would be to implement
some sort of escaping using "\". 

What do you think?

Gruss
Richard


[1] https://issues.apache.org/jira/projects/TOMEE/issues/TOMEE-2968
[2] 
https://github.com/rzo1/tomee/commit/b32f0d1a1a9c787b51504a27fa4afdc84bcbc984
[3] 
https://github.com/apache/tomee/blob/c96221e93b0d11d594fd8b14c090224606cc1624/container/openejb-core/src/main/java/org/apache/openejb/util/PropertyPlaceHolderHelper.java

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to