Restrict upper bound of generic

This commit is contained in:
Juan Martín Sotuyo Dodero
2018-06-09 20:08:22 -03:00
parent 226d4c7c07
commit 914293daad

View File

@ -195,7 +195,7 @@ public class GuardLogStatementRule extends AbstractJavaRule implements Rule {
* @return the found child node or <code>null</code>
*/
@SafeVarargs
private static <N> N getFirstChild(Node root, Class<? extends Node> ... childrenTypes) {
private static <N extends Node> N getFirstChild(Node root, Class<? extends Node> ... childrenTypes) {
Node current = root;
for (Class<? extends Node> clazz : childrenTypes) {
Node child = current.getFirstChildOfType(clazz);