kolasu icon indicating copy to clipboard operation
kolasu copied to clipboard

Minor code improvements on LIonWeb

Open psuzzi opened this issue 6 months ago • 0 comments

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 nested if-else ones, e.g. in JSONComparison
  • get rid of the .asJsonObject in favor of is smart-casting, e.g. in JSONComparison
  • Add the JsonPrimitive case in JSONComparison
  • Apply @Synchronized instead of explicit synchronized blocks, e.g. in BiMap
  • execute containment checks with the in operator instead of containsKeys(), 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

psuzzi avatar Aug 22 '24 14:08 psuzzi