#567 Check for interface type parameter name

Future
closed
nobody
None
5
2015-11-02
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

  • Comment has been marked as spam. 
    Undo

    You can see all pending comments posted by this user  here

    Anonymous - 2012-06-27
     
  • 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
     
  • Roman Ivanov

    Roman Ivanov - 2015-11-02
    • status: open --> closed
     

Log in to post a comment.