Fix misuse of Properties.put (ClassCastException)

Properties are meant to store String values (corresponding to String
keys). The change fixes a case where a Boolean was put in the
properties which breaks callers who assume only Strings are stored
in Properties.

The Properties javadoc is qute clear about this:
"Because <code>Properties</code> inherits from <code>Hashtable</code>,
the <code>put</code> and <code>putAll</code> methods can be applied to a
<code>Properties</code> object.  Their use is strongly discouraged as
they allow the caller to insert entries whose keys or values are not
<code>Strings</code>.  The <code>setProperty</code> method should be
used instead.  If the <code>store</code> or <code>save</code> method is
called on a "compromised" <code>Properties</code> object that contains a
non-<code>String</code> key or value, the call will fail."

More specifically, we have seen a ClassCastException while running
SonarQube analysis in the presense of RCPTT.

See https://groups.google.com/forum/#!topic/sonarqube/fBXIHa6kXcU

Change-Id: Ibe8b281bb641f672856a3306187a2e1d0552b114
Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
1 file changed