Does declaring many identical anonymous classes waste memory in java?
<p>I recently ran across the following snippet in an existing codebase I'm working on and added the comment you see there.  I know this particular piece of code can be rewritten to be cleaner, but I just wonder if my analysis is correct.</p>

<p>Will java create a new class declaration and store it in perm gen space for every call of this method, or will it know to reuse an existing declaration?</p>

<pre><code>protected List&lt;Object&gt; extractParams(HibernateObjectColumn column, String stringVal) {
    // FIXME: could be creating a *lot* of anonymous classes which wastes perm-gen space right?
    return new ArrayList&lt;Object&gt;() {
        {
            add("");
        }
    };
}
</code></pre>
