maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Guillaume Boué (JIRA) <j...@apache.org>
Subject [jira] [Closed] (MPLUGIN-320) JavaJavadocMojoDescriptorExtractor fails with Java 8 lambdas.
Date Sun, 15 Jan 2017 12:21:26 GMT

     [ https://issues.apache.org/jira/browse/MPLUGIN-320?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Guillaume Boué closed MPLUGIN-320.
----------------------------------
       Resolution: Fixed
         Assignee: Guillaume Boué
    Fix Version/s: 3.5.1

> JavaJavadocMojoDescriptorExtractor fails with Java 8 lambdas.
> -------------------------------------------------------------
>
>                 Key: MPLUGIN-320
>                 URL: https://issues.apache.org/jira/browse/MPLUGIN-320
>             Project: Maven Plugin Tools
>          Issue Type: Bug
>          Components: maven-plugin-tools-java
>    Affects Versions: 3.5
>            Reporter: Antony Riley
>            Assignee: Guillaume Boué
>            Priority: Minor
>             Fix For: 3.5.1
>
>
> JavaJavadocMojoDescriptorExtractor fails to parse the following source:
> {code:java}
> package com.example.plugin;
> import com.amazonaws.AmazonWebServiceClient;
> import com.amazonaws.services.ecr.AmazonECRClient;
> import com.amazonaws.services.ecs.AmazonECSClient;
> import java.util.function.Supplier;
> public enum AmazonClients {
>     ECS(AmazonECSClient::new),
>     ECR(AmazonECRClient::new);
>     private final Supplier<? extends AmazonWebServiceClient> supplier;
>     <T extends AmazonWebServiceClient> AmazonClients(Supplier<T> supplier)
{
>         this.supplier = new SingletonSupplier<T>(supplier);
>     }
>     public <T extends AmazonWebServiceClient> T get() {
>         return (T) supplier.get();
>     }
>     private static class SingletonSupplier<T> implements Supplier<T> {
>         private final Supplier<T> realSupplier;
>         private T instance;
>         private SingletonSupplier(Supplier<T> realSupplier) {
>             this.realSupplier = realSupplier;
>         }
>         @Override
>         public synchronized T get() {
>             return instance == null ? instance = realSupplier.get() : instance;
>         }
>     }
> }
> {code}
> It fails on the lamdas in the constructors, this causes maven-plugin-plugin:helpmojo
to fail with the following exception:
> {noformat}
> Caused by: com.thoughtworks.qdox.parser.ParseException: syntax error @[10,24] in file:/home/antony/work/example/src/main/java/com/example/plugin/AmazonClients.java
>         at com.thoughtworks.qdox.parser.impl.Parser.yyerror(Parser.java:1739)
>         at com.thoughtworks.qdox.parser.impl.Parser.yyparse(Parser.java:1861)
>         at com.thoughtworks.qdox.parser.impl.Parser.parse(Parser.java:1720)
>         at com.thoughtworks.qdox.library.SourceLibrary.parse(SourceLibrary.java:232)
>         at com.thoughtworks.qdox.library.SourceLibrary.parse(SourceLibrary.java:209)
>         at com.thoughtworks.qdox.library.SourceLibrary.addSource(SourceLibrary.java:157)
>         at com.thoughtworks.qdox.library.SortedClassLibraryBuilder.addSource(SortedClassLibraryBuilder.java:173)
>         at com.thoughtworks.qdox.JavaProjectBuilder.addSource(JavaProjectBuilder.java:151)
>         at com.thoughtworks.qdox.JavaProjectBuilder$2.visitFile(JavaProjectBuilder.java:223)
>         at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(DirectoryScanner.java:103)
>         at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(DirectoryScanner.java:91)
>         at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(DirectoryScanner.java:91)
>         at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(DirectoryScanner.java:91)
>         at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(DirectoryScanner.java:91)
>         at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(DirectoryScanner.java:91)
>         at com.thoughtworks.qdox.directorywalker.DirectoryScanner.scan(DirectoryScanner.java:81)
>         at com.thoughtworks.qdox.JavaProjectBuilder.addSourceTree(JavaProjectBuilder.java:217)
>         at com.thoughtworks.qdox.JavaProjectBuilder.addSourceTree(JavaProjectBuilder.java:204)
>         at org.apache.maven.tools.plugin.extractor.javadoc.JavaJavadocMojoDescriptorExtractor.discoverClasses(JavaJavadocMojoDescriptorExtractor.java:625)
>         at org.apache.maven.tools.plugin.extractor.javadoc.JavaJavadocMojoDescriptorExtractor.execute(JavaJavadocMojoDescriptorExtractor.java:573)
>         at org.apache.maven.tools.plugin.scanner.DefaultMojoScanner.populatePluginDescriptor(DefaultMojoScanner.java:96)
>         at org.apache.maven.plugin.plugin.AbstractGeneratorMojo.execute(AbstractGeneratorMojo.java:283)
>         at org.apache.maven.plugin.plugin.HelpGeneratorMojo.execute(HelpGeneratorMojo.java:92)
>         at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
>         ... 21 more
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message