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

#456 Warning for multiple whitespaces used instead of one.

open
nobody
Check (274)
5
2012-10-10
2007-04-30
Deepak Jain
No

Hi

Currently, checkstyle gives warnings if whitespaces are not used at the appropriate places but it doesn't distinguish between one whitespace and muliple whitespaces.

For example both the below codes are fine :

if (Condition == true) {

and

if (Condition == true) {

Regards
Deepak

Discussion

  • Deepak Jain
    Deepak Jain
    2007-05-07

    Logged In: YES
    user_id=1781736
    Originator: YES

    Actually, the above codes are

    if (Condition == true) {

    and

    if (Condition == true) {

     
  • Dale King
    Dale King
    2007-05-07

    Logged In: YES
    user_id=130378
    Originator: NO

    It shouldn't be too difficult to come up with a check for multiple whitespaces that are not at the beginning of the line using the GenericIllegalRegexp, so I don't think there is a compelling reason to modify Checkstyle to add it. The most I would suggest is to add it as an example to GenericIllegalRegexp documentation.