Bug 71910

Summary: Weird exception handlers ranges with any exception handlers
Product: [Eclipse Project] JDT Reporter: Olivier Thomann <Olivier_Thomann>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.0   
Target Milestone: 3.1 M2   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Source code to compile
none
Apply on HEAD of jdt.core project
none
Apply on HEAD of jdt.core tests project
none
Apply on HEAD of jdt.core compiler tests project none

Description Olivier Thomann CLA 2004-08-12 18:02:47 EDT
Comppile the attached A.java.

Eclipse 3.0 reports:
      Exception Table:
        [pc: 4, pc: 17] -> 17 when : any
        [pc: 0, pc: 23] -> 23 when : any
        [pc: 42, pc: 45] -> 23 when : any

HEAD reports:
      Exception Table:
        [pc: 4, pc: 14] -> 17 when : any
        [pc: 17, pc: 19] -> 17 when : any
        [pc: 0, pc: 28] -> 23 when : any
        [pc: 42, pc: 45] -> 23 when : any

I would say that this is suspicious. I don't understand why the exception
handler would go backwards (0-28 -> 23).

I will attach proposed patches.
Comment 1 Olivier Thomann CLA 2004-08-12 18:03:26 EDT
Created attachment 13931 [details]
Source code to compile
Comment 2 Olivier Thomann CLA 2004-08-12 18:03:54 EDT
Created attachment 13932 [details]
Apply on HEAD of jdt.core project
Comment 3 Olivier Thomann CLA 2004-08-12 18:04:18 EDT
Created attachment 13933 [details]
Apply on HEAD of jdt.core tests project
Comment 4 Olivier Thomann CLA 2004-08-12 18:04:37 EDT
Created attachment 13934 [details]
Apply on HEAD of jdt.core compiler tests project
Comment 5 Olivier Thomann CLA 2004-08-23 15:51:44 EDT
With the patch we would have:
        [pc: 4, pc: 17] -> 17 when : any
        [pc: 0, pc: 23] -> 23 when : any
        [pc: 42, pc: 45] -> 23 when : any

This looks much better. I will release the changes to fix this. I need these
changes to updates the tests for bug 70997.
Philippe, please review the changes.
Comment 6 Olivier Thomann CLA 2004-08-23 15:52:18 EDT
Fixed and released in HEAD.
Regression tests added.
Comment 7 Olivier Thomann CLA 2004-09-22 11:47:13 EDT
Reverted the changes for the synchronized statement.
Comment 8 Olivier Thomann CLA 2004-09-22 11:47:48 EDT
jck tests were affected by this change.
Comment 9 Olivier Thomann CLA 2004-09-22 11:48:54 EDT
Reopen to close as invalid since the synchronized statement needs to be untouched.
Comment 10 Olivier Thomann CLA 2004-09-22 11:49:42 EDT
The changes remain valid for the try/finally.
Comment 11 Olivier Thomann CLA 2004-09-22 11:51:31 EDT
The test case is invalid since it contains a synchronized statement.
Comment 12 David Audel CLA 2004-09-23 05:38:33 EDT
Verified in I200409212000.