Skip to main content

[json-processing-spec issues] [JIRA] Updated: (JSON_PROCESSING_SPEC-17) JsonParser shouldn't extend Iterable

  • From: "jitu (JIRA)" < >
  • To:
  • Subject: [json-processing-spec issues] [JIRA] Updated: (JSON_PROCESSING_SPEC-17) JsonParser shouldn't extend Iterable
  • Date: Wed, 24 Oct 2012 22:27:12 +0000 (GMT+00:00)
  • Auto-submitted: auto-generated


     [ 
http://java.net/jira/browse/JSON_PROCESSING_SPEC-17?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

jitu updated JSON_PROCESSING_SPEC-17:
-------------------------------------


Checked with SE team regarding Iterable. Here is a comment

"While the specifications do not require that an Iterable can be iterated 
repeatedly/consistently, many users expect this and are likely to be confused 
if they cannot.

If you do not intend iterator() to return a fresh "rewound" view every time, 
then you should probably follow the convention set by 
Socket.getInputStream(), which returns the same stream on every call.

You definitely don't want to *implement* Iterator; a parser is-not-a 
Iterator.  One option would be to have an iterator() method but not implement 
Iterable, where the iterator() method was spec'ed to behave as above -- just 
return the same Iterator object every time.  All you lose there is the 
foreach loop support -- no big deal.

Overall I think you sow more confusion than benefit by implementing Iterable.

When you get to EE 8 you can implement Streamable too!"

Based on this, added iterator() method.

> JsonParser shouldn't extend Iterable
> ------------------------------------
>
>                 Key: JSON_PROCESSING_SPEC-17
>                 URL: http://java.net/jira/browse/JSON_PROCESSING_SPEC-17
>             Project: json-processing-spec
>          Issue Type: Improvement
>            Reporter: jitu
>
> http://java.net/projects/json-processing-spec/lists/users/archive/2012-04/message/72

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://java.net/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


[json-processing-spec issues] [JIRA] Created: (JSON_PROCESSING_SPEC-17) JsonParser shouldn't extend Iterable

jitu (JIRA) 10/24/2012

[json-processing-spec issues] [JIRA] Updated: (JSON_PROCESSING_SPEC-17) JsonParser shouldn't extend Iterable

jitu (JIRA) 10/24/2012

[json-processing-spec issues] [JIRA] Resolved: (JSON_PROCESSING_SPEC-17) JsonParser shouldn't extend Iterable

jitu (JIRA) 10/24/2012
 
 
Close
loading
Please Confirm
Close