samratdhillon commented on a change in pull request #5373:
URL: https://github.com/apache/camel/pull/5373#discussion_r614028366
##########
File path:
core/camel-support/src/main/java/org/apache/camel/support/AbstractExchange.java
##########
@@ -886,4 +912,32 @@ public String toString() {
}
}
+ @Override
+ public void setCopySafeProperty(String key, CamelCopySafeProperty<?>
value) {
+ if (value != null) {
+ // avoid the NullPointException
+ if (copySafeProperties == null) {
+ this.copySafeProperties = new ConcurrentHashMap<>(2);
+ }
+ copySafeProperties.put(key, value);
+ } else if (copySafeProperties != null) {
+ // if the value is null, we just remove the key from the map
+ copySafeProperties.remove(key);
+ }
+
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public <T> T getCopySafeProperty(String key, Class<T> type) {
+
+ Object value = getCopySafeProperties().get(key);
Review comment:
Thanks @davsclaus . Updated the PR based on your feedback.
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]