amique
amique

Reputation: 2226

CheckStyle 5.7.0. with Java 8

I am using Checkstyle Plug-in 5.7.0 in eclipse with Java 8. I am getting Got an exception - expecting EOF, found 'throw' in my interface default method. Can you please help me how to fix my checkstyle. Following is the method

default void validate(final String fieldName) {
    if (StringUtils.isEmpty(fieldValue)) {
        throw new RuntimeException(""); //check style error here
    }
}

Even if I remove the method body, i get the same error on the ending brace. It seems that checkstyle is not supporting a method with body in interface.

Upvotes: 1

Views: 2803

Answers (1)

barfuin
barfuin

Reputation: 17474

That is not your fault - Checkstyle does not support Java 8 syntax yet. (This is true for version 5.7, which is the most current version at the time of this writing.)

However, the Checkstyle team and especially the contributors are working hard on it, and Java 8 support is announced to be released before October 15, 2014 (according to the October 4 comment by Roman Ivanov, one of the Checkstyle committers).

So, think the best strategy is to wait for a few more days. :-)

Upvotes: 2

Related Questions