<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6746685814444374490</id><updated>2024-09-16T10:12:59.345-07:00</updated><title type='text'>Dick Moves in Java</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://dickmovesinjava.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6746685814444374490/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://dickmovesinjava.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>GC</name><uri>http://www.blogger.com/profile/16758336413803995580</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>7</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6746685814444374490.post-4021484714456018239</id><published>2010-03-29T07:30:00.001-07:00</published><updated>2010-03-29T07:30:03.436-07:00</updated><title type='text'>Substring on a huge string</title><content type='html'>The garbage collector won&#39;t be able to clean up the underlying byte array.&lt;pre&gt;public static String getIntro()
{
    String novel = novelFactory.writeNovel();
    return novel.substring(0, 140);
}&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://dickmovesinjava.blogspot.com/feeds/4021484714456018239/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dickmovesinjava.blogspot.com/2010/03/substring-on-huge-string.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6746685814444374490/posts/default/4021484714456018239'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6746685814444374490/posts/default/4021484714456018239'/><link rel='alternate' type='text/html' href='http://dickmovesinjava.blogspot.com/2010/03/substring-on-huge-string.html' title='Substring on a huge string'/><author><name>GC</name><uri>http://www.blogger.com/profile/16758336413803995580</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6746685814444374490.post-2710460761147612087</id><published>2010-03-22T07:30:00.001-07:00</published><updated>2010-03-22T07:30:10.001-07:00</updated><title type='text'>StringBuffers that exist within a method</title><content type='html'>This won&#39;t be the biggest performance hit of all time, but no one seems to use a Vector when an ArrayList is sufficient. StringBuffer was released before StringBuilder, and old habits die hard.&lt;pre&gt;public static String concat(Iterable&lt;String&gt; iterable)
{
    StringBuffer buffer = new StringBuffer();
    for (String string : iterable)
    {
        buffer.append(string);
    }
    return buffer.toString();
}&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://dickmovesinjava.blogspot.com/feeds/2710460761147612087/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dickmovesinjava.blogspot.com/2010/03/stringbuffers-that-exist-within-method.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6746685814444374490/posts/default/2710460761147612087'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6746685814444374490/posts/default/2710460761147612087'/><link rel='alternate' type='text/html' href='http://dickmovesinjava.blogspot.com/2010/03/stringbuffers-that-exist-within-method.html' title='StringBuffers that exist within a method'/><author><name>GC</name><uri>http://www.blogger.com/profile/16758336413803995580</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6746685814444374490.post-8639877800116964836</id><published>2010-03-15T07:30:00.001-07:00</published><updated>2010-03-15T07:30:01.934-07:00</updated><title type='text'>Depending on concrete classes</title><content type='html'>This should at least depend on List&lt;String&gt;, but would be even better to depend on Iterable&lt;String&gt;.&lt;pre&gt;public static String concat(ArrayList&lt;String&gt; list)
{
    StringBuilder builder = new StringBuilder();
    for (String string : list)
    {
        builder.append(string);
    }
    return builder.toString();
}&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://dickmovesinjava.blogspot.com/feeds/8639877800116964836/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dickmovesinjava.blogspot.com/2010/03/depending-on-concrete-classes.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6746685814444374490/posts/default/8639877800116964836'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6746685814444374490/posts/default/8639877800116964836'/><link rel='alternate' type='text/html' href='http://dickmovesinjava.blogspot.com/2010/03/depending-on-concrete-classes.html' title='Depending on concrete classes'/><author><name>GC</name><uri>http://www.blogger.com/profile/16758336413803995580</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6746685814444374490.post-5282495632574852845</id><published>2010-03-08T07:30:00.001-08:00</published><updated>2010-03-08T07:30:05.343-08:00</updated><title type='text'>I just can&amp;#39;t handle it</title><content type='html'>There are better ways to handle exceptions...&lt;pre&gt;public static InputStream readFile(File file)
{
    try
    {
        return new FileInputStream(file);
    }
    catch(Exception e)
    {
        System.exit(1);
    }
}&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://dickmovesinjava.blogspot.com/feeds/5282495632574852845/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dickmovesinjava.blogspot.com/2010/03/i-just-can-handle-it.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6746685814444374490/posts/default/5282495632574852845'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6746685814444374490/posts/default/5282495632574852845'/><link rel='alternate' type='text/html' href='http://dickmovesinjava.blogspot.com/2010/03/i-just-can-handle-it.html' title='I just can&amp;#39;t handle it'/><author><name>GC</name><uri>http://www.blogger.com/profile/16758336413803995580</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6746685814444374490.post-4563080253867654506</id><published>2010-03-07T19:45:00.001-08:00</published><updated>2010-03-07T19:45:46.171-08:00</updated><title type='text'>Bad optimization</title><content type='html'>You can prevent third-party libraries from doing this by including the &quot;-XX:-DisableExplicitGC&quot; option at the command line (see &lt;a href=&quot;http://java.sun.com/javase/technologies/hotspot/vmoptions.jsp&quot;&gt;http://java.sun.com/javase/technologies/hotspot/vmoptions.jsp&lt;/a&gt; for details).&lt;pre&gt;public static void resetList()
{
    this.list = new ArrayList&lt;String&gt;()
    System.gc(); // unnecessary at best!
}&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://dickmovesinjava.blogspot.com/feeds/4563080253867654506/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dickmovesinjava.blogspot.com/2010/03/bad-optimization.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6746685814444374490/posts/default/4563080253867654506'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6746685814444374490/posts/default/4563080253867654506'/><link rel='alternate' type='text/html' href='http://dickmovesinjava.blogspot.com/2010/03/bad-optimization.html' title='Bad optimization'/><author><name>GC</name><uri>http://www.blogger.com/profile/16758336413803995580</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6746685814444374490.post-827479126672046998</id><published>2010-03-07T19:28:00.001-08:00</published><updated>2010-03-07T19:28:38.481-08:00</updated><title type='text'>Is there any point to checked exceptions?</title><content type='html'>Interesting discussion here: &lt;a href=&quot;http://googletesting.blogspot.com/2009/09/checked-exceptions-i-love-you-but-you.html&quot;&gt;http://googletesting.blogspot.com/2009/09/checked-exceptions-i-love-you-but-you.html&lt;/a&gt;&lt;pre&gt;public static void doThing(Object thing) throws Exception
{
    // no op for now
}&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://dickmovesinjava.blogspot.com/feeds/827479126672046998/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dickmovesinjava.blogspot.com/2010/03/is-there-any-point-to-checked_6250.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6746685814444374490/posts/default/827479126672046998'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6746685814444374490/posts/default/827479126672046998'/><link rel='alternate' type='text/html' href='http://dickmovesinjava.blogspot.com/2010/03/is-there-any-point-to-checked_6250.html' title='Is there any point to checked exceptions?'/><author><name>GC</name><uri>http://www.blogger.com/profile/16758336413803995580</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6746685814444374490.post-3801134812887923629</id><published>2010-03-07T18:18:00.001-08:00</published><updated>2010-03-07T18:18:45.673-08:00</updated><title type='text'>This is actually possible</title><content type='html'>&lt;pre&gt;public static void goodbyeWorld()
{
    System.out.close();
    System.out.println(&quot;Can you hear me now?&quot;);
}&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://dickmovesinjava.blogspot.com/feeds/3801134812887923629/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dickmovesinjava.blogspot.com/2010/03/this-is-actually-possible_07.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6746685814444374490/posts/default/3801134812887923629'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6746685814444374490/posts/default/3801134812887923629'/><link rel='alternate' type='text/html' href='http://dickmovesinjava.blogspot.com/2010/03/this-is-actually-possible_07.html' title='This is actually possible'/><author><name>GC</name><uri>http://www.blogger.com/profile/16758336413803995580</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>