kwin commented on code in PR #1015:
URL: https://github.com/apache/jackrabbit-oak/pull/1015#discussion_r1276214791
##########
oak-core-spi/src/main/java/org/apache/jackrabbit/oak/osgi/OsgiWhiteboard.java:
##########
@@ -69,13 +69,13 @@ public <T> Registration register(
Objects.requireNonNull(properties);
checkArgument(type.isInstance(service));
- Dictionary<Object, Object> dictionary = new Hashtable<Object,
Object>();
+ Dictionary<String, Object> dictionary = new Hashtable<>();
for (Map.Entry<?, ?> entry : properties.entrySet()) {
- dictionary.put(entry.getKey(), entry.getValue());
+ dictionary.put((String)entry.getKey(), entry.getValue());
Review Comment:
cast is safe, because `Property` always only expose String, String pairs
(https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html). Compare
with
https://stackoverflow.com/questions/873510/why-does-java-util-properties-implement-mapobject-object-and-not-mapstring-st
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]