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

Use Collection instead of List #23

Closed
GoogleCodeExporter opened this issue Mar 18, 2015 · 7 comments
Closed

Use Collection instead of List #23

GoogleCodeExporter opened this issue Mar 18, 2015 · 7 comments

Comments

@GoogleCodeExporter
Copy link

If you change

JSONValue:150, 151, 205 and 206 to java.util.Collection instead of 
java.util.List
and
JSONArray:32 and 72 (method definitions) to Collection instead of List

it'll work with other types of collections (such as Set) too!

Original issue reported on code.google.com by teh.e...@gmail.com on 20 May 2010 at 7:55

@GoogleCodeExporter
Copy link
Author

Original comment by fangyid...@gmail.com on 20 May 2010 at 11:56

  • Changed state: Accepted
  • Added labels: Type-Enhancement
  • Removed labels: Type-Defect

@GoogleCodeExporter
Copy link
Author

Use Itrable instead of Collection in same lines.

Original comment by dmitry.s...@gmail.com on 24 May 2010 at 8:43

@GoogleCodeExporter
Copy link
Author

I don't think that would be a good idea. If you look at the type hierarchy of 
Iterable, there are several other 
Iterable objects/interfaces, which are not for the purpose of holding a list 
(which is what we want here). It would 
suggest that json-simple is capable of handling any type of iterable object, 
while it only makes sense putting a 
collection in it.
Narrowing it down to List is too narrowed, to Iterable is too wide.

Original comment by teh.e...@gmail.com on 24 May 2010 at 8:50

@GoogleCodeExporter
Copy link
Author

Yes I agree with teh's point.

Original comment by fangyid...@gmail.com on 24 May 2010 at 10:04

@GoogleCodeExporter
Copy link
Author

Hi,

   I reported your issue on my github JSON-SIMPLE tree[1] to keep track of your request.

Bye
Piero
[1]https://github.com/ottuzzi/JSON-SIMPLE/issues/4

Original comment by ottu...@gmail.com on 24 Aug 2011 at 2:02

@GoogleCodeExporter
Copy link
Author

>Narrowing it down to List is too narrowed, to Iterable is too wide.
So what is the reason List is not replaced with Collection as it was originally 
proposed?

I'd like to serialize Set without hassle.

Original comment by ats...@gmail.com on 26 Feb 2013 at 3:25

@GoogleCodeExporter
Copy link
Author

Done in r210.

Original comment by jon.cham...@gmail.com on 10 Aug 2013 at 1:45

  • Changed state: Fixed

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

1 participant