Variable might not have been initialized
<p>Here I am, thinking I know Java, and I get the error <code>Variable 'storage' might not have been initialized</code>. Here is my code:</p>

<pre><code>public class RobbleSet {
    private final Set&lt;Robble&gt; storage; // Error occurs here

    public RobbleSet() {
        storage = new HashSet&lt;Robble&gt;();
    }

    public addRobble(Robble r) {
        storage.add(r); // Error occurs here too
    }
}
</code></pre>

<p><code>storage</code> is initialized in the constructor. What gives?</p>

<p><strong>Edit:</strong> New user, so I can't post an answer. But I figured it out. <code>addRobble</code> doesn't have a return type so the static analyzer is picking it up as a constructor even though it isn't called <code>RobbleSet</code>. The proper code is as follows:</p>

<pre><code>public class RobbleSet {
    private final Set&lt;Robble&gt; storage; // Error occurs here

    public RobbleSet() {
        storage = new HashSet&lt;Robble&gt;();
    }

    public void addRobble(Robble r) {
        storage.add(r); // Error occurs here too
    }
}
</code></pre>
