Description: | In line 69, Iterator.next() is invoked without a prior check whether there
is a next element. From the conditions line 64 we take that classNames might
be null , empty, or contain exactly one element.
(Same as Tikanga finding 0 and MuDetect finding 0) |
In Method: | createCustomizedSuite(String, Collection, Collection, Collection, Collection, Map, String, int) |
Code with Misuse: |
class SuiteGenerator { /** * @deprecated use {@link #createSuite(String, java.util.Collection, java.util.Map, * java.util.Collection, java.util.Map, String, int)} instead. */ @Deprecated public static LaunchSuite createCustomizedSuite(String projectName, Collection<String> packageNames, Collection<String> classNames, Collection<String> methodNames, Collection<String> groupNames, Map<String, String> parameters, String annotationType, int logLevel) { if ((null != groupNames) && !groupNames.isEmpty()) { return new LaunchSuite.ClassListSuite(projectName, packageNames, classNames, groupNames, parameters, annotationType, logLevel); } else if ((classNames != null && classNames.size() > 1) || packageNames != null && packageNames.size() > 0) { return new LaunchSuite.ClassListSuite(projectName, packageNames, classNames, groupNames, parameters, annotationType, logLevel); } else { return new LaunchSuite.MethodsSuite(projectName, classNames.iterator().next(), methodNames, parameters, annotationType, logLevel); } }
}
|