<?xml version="1.0" encoding="iso-8859-1"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>Rock Star Programmer</title>
    <link rel="alternate" type="text/html" href="http://movabletypo.net/rockstarprogrammer/" />
    <link rel="self" type="application/atom+xml" href="http://movabletypo.net/rockstarprogrammer/atom.xml" />
   <id>tag:movabletypo.net,2006:/rockstarprogrammer/26</id>
    <link rel="service.post" type="application/atom+xml" href="http://movabletypo.net/cgi-bin/mt/mt-atom.cgi/weblog/blog_id=26" title="Rock Star Programmer" />
    <updated>2006-12-21T00:42:51Z</updated>
    
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type 3.2</generator>
 
<entry>
    <title>Wha? You can DO that?!?!</title>
    <link rel="alternate" type="text/html" href="http://movabletypo.net/rockstarprogrammer/2006/06/wha_you_can_do_that.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://movabletypo.net/cgi-bin/mt/mt-atom.cgi/weblog/blog_id=26/entry_id=3586" title="Wha? You can DO that?!?!" />
    <id>tag:movabletypo.net,2006:/rockstarprogrammer//26.3586</id>
    
    <published>2006-06-14T05:11:31Z</published>
    <updated>2006-12-21T00:42:51Z</updated>
    
    <summary><![CDATA[A co-worker came to me today with a Java question. &quot;What are the rules for instantiating a public inner class?&quot;, he asks. So, for example: public class Outer {     public class Inner() {     } } &quot;Well&quot;, I said...]]></summary>
    <author>
        <name>yonashi</name>
        <uri>http://movabletypo.net/decaffeinated</uri>
    </author>
    
    <content type="html" xml:lang="en-us" xml:base="http://movabletypo.net/rockstarprogrammer/">
        <![CDATA[<p>A co-worker came to me today with a Java question.</p>
<p>&quot;What are the rules for instantiating a public inner class?&quot;, he asks. So, for example:</p>
<blockquote>
    <p>public class Outer {</p>
    <p>    public class Inner() {</p>
    <p>    }</p>
    <p>}</p>
</blockquote>
<p>&quot;Well&quot;, I said knowingly, &quot;the inner class instance cannot exist without a reference to an outer class instance.&quot; So far, so good. &quot;So&quot;, I postulate, not realizing that I am horribly wrong, &quot;you can only instantiate the inner class from with the outer class instance.&quot; Ummm...no. The following code actually compiles:</p>
<blockquote>
    <p>Outer.Inner inner = (new Outer()).new Inner();</p>
</blockquote>
<p>We stared at the horrible, horrible syntax for a while, much the same way people stare at car crashes - terrified but unable to look away.</p>
<p>&quot;Dot new?&quot;, I said incredulously. </p>
<p>&quot;Dot new!&quot;, he said, completely disgusted.</p>
<p>&quot;Can you refactor your code so you don't have to do this?&quot;, I said.</p>
<p>&quot;I can sure as hell try&quot;, he said.</p>
]]>
        
    </content>
</entry>
<entry>
    <title>Generic confusion</title>
    <link rel="alternate" type="text/html" href="http://movabletypo.net/rockstarprogrammer/2006/03/generic_confusion.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://movabletypo.net/cgi-bin/mt/mt-atom.cgi/weblog/blog_id=26/entry_id=3430" title="Generic confusion" />
    <id>tag:movabletypo.net,2006:/rockstarprogrammer//26.3430</id>
    
    <published>2006-03-27T23:17:10Z</published>
    <updated>2006-12-21T00:42:52Z</updated>
    
    <summary>I&apos;ve been using Java 5 generics for a while now, and I thought I had a pretty good handle on them. Then I ran across the need to declare a parameter type wildcard that both extends a class and implements...</summary>
    <author>
        <name>yonashi</name>
        <uri>http://movabletypo.net/decaffeinated</uri>
    </author>
    
    <content type="html" xml:lang="en-us" xml:base="http://movabletypo.net/rockstarprogrammer/">
        <![CDATA[<p>I've been using Java 5 generics for a while now, and I thought I had a pretty good handle on them. Then I ran across the need to declare a parameter type wildcard that both extends a class and implements an interface. Now, I already knew that you have to use <em>extends</em> instead of the more intuitive <em>implements,</em> even with an interface:</p>
<blockquote>
    <p>public class Foo&lt;T extends MyInterface&gt;</p>
</blockquote>
<p>And I'm ok with that. Really. So I tried the naive approach to my problem:</p>
<blockquote>
    <p>public class Foo&lt;T extends MySuperclass, MyInterface&gt;</p>
</blockquote>
<p>Which just doesn't work. I didn't try compiling it, but strangely enough, my IDE doesn't mark it as a syntactic error - it marks the interface as &quot;unused&quot;. The correct syntax for this case is:</p>
<blockquote>
    <p>public class Foo&lt;T extends MySuperclass <strong>&amp;</strong> MyInterface&gt;</p>
</blockquote>
<p>Huh? I just had it pointed out to me that &quot;,&quot; is used to separate types, so couldn't be used in this case. So &quot;&amp;&quot; it is....</p>
]]>
        
    </content>
</entry>
<entry>
    <title>My Muse</title>
    <link rel="alternate" type="text/html" href="http://movabletypo.net/rockstarprogrammer/2006/03/my_muse.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://movabletypo.net/cgi-bin/mt/mt-atom.cgi/weblog/blog_id=26/entry_id=3417" title="My Muse" />
    <id>tag:movabletypo.net,2006:/rockstarprogrammer//26.3417</id>
    
    <published>2006-03-22T22:09:19Z</published>
    <updated>2006-12-21T00:42:52Z</updated>
    
    <summary>For anybody wondering about the title of this blog, see my inspiration. The content is pretty straight forward, but the title is flat out ridiculous... So I did I Google search, and found lots of other blogs and articles about...</summary>
    <author>
        <name>yonashi</name>
        <uri>http://movabletypo.net/decaffeinated</uri>
    </author>
    
    <content type="html" xml:lang="en-us" xml:base="http://movabletypo.net/rockstarprogrammer/">
        <![CDATA[<p>For anybody wondering about the title of this blog, see <a href="http://www.javalobby.org/java/forums/t65399.html">my inspiration</a>. The content is pretty straight forward, but the title is flat out ridiculous... So I did I Google search, and found lots of other blogs and articles about how to be a &quot;Rock Star Programmer&quot;. None of which (unfortunately) have anything to do with sex, drugs, or rock and roll. It's all about self-perception, apparently...or maybe just wishful thinking?</p>
]]>
        
    </content>
</entry>
<entry>
    <title>We can rebuild him! But...er...we ain&apos;t gonna...</title>
    <link rel="alternate" type="text/html" href="http://movabletypo.net/rockstarprogrammer/2006/03/we_can_rebuild_him_buterwe_ain.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://movabletypo.net/cgi-bin/mt/mt-atom.cgi/weblog/blog_id=26/entry_id=3418" title="We can rebuild him! But...er...we ain&#39;t gonna..." />
    <id>tag:movabletypo.net,2006:/rockstarprogrammer//26.3418</id>
    
    <published>2006-03-17T06:49:21Z</published>
    <updated>2006-12-21T00:42:52Z</updated>
    
    <summary>We&apos;ve been building a filterable, sortable JTree (sort of like swingx&apos;s JXTree, but actually working). Of course we ran head-first into the common JTree problem - any structureChanged event collapses the tree. So we filter the tree - and it...</summary>
    <author>
        <name>yonashi</name>
        <uri>http://movabletypo.net/decaffeinated</uri>
    </author>
    
    <content type="html" xml:lang="en-us" xml:base="http://movabletypo.net/rockstarprogrammer/">
        <![CDATA[We've been building a filterable, sortable JTree (sort of like swingx's JXTree, but actually working). Of course we ran head-first into the common JTree problem - any structureChanged event collapses the tree. So we filter the tree - and it collapses. Darn. But don't worry! Those clever swing guys, they figured out how to fix it, as the following comment shows (JTree, line 3165) :
<blockquote>
    <p><code>// NOTE: If I change this to NOT remove the descendants<br />// and update BasicTreeUIs treeStructureChanged method<br />// to update descendants in response to a treeStructureChanged<br />// event, all the children of the event won't collapse!</code></p>
</blockquote>
<p>Of course, the fix involves rewriting BasicTreeUI. Which is subclassed by every look and feel out there, so, of course, only Sun can fix it. Which they didn't bother to do. But hey, they left us that great comment. Thanks guys!</p>
]]>
        
    </content>
</entry>

</feed> 

