Skip to content

Commit bb45bce

Browse files
committed
Added comment about why the deep copy needs to be made
1 parent 403ae8c commit bb45bce

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

core/src/main/python/wlsdeploy/tool/validate/validator.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,10 @@ def validate_in_standalone_mode(self, model_dict, variables_file_name=None, arch
109109
"""
110110
_method_name = 'validate_in_standalone_mode'
111111

112+
# We need to make a deep copy of model_dict here, to ensure it's
113+
# treated as a "read-only'" reference variable, during the variable
114+
# file validation process. The variable file validation process could
115+
# actually require changes to be made to the cloned model dictionary
112116
cloned_model_dict = copy.deepcopy(model_dict)
113117

114118
self._logger.entering(variables_file_name, archive_file_name, class_name=_class_name, method_name=_method_name)
@@ -140,6 +144,10 @@ def validate_in_tool_mode(self, model_dict, variables_file_name=None, archive_fi
140144
"""
141145
_method_name = 'validate_in_tool_mode'
142146

147+
# We need to make a deep copy of model_dict here, to ensure it's
148+
# treated as a "read-only'" reference variable, during the variable
149+
# file validation process. The variable file validation process could
150+
# actually require changes to be made to the cloned model dictionary
143151
cloned_model_dict = copy.deepcopy(model_dict)
144152

145153
self._logger.entering(variables_file_name, archive_file_name, class_name=_class_name, method_name=_method_name)

0 commit comments

Comments
 (0)