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

Projects
None yet
1 participant
@lombokissues
Collaborator

lombokissues commented Jul 14, 2015

Migrated from Google Code (issue 793)

@lombokissues

This comment has been minimized.

Show comment
Hide comment
@lombokissues

lombokissues Jul 14, 2015

Collaborator

👤 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

Collaborator

lombokissues commented Jul 14, 2015

👤 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

This comment has been minimized.

Show comment
Hide comment
@lombokissues

lombokissues Jul 14, 2015

Collaborator

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

Correction it fails regardless of the builderMethodName

Collaborator

lombokissues commented Jul 14, 2015

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

Correction it fails regardless of the builderMethodName

@lombokissues

This comment has been minimized.

Show comment
Hide comment
@lombokissues

lombokissues Jul 14, 2015

Collaborator

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

It also fails on ctors.

Collaborator

lombokissues commented Jul 14, 2015

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

It also fails on ctors.

@lombokissues

This comment has been minimized.

Show comment
Hide comment
@lombokissues

lombokissues Jul 14, 2015

Collaborator

👤 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.

Collaborator

lombokissues commented Jul 14, 2015

👤 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

This comment has been minimized.

Show comment
Hide comment
@lombokissues

lombokissues Jul 14, 2015

Collaborator

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

No problem. Sorry for my horrible spelling!

Collaborator

lombokissues commented Jul 14, 2015

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

No problem. Sorry for my horrible spelling!

@lombokissues

This comment has been minimized.

Show comment
Hide comment
@lombokissues

lombokissues Jul 14, 2015

Collaborator

End of migration

Collaborator

lombokissues commented Jul 14, 2015

End of migration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment