Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

'javaInterfaces' which contain generics produce syntactically incorrect imports #317

Closed
sberriman opened this issue Mar 17, 2015 · 3 comments
Assignees
Milestone

Comments

@sberriman
Copy link

If is have:

"javaInterfaces" : [
    "com.example.IMyThing<String>"
]

Then the generated class incorrectly contains:
import com.example.IMyThing<String>;

It does however correctly state:
public class MyThing implements IMyThing<String>

This is a necessary usecase for me where an existing set of interfaces, currently used for RMI, are being JSON wrapped for web exposure.

@joelittlejohn
Copy link
Owner

Simon, could you explain what the problem is here? I don't currently understand what's wrong with this import.

@sberriman
Copy link
Author

Sorry - I forgot to escape the angle brackets. Edited correctly now.

@joelittlejohn
Copy link
Owner

Yes, it doesn't surprise me that this doesn't work. We don't dig deeply into the string value here, we just tell CodeModel to use the string as a type verbatim.

I'll take a look at this for the next release though. I've recently done some work to support endlessly nestable generics in javaType so it should be possible to reuse that here.

@joelittlejohn joelittlejohn added this to the 0.4.14 milestone Aug 4, 2015
@joelittlejohn joelittlejohn self-assigned this Aug 4, 2015
@joelittlejohn joelittlejohn changed the title Implemented 'javaInterfaces' which contain generics produce syntacticly incorrect imports 'javaInterfaces' which contain generics produce syntactically incorrect imports Aug 4, 2015
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants