Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor code improvements on LIonWeb #377

Open
psuzzi opened this issue Aug 22, 2024 · 0 comments
Open

Minor code improvements on LIonWeb #377

psuzzi opened this issue Aug 22, 2024 · 0 comments

Comments

@psuzzi
Copy link

psuzzi commented Aug 22, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant