Bug 4919 - Cannot duplicate local variable in finally block
Summary: Cannot duplicate local variable in finally block
Status: RESOLVED DUPLICATE of bug 4943
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P1 normal (vote)
Target Milestone: 2.0 M1   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-10-12 08:02 EDT by Jerome Lanneluc CLA
Modified: 2002-01-11 09:04 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jerome Lanneluc CLA 2001-10-12 08:02:53 EDT
Compiling the following CU results in an error on the secon local variable: 
Duplicate local variable i

X.java:
public class X {
  void foo() {
    try {
      int i = 0;
    } finally {
      try {
        int i = 1;
      } finally {
        return;
      }
    }
  }
}

javac 1.3 and 1.4 both accept this scenario
Comment 1 Philipe Mulet CLA 2001-10-12 09:18:45 EDT
This is a regression introduced by a naive fix to: 
1GDS7IP:  ITPJCORE:WIN2000 - VerifyError related to a local index computation

The real fix would be to shift variables positions in finally blocks to be
located after the scope of the try block, but the finally scope should remain
a sibling of the try block scope.
Comment 2 Philipe Mulet CLA 2001-10-13 13:07:42 EDT
Another symptom of 4943, the bug fix was invalid.

*** This bug has been marked as a duplicate of 4943 ***