@ItemClick and type parameters workaround #570

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants
@rom1v
Contributor

rom1v commented Apr 22, 2013

This piece of code does not generate compilable code (see #504):

    @ItemClick
    void listItemClicked(List<String> item) {}

I think the problem comes from CodeModel.

I propose a workaround which generates compilable code (but with a type safety warning).

@ItemClick and type parameters workaround
This piece of code does not generate compilable code (see #504):

    @ItemClick
    void listItemClicked(List<String> item) {}

This is a workaround for a bug supposed to be in CodeModel.
The generated code generates a type safety warning.
@DayS

This comment has been minimized.

Show comment
Hide comment
@DayS

DayS May 17, 2013

We shouldn't do this kind of tricks in the code. There is other way to check if an Element is generic or not and give only the base class.
I think APTCodeModelHelper.typeMirrorToJClass should work fine here instead of holder.refClass(parameterTypeQualifiedName). Could you test that ?

DayS commented on 39b879e May 17, 2013

We shouldn't do this kind of tricks in the code. There is other way to check if an Element is generic or not and give only the base class.
I think APTCodeModelHelper.typeMirrorToJClass should work fine here instead of holder.refClass(parameterTypeQualifiedName). Could you test that ?

@DayS

This comment has been minimized.

Show comment
Hide comment
@DayS

DayS May 23, 2013

Contributor

ping :)

Contributor

DayS commented May 23, 2013

ping :)

@rom1v

This comment has been minimized.

Show comment
Hide comment
@rom1v

rom1v May 23, 2013

Contributor

We shouldn't do this kind of tricks in the code.

I agree, this was a workaround. I searched how to do that with CodeModel, it seemed impossible.

Maybe APTCodeModelHelper.typeMirrorToJClass make it possible, I have not looked at it yet.

Maybe later ;-)

Contributor

rom1v commented May 23, 2013

We shouldn't do this kind of tricks in the code.

I agree, this was a workaround. I searched how to do that with CodeModel, it seemed impossible.

Maybe APTCodeModelHelper.typeMirrorToJClass make it possible, I have not looked at it yet.

Maybe later ;-)

@DayS

This comment has been minimized.

Show comment
Hide comment
@DayS

DayS Jun 18, 2013

Contributor

Sorry for @rom1v. @yDelouis has been faster :)

Contributor

DayS commented Jun 18, 2013

Sorry for @rom1v. @yDelouis has been faster :)

@DayS DayS closed this Jun 18, 2013

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