Expression Builder syntax

I’ve been playing around with the expression interpreter in 3.2 to try to get it to display the value of a dynamic property in an Alert dialog box. I am not familiar with Beanshell, but I thought I understood it generally used basic Java syntax. Yet my tests seem to indicate that any sort of variable declaration in my expression seems to fail:
{int i;Alert(“Hi”);}
returns “Expression evaluation error” in the chat window when evaluated.
However, it does seem to be attempting to otherwise execute code blocks, such as:
{Alert(“Hi”);Alert(“Hi again”);}
Could you give me an idea of the sorts of things we can now put in expression fields? Should I be able to execute arbitrary Java? Should I be able to exploit evaluation shortcuts such as the following?
{isError == true && Alert(“There was an error”)}
Thanks in advance, and my apologies if this has already been addressed and I missed it.