Github user kiuby88 commented on a diff in the pull request:
https://github.com/apache/brooklyn-server/pull/136#discussion_r63156200
--- Diff:
software/base/src/main/java/org/apache/brooklyn/entity/software/base/InboundPortsUtils.java
---
@@ -77,12 +82,17 @@
Set<ConfigKey<?>> configKeys =
Sets.newHashSet(extraConfigKeys);
configKeys.addAll(entity.getEntityType().getConfigKeys());
// Also add dynamically added config keys
-
configKeys.addAll(((EntityInternal)entity).config().getBag().getAllConfigAsConfigKeyMap().keySet());
+ Map<ConfigKey<?>, ?> configuredConfigKeys =
ImmutableMap.copyOf(((EntityInternal)
entity).config().getBag().getAllConfigAsConfigKeyMap());
+ configKeys.addAll(configuredConfigKeys.keySet());
--- End diff --
First, I started to use directly the `((EntityInternal)
entity).config().getBag().getAllConfigAsConfigKeyMap()` but I found an
exception when this tests was executed, because the entity was accessed by
another thread (I found and `InterruptedException` what threw a NPE.
Then, I decided to use some intermediate element, I used an immutable
because the Map should not be modified. Does it make sense?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---