This is an automated email from the ASF dual-hosted git repository.

iuliana pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git


The following commit(s) were added to refs/heads/master by this push:
     new ef50143  Added comment to explain immutable log and demoted it to trace
     new e00cada  Merge pull request #1170 from iuliana/master
ef50143 is described below

commit ef50143e52bd92ad56d57716f2a5bdaeda97452e
Author: iuliana <[email protected]>
AuthorDate: Tue May 4 20:03:32 2021 +0100

    Added comment to explain immutable log and demoted it to trace
---
 .../main/java/org/apache/brooklyn/core/objs/BasicSpecParameter.java | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git 
a/core/src/main/java/org/apache/brooklyn/core/objs/BasicSpecParameter.java 
b/core/src/main/java/org/apache/brooklyn/core/objs/BasicSpecParameter.java
index 55ecbf9..ff57b31 100644
--- a/core/src/main/java/org/apache/brooklyn/core/objs/BasicSpecParameter.java
+++ b/core/src/main/java/org/apache/brooklyn/core/objs/BasicSpecParameter.java
@@ -293,7 +293,11 @@ public class BasicSpecParameter<T> implements 
SpecParameter<T>{
             }
             
             if (type != null && !TypeTokens.isInstanceRaw(type, result)) {
-                log.warn("Unable to convert parameter default value (type 
"+type+") to immutable");
+                // a Map is not the desired type, but val is a Map that will 
likely be coerced to the type later
+                // in case val is a special subtype of map, do not return 
unmodifiableMap but preffer the actual defined instance
+                // there is a chance a developer might change val because it 
is not mutable
+                // however there are plenty of valid paths to get here
+                log.trace("Unable to convert parameter default value (type 
"+type+") to immutable");
                 return val;
             } else {
                 return result;

Reply via email to