Reamer commented on a change in pull request #4263:
URL: https://github.com/apache/zeppelin/pull/4263#discussion_r793335077
##########
File path: zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/Note.java
##########
@@ -279,22 +284,36 @@ public void setDefaultInterpreterGroup(String
defaultInterpreterGroup) {
this.defaultInterpreterGroup = defaultInterpreterGroup;
}
- public Map<String, Object> getNoteParams() {
- return noteParams;
+ public ConcurrentHashMap<String, Object> getNoteParams() {
+ if (noteParams == null) {
+ return new ConcurrentHashMap<>();
+ }
+ return new ConcurrentHashMap<>(noteParams);
Review comment:
Why return a new ConcurrentHashMap?
I don't know if returning an Collections.unmodifiableMap might be a good
approach here.
This [code part
](https://github.com/apache/zeppelin/blob/master/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/Paragraph.java#L450-L455)
should be the only place where the map is edited from another class. Here qw
could force the class to create a new map to work on and then communicate it to
the Note.
--
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]