You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by Manuel Sugawara <ma...@gmail.com> on 2011/09/05 18:46:36 UTC

Compiling tapestry with OpenJDK

Hi,

Over the weekend I tried to compile tapestry using OpenJDK and failed with
some problems with generics (mostly due the use of static methods in
CollectionsFactory). I diged a bit into this and here are my findings: some
errors are due the lack of the generic parameter when calling newList, ej
insted of writing CollectionsFactory.<String>newList() it was written
as CollectionsFactory.newList(). The rest of the problems is what I would
categorize as OpenJDK compiler bug, which is unable to figure out in some
contexts that a call to CollectionsFactory.newList(V... elements) will
return a list of V. Funny enough, while a construct like:

    String str = ...
    callMethodExpectingListOfStrings(CollectionsFactory.newList(str))

fail, the following construct does not:

    String str = ...
    List<String> lst = CollectionsFactory.newList(element);
    callMethodExpectingListOfStrings(lst)

I have attached a patch to solve those problems. With this patch tapestry
compiles just fine using OpenJDK. Should I open a Jira issue for this?

Regards,
Manuel.

Re: Compiling tapestry with OpenJDK

Posted by Manuel Sugawara <ma...@gmail.com>.
On Mon, Sep 5, 2011 at 2:19 PM, Kalle Korhonen
<ka...@gmail.com>wrote:

> Please do open an issue, all patches should go through jira.
>


Done, https://issues.apache.org/jira/browse/TAP5-1636

Regards,
Manuel.

Re: Compiling tapestry with OpenJDK

Posted by Kalle Korhonen <ka...@gmail.com>.
Please do open an issue, all patches should go through jira.

Kalle


On Mon, Sep 5, 2011 at 9:46 AM, Manuel Sugawara
<ma...@gmail.com> wrote:
> Hi,
> Over the weekend I tried to compile tapestry using OpenJDK and failed with
> some problems with generics (mostly due the use of static methods in
> CollectionsFactory). I diged a bit into this and here are my findings: some
> errors are due the lack of the generic parameter when calling newList, ej
> insted of writing CollectionsFactory.<String>newList() it was written
> as CollectionsFactory.newList(). The rest of the problems is what I would
> categorize as OpenJDK compiler bug, which is unable to figure out in some
> contexts that a call to CollectionsFactory.newList(V... elements) will
> return a list of V. Funny enough, while a construct like:
>     String str = ...
>     callMethodExpectingListOfStrings(CollectionsFactory.newList(str))
> fail, the following construct does not:
>     String str = ...
>     List<String> lst = CollectionsFactory.newList(element);
>     callMethodExpectingListOfStrings(lst)
> I have attached a patch to solve those problems. With this patch tapestry
> compiles just fine using OpenJDK. Should I open a Jira issue for this?
> Regards,
> Manuel.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org