Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ElidedSemicolonAndRightBrace expected

I have the following code ("codes" is an array variable):

Arrays.asList(codes)
        .stream()
        .filter(code -> code.hasCountries())
        .sorted()
        .toArray()
        );

The compiler gives me the following error:

Syntax error on token ")", ElidedSemicolonAndRightBrace expected

What's wrong here?

like image 997
stefan.m Avatar asked Mar 22 '16 14:03

stefan.m


1 Answers

This error simply means that you have too many closing parenthesis. The code should be:

Arrays.asList(codes)
        .stream()
        .filter(code -> code.hasCountries())
        .sorted()
        .toArray();
like image 161
stefan.m Avatar answered Sep 22 '22 23:09

stefan.m