shorthand variable assignment
<p>In java I'm trying to use shorthand variable assignment like below.  Currently <code>owner</code> is assigned on a different line but I'd like to put it on the same line as below.  This isn't working - is it not possible or is there another route?</p>

<pre><code>    if ((User owner = search.getOwner()) instanceof User &amp;&amp; owner.getId() != null) {
        searchQuery.append("owner_id = :ownerId AND ");
        queryMap.put("ownerId", owner.getId());
    }
</code></pre>

<p>Thanks</p>
