kolasu
kolasu copied to clipboard
Minor code improvements on LIonWeb
I took a look at the com.strumenta.kolasu.lionweb, and found a few improvements I suggest to implement:
- Use of
when
statements instead of nestedif-else
ones, e.g. in JSONComparison - get rid of the
.asJsonObject
in favor ofis
smart-casting, e.g. in JSONComparison - Add the JsonPrimitive case in JSONComparison
- Apply
@Synchronized
instead of explicitsynchronized
blocks, e.g. in BiMap - execute containment checks with the
in
operator instead ofcontainsKeys()
, e.g. in BiMap - improve thread safety with mutex.withLock, e.g. in PerformanceLogger
- add a
try
-finally
block where operations are executed, e.g. in PerformanceLogger#log
A PR will follow