maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Zoltan Farkas (JIRA)" <j...@apache.org>
Subject [jira] [Created] (MPLUGIN-343) syntax error with lambdas
Date Sat, 06 Oct 2018 15:46:00 GMT
Zoltan Farkas created MPLUGIN-343:
-------------------------------------

             Summary: syntax error with lambdas
                 Key: MPLUGIN-343
                 URL: https://issues.apache.org/jira/browse/MPLUGIN-343
             Project: Maven Plugin Tools
          Issue Type: Bug
    Affects Versions: 3.5.2
            Reporter: Zoltan Farkas


Error:

maven-plugin-plugin:3.5.2:descriptor failed: syntax error @[42,18] in file:/Users/zoly/NetBeansProjects/spf4j/spf4j-jdiff-maven-plugin/target/generated-sources/spf4j-core/org/spf4j/base/ReferenceType.java


on code:

{code}
// blabla license comments
package org.spf4j.base;

import java.lang.ref.Reference;
import java.lang.ref.SoftReference;
import java.lang.ref.WeakReference;
import java.util.function.Function;


public enum ReferenceType {

    WEAK((Object object) -> new WeakReference<>(object)),
    SOFT((Object object) -> new SoftReference<>(object));


    private final Function<Object, Reference<Object>> factory;

    ReferenceType(final Function<Object, Reference<Object>> factory) {
        this.factory = factory;
    }

    public <T> Reference<T> create(final T object) {
        return (Reference<T>) factory.apply(object);
    }

}
{code}



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

Mime
View raw message