<!-- 
RSS generated by JIRA (4.4#649-r158309) at Wed May 22 02:35:43 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/CLJ-84/CLJ-84.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>[CLJ-84] GC Issue 81:    compile gen-class fail when class returns self</title>
                <link>http://dev.clojure.org/jira/browse/CLJ-84</link>
                <project id="10010" key="CLJ">Clojure</project>
                        <description>&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;Reported by davidhaub, Feb 14, 2009

When attempting to compile the following program, clojure fails with a
ClassNotFoundException.  It occurs because one of the methods returns the
same class that is being generated.  If the returnMe method below is
changed to &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; an &lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;, the compile succeeds.

Beware when testing! If the classpath contains a class file (say from a
prior successful build when the returnMe method was changed to &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; an
object), the compile will succeed.  Always clear out the
clojure.compile.path prior to compiling.

;badgenclass.clj
(ns badgenclass
  (:gen-class
     :state state
     :methods
     [[returnMe [] badgenclass]]
     :init init))
(defn -init []
  [[] nil])

(defn -returnMe [&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;]
  &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;)

#!/bin/sh
rm -rf classes
mkdir classes
java -cp lib/clojure.jar:classes:. -Dclojure.compile.path=classes \
clojure.lang.Compile badgenclass


Comment 1 by chouser, Mar 07, 2009

Attached is a patch that accepts strings or symbols &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; parameter and &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; class
names, and generates the appropriate bytecode without calling &lt;span class=&quot;code-object&quot;&gt;Class&lt;/span&gt;/forName.  It
fixes &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; issue, but because &apos;ns&apos; doesn&apos;t resolve :gen-class&apos;s arguments, class
names aren&apos;t checked as early anymore.  :gen-class-created classes with invalid
parameter or &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; types can even be instantiated, and no error will be reported
until the broken method is called.

One possible alternative would be to call &lt;span class=&quot;code-object&quot;&gt;Class&lt;/span&gt;/forName on any symbols given, but
allow strings to use the method given by &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; patch.  To &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; your own type, you&apos;d
need a method defined like:

  [returnMe [] &lt;span class=&quot;code-quote&quot;&gt;&quot;badgenclass&quot;&lt;/span&gt;]

Any thoughts?&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
            <key id="13481">CLJ-84</key>
            <summary>GC Issue 81:    compile gen-class fail when class returns self</summary>
                <type id="1" iconUrl="http://dev.clojure.org/jira/images/icons/bug.gif">Defect</type>
                                <priority id="4" iconUrl="http://dev.clojure.org/jira/images/icons/priority_minor.gif">Minor</priority>
                    <status id="3" iconUrl="http://dev.clojure.org/jira/images/icons/status_inprogress.gif">In Progress</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="richhickey">Rich Hickey</assignee>
                                <reporter username="importer">Assembla Importer</reporter>
                        <labels>
                    </labels>
                <created>Wed, 17 Jun 2009 22:30:00 -0500</created>
                <updated>Fri, 10 Dec 2010 09:30:52 -0600</updated>
                                    <version>Approved Backlog</version>
                                <fixVersion>Approved Backlog</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="22702" author="importer" created="Tue, 28 Sep 2010 17:09:00 -0500"  >&lt;p&gt;Converted from &lt;a href=&quot;http://www.assembla.com/spaces/clojure/tickets/84&quot;&gt;http://www.assembla.com/spaces/clojure/tickets/84&lt;/a&gt;&lt;br/&gt;
Attachments:&lt;br/&gt;
genclass-allow-unresolved-classname.patch - &lt;a href=&quot;https://www.assembla.com/spaces/clojure/documents/cWS6Aww30r3RbzeJe5afGb/download/cWS6Aww30r3RbzeJe5afGb&quot;&gt;https://www.assembla.com/spaces/clojure/documents/cWS6Aww30r3RbzeJe5afGb/download/cWS6Aww30r3RbzeJe5afGb&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="22703" author="importer" created="Tue, 28 Sep 2010 17:09:00 -0500"  >&lt;p&gt;oranenj said: [&lt;a href=&quot;file:cWS6Aww30r3RbzeJe5afGb&quot;&gt;file:cWS6Aww30r3RbzeJe5afGb&lt;/a&gt;]: on comment 1&lt;/p&gt;</comment>
                    <comment id="22704" author="importer" created="Tue, 28 Sep 2010 17:09:00 -0500"  >&lt;p&gt;richhickey said: Updating tickets (#8, #19, #30, #31, #126, #17, #42, #47, #50, #61, #64, #69, #71, #77, #79, #84, #87, #89, #96, #99, #103, #107, #112, #113, #114, #115, #118, #119, #121, #122, #124)&lt;/p&gt;</comment>
                    <comment id="25904" author="stu" created="Sat, 30 Oct 2010 11:58:08 -0500"  >&lt;p&gt;The approach take in the initial patch (delaying resolution of symbols into classes) is fine: gen-class makes no promise about when this happens, and the dynamic approach feels more consistent with Clojure. I think the proposed (but not implemented) use of string/symbol to control when class names are resolved is a bad idea: magical and not implied by the types.&lt;/p&gt;

&lt;p&gt;Needed:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;update the patch to apply cleanly&lt;/li&gt;
	&lt;li&gt;consider whether totype could live in clojure.reflect.java. (Beware load order dependencies.)&lt;/li&gt;
&lt;/ul&gt;
</comment>
                    <comment id="25910" author="chouser@n01se.net" created="Sat, 30 Oct 2010 21:29:59 -0500"  >&lt;p&gt;Wow, 18-month-old patch, back to haunt me for Halloway&apos;een&lt;/p&gt;

&lt;p&gt;So what does it mean that the assignee is Rich, but it&apos;s waiting on me?&lt;/p&gt;</comment>
                    <comment id="25915" author="stu" created="Mon, 1 Nov 2010 09:17:22 -0500"  >&lt;p&gt;I am using Approval = Incomplete plus Waiting On = Someone to let submitters know that there is feedback waiting, and that they can move the ticket forward by acting on it. The distinction is opportunity to contribute (something has been provided to let you move forward) vs. expectation of contribution. &lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                <customfield id="customfield_10002" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                <customfieldname>Approval</customfieldname>
                <customfieldvalues>
                        <customfieldvalue key="10006">Incomplete</customfieldvalue>

                </customfieldvalues>
            </customfield>
                                                                                    <customfield id="customfield_10010" key="com.pyxis.greenhopper.jira:gh-global-rank">
                <customfieldname>Global Rank</customfieldname>
                <customfieldvalues>
                    
                </customfieldvalues>
            </customfield>
                                                                                                        <customfield id="customfield_10003" key="com.atlassian.jira.plugin.system.customfieldtypes:userpicker">
                <customfieldname>Waiting On</customfieldname>
                <customfieldvalues>
                    <customfieldvalue>chouser@n01se.net</customfieldvalue>
                </customfieldvalues>
            </customfield>
                            </customfields>
    </item>
</channel>
</rss>