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

problem with generics #1

Closed
flavienlaurent opened this issue Sep 20, 2013 · 6 comments
Closed

problem with generics #1

flavienlaurent opened this issue Sep 20, 2013 · 6 comments
Assignees

Comments

@flavienlaurent
Copy link
Collaborator

BoundBoxing a class with generics causes errors in the generated class (e.g. java.util.List<this.is.my.Object>.class)

Detailed issue: https://gist.github.com/flavienlaurent/6636457

@ghost ghost assigned stephanenicolas Sep 20, 2013
@stephanenicolas
Copy link
Owner

Thanks for reporting this bug. The first ! wouuuww :)

It will take a few days, not that many, for me to correct the bug. Just have to find time for it.

I would be very interested by a pull request (with tests), if you like patching it yourself.
I do invite with great pleasure new contributors to join.

(This feature / bug fix would be quite a good candidate for TDD style.)

@flavienlaurent
Copy link
Collaborator Author

I have to find time for it too but I will try to patch it

stephanenicolas added a commit that referenced this issue Sep 21, 2013
@stephanenicolas
Copy link
Owner

Issue should be solved on master branch. Your gist became a test. snapshots have been deployed on https://oss.sonatype.org/content/repositories/snapshots/org/boundbox/

@ffgiraldez
Copy link

I have the same problem but when generics are in Class like SpiceRequest
I have a class that extends SpiceRequest

public class MyRequest extends SpiceRequest<MyModel> {
    public MyRequest() {
        super(MyModel.class);
    }

   @Override
    public MyModel loadDataFromNetwork() throws Exception {
        return new MyModel();
    }
}

and in my test

public class MyRequestTest {
    @BoundBox(boundClass = MyRequest.class)
    private BoundBoxOfMyRequest request;
}

boundbox generated the nexts method un BoundBoxOfMyRequest class

public java.lang.Class<RESULT> boundBox_getResultType();

public RESULT boundBox_super_SpiceRequest_loadDataFromNetwork()

instead of

public java.lang.Class<MyModel> boundBox_getResultType();

public MyModel boundBox_super_SpiceRequest_loadDataFromNetwork()

@stephanenicolas
Copy link
Owner

Hi flavien,

I really don't have much time to enhance BB these days, and 'til Xmas.
I am really concerned by this bug, but I can't investigate it further right
now. Any pull request / work on that would be appreciated.

Funny that you were the first user to use BB with RS, and I wasn't :)

S.

2013/11/8 Fernando Franco Gíraldez [email protected]

I have the same problem but when generics are in Class like SpiceRequest
I have a class that extends SpiceRequest

public class MyRequest extends SpiceRequest {
public MyRequest() {
super(MyModel.class);
}

@OverRide
public MyModel loadDataFromNetwork() throws Exception {
return new MyModel();
}
}

and in my test

public class MyRequestTest {
@Boundbox(boundClass = MyRequest.class)
private BoundBoxOfMyRequest request;
}

boundbox generated the nexts method un BoundBoxOfMyRequest class

public java.lang.Class boundBox_getResultType();

public RESULT boundBox_super_SpiceRequest_loadDataFromNetwork()

instead of

public java.lang.Class boundBox_getResultType();

public MyModel boundBox_super_SpiceRequest_loadDataFromNetwork()


Reply to this email directly or view it on GitHubhttps://github.com//issues/1#issuecomment-28045658
.

Stéphane NICOLAS,
OCTO Technology
Développeur & Consultant Android / Java
..........................................................
50, Avenue des Champs-Elysées
75008 Paris
+33 (0)6.26.32.34.09
www.octo.com - mobilite.octo.com
blog.octo.com - www.usievents.com
...........................................................

@flavienlaurent
Copy link
Collaborator Author

Hi Stéphane,

Sorry, I can't work on BB anymore. I've too much project I must work on. I have certainly been overly ambitious in becoming a BB contributor. You can remove me from the contributor list if you want, no problem.

Flavien

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

No branches or pull requests

3 participants