Sonar shows "ThreadGroup" error on the line where IllegalArgumentException is thrown.
Why is the issue here?
Here is the code snippet, where issue is found by Sonar:
public static ResolutionElection fromValue(String value) {
for (ResolutionElection election : ResolutionElection.values()) {
if (election.getValue().equals(value)) {
return election;
}
}
throw new java.lang.IllegalArgumentException();
}
Sonar error description:
Avoid Thread Group
Avoid using ThreadGroup; although it is intended to be used in a threaded environment it contains methods that are not thread safe.