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

#583 Syntax error: .class operator

release_5.0
closed
Oliver Burn
5
2013-11-10
2009-07-22
costamojan
No

Just look at the following methods:

public boolean isPrimitive1( Class<?> type ) {
return(
(Boolean . class == type) ||
(Byte . class == type) ||
(Character . class == type) ||
(Short . class == type) ||
(Integer . class == type) ||
(Long . class == type) ||
(Float . class == type) ||
(Double . class == type)
);
}

public boolean isPrimitive2( Class<?> type ) {
return(
(boolean . class == type) ||
(byte . class == type) ||
(char . class == type) ||
(short . class == type) ||
(int . class == type) ||
(long . class == type) ||
(float . class == type) ||
(double . class == type)
);
}

The second method which uses primitive types causes an error marker which
says that an 'EOF' is expected rather than a '}' and the methods closing
brace. Obviously the parsing process is not properly working.
I've added a little sample project with a configuration in order to
reproduce this problem. This issue might probably related to
id 1304009 .

Discussion

  • costamojan
    costamojan
    2009-07-22

    Sample project presenting the error (requires checkstyle-eclipse)

     
    Attachments
  • Roman Ivanov
    Roman Ivanov
    2013-11-10

    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,4 +1,3 @@
    -
    
     Just look at the following methods:
    
    • status: open --> closed