Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#196 NoWhiteSpaceAfterCheck and methods

release_3.3
closed
Rick Giles
Other (70)
5
2012-10-10
2004-01-10
JC Lopez
No

Hi
I was testing some code with NoWhiteSpaceAfterCheck but
it doesn't seem to catch whitespace after a method or
constructor. According to Sun standards:

6.4 Class and Interface Declarations

int emptyMethod() {} //RIGHT

int emptyMethod () {} //WRONG
^-----------------
There should be no space between emptyMethod and the
left parenthesis. The only way that the check will
recognize this and mark it as an error/warning is by
adding the TokenType IDENT to the getDefaultTokens()
but that will detect it for every single IDENT! which
is not what we want.

JC

Discussion

  • Logged In: YES
    user_id=746148

    I think this is the same as rfe #843254 (Check for space
    between method name and LPAREN)

     
  • JC Lopez
    JC Lopez
    2004-01-13

    Logged In: YES
    user_id=907099

    Yes it is the same RFE #843254, do you guys have a
    workaround? Possibly if NoWhiteSpaceAfter or
    NoWhiteSpaceBefore can check specifically lines that contain
    methods and classes?
    JC

     
  • Rick Giles
    Rick Giles
    2004-01-21

    Logged In: YES
    user_id=539926

    MethodParamPadCheck of the 3.4 CVS handles this. Changed
    Resolution to Invalid because NoWhiteSpaceAfterCheck
    performs as documented.