3 ms·
I found what it generates. https://github.com/pediredla/Algorithms/pull/3/files https://github.com/pediredla/Algorithms/pull/3/files It looks like a linter, b
by veselin 7y ago
I found what it generates.
https://github.com/pediredla/Algorithms/pull/3/files https://github.com/pediredla/Algorithms/pull/3/files
It looks like a linter, but maybe there is more.
- faitswulff 7y agoI've never seen a linter tell me problems with code in this detail before: > You are using a `ConcurrentHashMap`, but your usage of `get()` and `put()` may not be thread-safe at lines: 110, 113, 135, and 137. Two threads can perform this same check at the same time and one thread can overwrite the value written by the other thread.
- stock_toaster 7y agostaticccheck for Go does _some_ of this kind of thing (documenting improper usage). https://staticcheck.io/docs/checks https://staticcheck.io/docs/checks
- Yeroc 7y agoSonarQube does as well. I've been shocked at some of the analysis it does.
- senko 7y agoMany linters are state-aware, for example to catch use-before-init bugs in various languages. This one could be a fairly simple rule ConcurrentHashMap.get() followed by some code that branches on the result, followed by put() is unsafe. These warnings can be very helpful, but no fairy ML magic needed.
- scarejunba 7y agoPretty sure you can turn on that inspection in IntelliJ. The other ones are much more impressive. The 'waiters' one for instance is gold.