Setting a primitive without getting a warning in Java
<p>I have a Java method.  For the sake of being a public forum, I'm going to say that my method is called foo</p>

<pre><code>Bar foo(Boolean flag)
{
   flag = true;
   return new Bar();
}
</code></pre>

<p>I get a warning by setting flag.  Unfortunately, I have not found a way to suppress such a warning.  Is there a "right" way of doing this?  Now I know there are some who will say to simply not use an out parameter.  Trust me when I say that I have a good reason for doing it this way.  If there's no way around the warning without doing something crazy, I suppose that's fine.  I just don't like checking in code with warnings.</p>
