Bug 547461 - Make all ProvidedCapability's ctors use immutable maps

ProvidedCapability(String, Map<String, Object>):
- (good) stores properties in an unmodifiable map
- (bad) properties still could be changed via original map
- (bad) would not create an empty version if missing
- (bad) holds a reference to the original map

ProvidedCapability(String, String, Version):
- (bad) stores properties in a mutable map

Always store properties as unmodifiable map to prevent their mutation
via getProperties().put(). As query operations on that map are "read
through" to the original map, first make a copy of original
properties.

Change-Id: If7cf15d153d72e4bedc30e9ad52423d5121f3fa2
Signed-off-by: Mykola Nikishov <mn@mn.com.ua>
2 files changed