akshattandon / projectlombok

Automatically exported from code.google.com/p/projectlombok
0 stars 0 forks source link

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

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
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<SortedSet<COMPARABLE#1>> cannot be converted to  List<SortedSet<COMPARABLE#2>>
     *
     * @param <COMPARABLE> the generic type
     * @param comparableSet the comparable set
     * @return the list
     */
    @Builder(builderClassName = "SecondListOfSortedSetsBuilder", builderMethodName = "newListOfSortedSetsBuilder")
    static <COMPARABLE extends Comparable<?>> List<SortedSet<COMPARABLE>> withBuilderMethodName(
            SortedSet<COMPARABLE> sortedSet) {
        return ImmutableList.of(sortedSet);
    }

Java 8u25
Lombok 1.16.2

Original issue reported on code.google.com by jeff.max...@gmail.com on 27 Feb 2015 at 2:18

GoogleCodeExporter commented 9 years ago
Correction it fails regardless of the builderMethodName

Original comment by jeff.max...@gmail.com on 27 Feb 2015 at 3:18

GoogleCodeExporter commented 9 years ago
It also fails on ctors.

Original comment by jeff.max...@gmail.com on 27 Feb 2015 at 3:46

GoogleCodeExporter commented 9 years ago
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.

Original comment by reini...@gmail.com on 15 May 2015 at 10:14

GoogleCodeExporter commented 9 years ago
No problem. Sorry for my horrible spelling!

Original comment by jeff.max...@gmail.com on 15 May 2015 at 12:42

GoogleCodeExporter commented 9 years ago

Original comment by r.spilker on 15 May 2015 at 12:56