The Inspection feature has highlighted a "constant condition" incorrectly.
Here is a brief reconstruction of the scenario:
class Test
{
void testMethod1() throws Exception {}
void testMethod2() throws Exception {}
public void main(String argv[])
{
boolean callingMethod1 = false;
try
{
callingMethod1 = true;
testMethod1();
callingMethod1 = false;
testMethod2();
}
catch (Exception e)
{
if (callingMethod1)
System.err.println("Error while calling method 1");
else
System.err.println("Error while calling method 2");
}
}
}
Summary: I'm using a boolean to figure out whether an exception occurred
during a call to a particular method.
Problem: the if inside the catch block is highlighted as a constant, with
the claim that the condition is always false.
The obvious oversight is that control can switch to the catch block at a
time when the value is true.
I'm not asking for this to be fixed ASAP (it's a rather unusual scenario,
anyway), just thought you should know about it. ; )
Graham Lea
--
Software Engineer
Forge Research Pty Ltd
Suite 116, Bay 9, Locomotive Workshop
Australian Technology Park, Cornwallis Street
Eveleigh NSW 1430 Australia
Phone: +61 2 9209 4152 Fax: +61 2 9209 4172
www.forge.com.au
----------------------------------------------------------------------
This message contains privileged and confidential information intended
only for the use of the addressee named above. If you are not the
intended recipient of this message you must not disseminate, copy or
take any action in reliance on it. If you have received this message
in error please notify the sender immediately. Any views expressed in
this message are those of the individual sender, except where the
sender specifically states them to be the views of another (including
a Body Corporate).
----------------------------------------------------------------------
_______________________________________________
Eap-list mailing list
[EMAIL PROTECTED]
http://www.intellij.com/mailman/listinfo/eap-list