View Javadoc
1   /*
2   com.puppycrawl.tools.checkstyle.checks.naming.MemberNameCheck
3   format = (default)^[a-z][a-zA-Z0-9]*$
4   applyToPublic = (default)true
5   applyToProtected = (default)true
6   applyToPackage = (default)true
7   applyToPrivate = (default)true
8   
9   
10  */
11  
12  package com.puppycrawl.tools.checkstyle.grammar;
13  import java.lang.reflect.ParameterizedType;
14  import java.lang.reflect.WildcardType;
15  import java.util.List;
16  
17  public class InputMultiDimensionalArraysInGenerics { // ok
18  
19      @SuppressWarnings("unused")
20      void withUpperBound(List<? extends int[][]> list) {}
21  
22      @SuppressWarnings("unused")
23      void withLowerBound(List<? super String[][]> list) {}
24  
25      @SuppressWarnings("unused")
26      void withLowerBound2(List<? super String[][][]> list) {}
27  
28      static WildcardType getWildcardType(String methodName) throws Exception {
29        ParameterizedType parameterType = (ParameterizedType)
30            WildcardType.class
31                .getDeclaredMethod(methodName, List.class)
32                .getGenericParameterTypes()[0];
33        return (WildcardType) parameterType.getActualTypeArguments()[0];
34      }
35  
36  }