kwin commented on code in PR #1015:
URL: https://github.com/apache/jackrabbit-oak/pull/1015#discussion_r1276661204
##########
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:
Not sure, as Generics should be a compile time thing only, but I left the
signature as is and clarified the javadoc just a bit. But throwing a
ClassCastException is better than silently using the toString() so I left the
cast.
--
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]