Property files and property names and duplicate properties.
Rod Widdowson
rdw at steadingsoftware.com
Tue Jun 5 09:52:45 EDT 2018
I think I know what the answer here is ("it sucks being you"), but I thought I'd check.
As background, during the review of the Jetty 9.4 jetty-base stuff on Friday we decided that for our own sanity we would need to
develop property name renaming technology so we can track the (often arbitrary) names changes that Jetty impose between releases.
So if in 9.4.1 it was "jetty.ssl.port" and in 9.4.2 it became "jetty.tls.port" we could deal with this on behalf of our end users
(who use our Jetty installation precisely so they don't have to worry about this sort of nonsense).
It turns out that this has some definite advantages for our packaging both in 3.4 and looking forward to 4.0.
So, being me, as I started coding this up I considered all the screw cases and hit upon this one.
The customer's property file is:
my.property.one=foo
my.property.two=bar
And for some reason it is decided to rename both of these properties to my.property.three. We obviously end up with a clash and
badness could occur.
The "Obvious" fix is to check for property duplication as we are doing the rename. But then we would warn (or, perhaps better,
fail) the install if someone already had a duplicate.
OTOH, that might be a useful feature anyway. If someone has a duplicate this is badness and having it detected during upgrade would
be useful - if not bullet proof with the IdP property files which are nested.
I should close by saying that this really is an edge condition in 3.4 and the badness is limited to already broken installs. There
are only a handful of properties and we can pretty much guarantee that the names will never collapse. So the only issue would be if
someone had managed to add a property with a new (about to be valid) name but an invalid value to the end of the property file.
jetty.ssl.port=8443
jetty.tls.port=8442 // Pointless property until V3.4
.....And we rename jetty.ssl.port to jetty.tls.port.
Since adding "jetty.tls.port" would be considered as breaking the install (the file says not to do that) we could default to a "we
told you not to do that" answer.
It may become more of an issue in V4 when there may more property renaming going on.
If anyone has any thoughts on this I'd be glad to hear them.
Ugh!
Rod
More information about the dev
mailing list