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

Parameterized static methods with @Builder fail to compile in javac (8u25) if builderMethodName is set. Works fine in Eclipse. #828

Closed
lombokissues opened this issue Jul 14, 2015 · 6 comments

Comments

@lombokissues
Copy link

Migrated from Google Code (issue 793)

@lombokissues
Copy link
Author

👤 jeff.maxwell   🕗 Feb 27, 2015 at 14:18 UTC

Parametrized methods with @ Buiilder fail to compile in javac if builderMethodName is set. Eclipse is fine.

/**
* Without builder method name.
*
* Compiles and runs in eclipse and javac
*
* @ param <COMPARABLE> the generic type
* @ param comparableSet the comparable set
* @ return the list
*/
@ Builder(builderClassName = "FirstListOfSortedSetsBuilder")
static <COMPARABLE extends Comparable<?>> List<SortedSet<COMPARABLE>> withoutBuilderMethodName(
SortedSet<COMPARABLE> sortedSet) {
return ImmutableList.of(sortedSet);
}

/**
 * With builder method name.
 * Compiles and runs in eclipse.
 *
 * DOES NOT COMPILE IN JAVAC:
 * error: incompatible types: List&lt;SortedSet&lt;COMPARABLE﹟1&gt;&gt; cannot be converted to  List&lt;SortedSet&lt;COMPARABLE﹟2&gt;&gt;
 *
 * @ param &lt;COMPARABLE&gt; the generic type
 * @ param comparableSet the comparable set
 * @ return the list
 */
@ Builder(builderClassName = &quot;SecondListOfSortedSetsBuilder&quot;, builderMethodName = &quot;newListOfSortedSetsBuilder&quot;)
static &lt;COMPARABLE extends Comparable&lt;?&gt;&gt; List&lt;SortedSet&lt;COMPARABLE&gt;&gt; withBuilderMethodName(
        SortedSet&lt;COMPARABLE&gt; sortedSet) {
    return ImmutableList.of(sortedSet);
}

Java 8u25
Lombok 1.16.2

@lombokissues
Copy link
Author

👤 jeff.maxwell   🕗 Feb 27, 2015 at 15:18 UTC

Correction it fails regardless of the builderMethodName

@lombokissues
Copy link
Author

👤 jeff.maxwell   🕗 Feb 27, 2015 at 15:46 UTC

It also fails on ctors.

@lombokissues
Copy link
Author

👤 reinierz   🕗 May 15, 2015 at 10:14 UTC

Well spotted, and thanks a lot for your in-depth test case on the forums.

The bug has been fixed and will be in the next release.

@lombokissues
Copy link
Author

👤 jeff.maxwell   🕗 May 15, 2015 at 12:42 UTC

No problem. Sorry for my horrible spelling!

@lombokissues
Copy link
Author

End of migration

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

1 participant