Default Persister constructor violates contract
Brought to you by:
niallg
The JavaDocs for the default Persister constructor claim that the created object "will use an empty filter. This means that template variables will remain unchanged..."
However, this constructor is implemented by passing an empty HashMap to Persister(Map), which uses the passed Map in creating a PlatformFilter. A PlatformFilter with no user specified properties does not leave template variables unchanged, but rather attempts to resolve system properties and environment variables.
The default Persister constructor should be implemented as follows, to adhere to its contract:
public Persister() {
this(new MapFilter(Collections.emptyMap()));
}
Hi,
Right, this is something that should be changed. Ill ensure to change this.
Thanks,
Niall
Patch file to resolve this issue.
Any chance of getting this in the next release?
Is there a problem with this patch that kept it from making it into the 2.6.1 release?
This was the sixth release since the bug was reported. It would be useful to me to see this change committed.