#567 Check for interface type parameter name

Future
open
nobody
None
5
2014-10-09
2011-04-13
Anonymous
No

Checkstyle have two good checks: ClassTypeParameterName ad MethodTypeParameterName.
However there seems to be no way to check for type parameter name of the interface.
Suggestion is to extend ClassTypeParameterName with this functionality or write a new check InterfaceTypeParameterName - what is more appropriate. Actually, I can do it if more experienced checkstyle developer would tell what way of these two should be adopted.

Little example ("Input" is not reported as wrong type parameter name with both ClassTypeParameterName and MethodTypeParameterName turned on with default regexp):

<code>
interface Boo<Input> {
    Input boo();
}
</code>

Discussion

  • Thomas Jensen
    Thomas Jensen
    2014-06-23

    This would be really helpful.
    The link to the patch posted above has gone dead unfortunately.

     
  • Roman Ivanov
    Roman Ivanov
    2014-06-24

    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -3,9 +3,11 @@
     Suggestion is to extend ClassTypeParameterName with this functionality or write a new check InterfaceTypeParameterName - what is more appropriate. Actually, I can do it if more experienced checkstyle developer would tell what way of these two should be adopted.
    
     Little example ("Input" is not reported as wrong type parameter name with both ClassTypeParameterName and MethodTypeParameterName turned on with default regexp):
    +
    +~~~~~~
     <code>
     interface Boo<Input> {
        Input boo();
     }
     </code>
    -
    +~~~~~~
    
    • Group: --> Future