<!-- 
RSS generated by JIRA (4.4#649-r158309) at Sun May 19 08:45:07 CDT 2013

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary add field=key&field=summary to the URL of your request.
For example:
http://dev.clojure.org/jira/si/jira.issueviews:issue-xml/CONTRIB-91/CONTRIB-91.xml?field=key&field=summary
-->
<rss version="0.92" >
<channel>
    <title>Clojure JIRA</title>
    <link>http://dev.clojure.org/jira</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>4.4</version>
        <build-number>649</build-number>
        <build-date>25-07-2011</build-date>
    </build-info>

<item>
            <title>[CONTRIB-91] json end-of-file handling broken</title>
                <link>http://dev.clojure.org/jira/browse/CONTRIB-91</link>
                <project id="10012" key="CONTRIB">Clojure-Contrib</project>
                        <description>&lt;p&gt;When read-json encounters an end-of-file, an IllegalArgumentException is thrown regardless of the user&apos;s eof preferences. This can easily be reproduced by running:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;(read-json &quot;&quot;)
&amp;lt;/code&amp;gt;&amp;lt;/pre&amp;gt;
which &lt;span class=&quot;code-keyword&quot;&gt;throws&lt;/span&gt; the exception
&amp;lt;pre&amp;gt;&amp;lt;code&amp;gt;java.lang.IllegalArgumentException: Value out of range &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;code-object&quot;&gt;char&lt;/span&gt;: -1
&amp;lt;/code&amp;gt;&amp;lt;/pre&amp;gt;
This is caused by the .read method of the Reader returning -1 when the end is reached. (.read returns an &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;.) This value is then passed to &apos;&lt;span class=&quot;code-object&quot;&gt;char&lt;/span&gt;&apos;, which tries to make the corresponding character from the code point number. However, -1 is not a valid code point, so it &lt;span class=&quot;code-keyword&quot;&gt;throws&lt;/span&gt; an exception.

A solution is to check &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; equality to -1 before trying to convert to a character. I also have an idea &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; a helper function that could be used:
&amp;lt;pre&amp;gt;&amp;lt;code&amp;gt;(defn- read-&lt;span class=&quot;code-object&quot;&gt;char&lt;/span&gt;
  &lt;span class=&quot;code-quote&quot;&gt;&quot;Reads a character from a Reader. Returns nil &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; the end of the stream is reached&quot;&lt;/span&gt;
  [stream]
  (let [x (.read stream)]
    (&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (not= x -1)
      (&lt;span class=&quot;code-object&quot;&gt;char&lt;/span&gt; x))))&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;This function will always return either a Character or nil. Using it would make it possible to have the eof case along the other cases in the existing cond forms.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14251">CONTRIB-91</key>
            <summary>json end-of-file handling broken</summary>
                <type id="1" iconUrl="http://dev.clojure.org/jira/images/icons/bug.gif">Defect</type>
                                        <status id="6" iconUrl="http://dev.clojure.org/jira/images/icons/status_closed.gif">Closed</status>
                    <resolution id="1">Completed</resolution>
                                <assignee username="rasmus.svensson">rasmus.svensson</assignee>
                                <reporter username="-1">None</reporter>
                        <labels>
                    </labels>
                <created>Sun, 15 Aug 2010 00:51:00 -0500</created>
                <updated>Fri, 17 Sep 2010 18:53:00 -0500</updated>
                    <resolved>Fri, 17 Sep 2010 18:53:00 -0500</resolved>
                                                                    <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="25845" author="importer" created="Fri, 17 Sep 2010 18:53:00 -0500"  >&lt;p&gt;Converted from &lt;a href=&quot;http://www.assembla.com/spaces/clojure/tickets/91&quot;&gt;http://www.assembla.com/spaces/clojure/tickets/91&lt;/a&gt;&lt;br/&gt;
Attachments:&lt;br/&gt;
fix91-1.patch - &lt;a href=&quot;https://www.assembla.com/spaces/clojure/documents/bYSqjYRuWr37WWeJe5cbCb/download/bYSqjYRuWr37WWeJe5cbCb&quot;&gt;https://www.assembla.com/spaces/clojure/documents/bYSqjYRuWr37WWeJe5cbCb/download/bYSqjYRuWr37WWeJe5cbCb&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="25846" author="importer" created="Fri, 17 Sep 2010 18:53:00 -0500"  >&lt;p&gt;stuart.sierra said: [&lt;a href=&quot;file:bYSqjYRuWr37WWeJe5cbCb&quot;&gt;file:bYSqjYRuWr37WWeJe5cbCb&lt;/a&gt;]: fix, without auxiliary function&lt;/p&gt;</comment>
                    <comment id="25847" author="importer" created="Fri, 17 Sep 2010 18:53:00 -0500"  >&lt;p&gt;stuart.sierra said: (In &lt;a href=&quot;http://github.com/clojure/clojure-contrib/commit/5a928e263ab88cb8d224de8585932f936aa30c8f&quot;&gt;revision:5a928e263ab88cb8d224de8585932f936aa30c8f&lt;/a&gt;) Fix EOF-handling in JSON reader; refs #91&lt;/p&gt;

&lt;p&gt;Branch: master&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                                                                            <customfield id="customfield_10010" key="com.pyxis.greenhopper.jira:gh-global-rank">
                <customfieldname>Global Rank</customfieldname>
                <customfieldvalues>
                    
                </customfieldvalues>
            </customfield>
                                                                                                            </customfields>
    </item>
</channel>
</rss>