groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul King (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (GROOVY-8769) unexpected token: > error while build in Maven. Java lambda error
Date Tue, 28 Aug 2018 22:53:00 GMT

    [ https://issues.apache.org/jira/browse/GROOVY-8769?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16595679#comment-16595679
] 

Paul King edited comment on GROOVY-8769 at 8/28/18 10:52 PM:
-------------------------------------------------------------

What version of Groovy are you using? Lambda syntax is a feature of the Parrot parser in Groovy
3 (currently in alpha).

The following works fine for me in the groovyConsole using Groovy 3:
{code}
import static java.util.stream.Collectors.toList
def nums = [1, 20, 300, 50, 6]
assert nums.stream().filter(num -> num.toString().size() == 2).collect(toList()) == [20,
50]
{code}
But fails as expected in 2.5.2 with a similar but not identical error to yours:
{noformat}
unexpected token: -> at line: 3, column: 33
{noformat}


was (Author: paulk):
What version of Groovy are you using? The following works fine for me in the groovyConsole
using Groovy 3:
{code}
import static java.util.stream.Collectors.toList
def nums = [1, 20, 300, 50, 6]
assert nums.stream().filter(num -> num.toString().size() == 2).collect(toList()) == [20,
50]
{code}
But fails as expected in 2.5.2 with a similar but not identical error to yours:
{noformat}
unexpected token: -> at line: 3, column: 33
{noformat}

> unexpected token: > error while build in Maven. Java lambda error
> -----------------------------------------------------------------
>
>                 Key: GROOVY-8769
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8769
>             Project: Groovy
>          Issue Type: Bug
>            Reporter: srujana
>            Priority: Major
>
> {noformat}
> /var/www/mavenBuild/Job-825/ ABCController.java:209:44: unexpected token: >
> [INFO] /var/www/mavenBuild/Job-825ABCAction.java:257:64: unexpected token: >
> [INFO] /var/www/mavenBuild/Job-825/ABCController.java:209:44: unexpected token: >
> [INFO] /var/www/mavenBuild/Job-825/ABCAction.java:257:64: unexpected token: >
> {noformat}
>  
> {noformat}
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.0:site (default-site)
on project ActionRequest: Error during page generation: Error rendering Maven report: Parsing
error while executing JavaNCSS 33.54 ParseException in /var/www/mavenBuild/Job-825/ABCController.java
> [INFO] [ERROR] Last useful checkpoint: "com.wc.ar.controller.ABCController.loadActionRequestSupervisor(ModelMap,Integer)"
> [INFO] [ERROR] Encountered " ">" "> "" at line 209, column 72. Encountered " ">"
"> "" at line 257, column 85.
> {noformat}
> {noformat}
> this.documents = this.actionDocuments.stream().filter(doct -> doct.getToUserID() ==
null)
> .collect(Collectors.toList());
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message