Detector: | DMMC |
Target: | project ' synthetic ' versionsetfirst |
Misuse: | misuse ' setfirst ' |
Tags: |
Details about the known misuse from the MUBench dataset.
Description: | To get one (arbitrary) value from a set you can call Set.iterator().next(), but this throws if the set is empty. |
Fix Description: | Check that Set.isEmpty() is false. |
Violation Types: |
|
In File: | SetFirst.java |
In Method: | misuse(Set) |
Code with Misuse: |
|
Code with Pattern(s): |
|