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

java.io.File is not a valid source for anyFrom()/mapFrom() #53

Closed
CoreyTeffetalor opened this issue Jun 16, 2017 · 3 comments
Closed

java.io.File is not a valid source for anyFrom()/mapFrom() #53

CoreyTeffetalor opened this issue Jun 16, 2017 · 3 comments
Milestone

Comments

@CoreyTeffetalor
Copy link

I'm getting an exception when attempting to use mapFrom/anyFrom in gradle/groovy:

com.fasterxml.jackson.jr.ob.JSONObjectException: Can not use Source of type java.io.File as input (use an InputStream, Reader, String, byte[], File or URL

Thrown here: https://github.com/FasterXML/jackson-jr/blob/master/jr-objects/src/main/java/com/fasterxml/jackson/jr/ob/JSON.java#L1064

It looks like the cases above don't handle java.io.File as the documentation/exception claims.

@cowtowncoder
Copy link
Member

Sounds like a bug really; thank you for reporting this.

@cowtowncoder cowtowncoder added this to the 2.8.0 milestone Jun 16, 2017
@cowtowncoder cowtowncoder changed the title java.io.File is not a valid source for anyFrom()/mapFrom() java.io.File is not a valid source for anyFrom()/mapFrom() Jun 16, 2017
@CoreyTeffetalor
Copy link
Author

Thanks for the quick resolution!

@cowtowncoder
Copy link
Member

@CoreyTeffetalor np, thank you for reporting it. It was an odd omission, considering javadocs. But it's part of API that it easy to miss since there isn't much to test beyond existence (since underlying functionality after construction of input stream does not differ).

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

No branches or pull requests

2 participants