Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] @ExtensionMethod fails in Eclipse 2019-03 #2236

Closed
gadton opened this issue Sep 13, 2019 · 1 comment
Closed

[BUG] @ExtensionMethod fails in Eclipse 2019-03 #2236

gadton opened this issue Sep 13, 2019 · 1 comment

Comments

@gadton
Copy link

gadton commented Sep 13, 2019

Eclipse 2019-03 fails to compile code using ExtensionMethod whereas Maven does.

Eclipse is reporting
The method or(T, Supplier<T>) in the type MyExtensionsTest.MyExtensions is not applicable for the arguments (String)

Here's a simplified test to reproduce:

@ExtensionMethod(MyExtensions.class)
public class MyExtensionsTest {
    @Test
    public void test() {
        String v = "value";
        assertThat( v.or( () -> "default" ), equalTo( "value" ) );

        String n = null;
        assertThat( n.or( () -> "default" ), equalTo( "default" ) );
    }

    public static class MyExtensions {
        public static <T> T or( T object, Supplier<T> ifNullProducer ) {
            return object != null ? object : ifNullProducer.get();
        }
    }
}

lombok 1.18.10
eclipse 2019-03
java 11 (zulu11.31.11 winx64)
maven 3.6.1, same JDK

@rzwitserloot
Copy link
Collaborator

Duplicate of #1441

@rzwitserloot rzwitserloot marked this as a duplicate of #1441 Feb 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants