Github user michaelandrepearce commented on a diff in the pull request:
https://github.com/apache/activemq-artemis/pull/2328#discussion_r220369406
--- Diff:
artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/TypedProperties.java
---
@@ -1056,4 +1107,26 @@ public static void setObjectProperty(final
SimpleString key, final Object value,
throw new ActiveMQPropertyConversionException(value.getClass() +
" is not a valid property type");
}
}
+
+
+
+ private <T> T withWriteLock(Supplier<T> supplier) {
+ long lock = this.writeLock();
+ try {
+ return supplier.get();
+ } finally {
+ this.unlockWrite(lock);
+ }
+ }
+
+ private <T> T withReadLock(Supplier<T> supplier) {
--- End diff --
@franz1981 soo it turned out, after trying to eliminate a couple of the
lamda's i spotted that were showing up, it got more messy than just doing it
"old skool" like you suggested so after all it became cleaner....glad you
challenged this :)
---