|
From: Shai <sha...@ya...> - 2011-09-21 10:12:46
|
OK, I had code that looked something like this (pseudo code):
public void method(SomeClass obj) {
try {
switch(field) {
case 1:
...
return;
case 2:
...
return;
case 3:
...
return;
case 4:
...
return;
// no default
}
} catch(Throwable t) {
System.out.println("Fail message...");
}
}
I initially changed all the return methods to breaks which didn't really solve the problem.
Then I moved the switch statement to a different private method (while keeping the break instead of return) and replaced the System.out with printStackTrace().
Problem solved...
I'm open for ideas on how to investigate this further.
> I think the problem is in the generated code. I have a
> curThread_w23657aaac46b1c17 variable which is indeed invalid and the reason it
> is invalid is that the TRY that corresponds to that uniqueId wasn't executed
> before I reached this line.
> So I'm guessing that this is a problem with the code generator, I'm
> trying to review my Java source code to see if there is something special there.
> The only thing that I can think of is that I have a large switch case in that
> code and most cases invoke return rather than breaking which is a less common
> practice.
> The switch is surrounded by a try/catch pair which might also be related in some
> way...
> I'll try making some code modifications to see if it works around the issue.
|