Bug 244549

Summary: JavaCore.create(String handleIdentifier) fails for local variable with parameterized type
Product: [Eclipse Project] JDT Reporter: Markus Keller <markus.kell.r>
Component: CoreAssignee: Jerome Lanneluc <jerome_lanneluc>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: Olivier_Thomann
Version: 3.5   
Target Milestone: 3.5 M2   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Proposed fix and regression test none

Description Markus Keller CLA 2008-08-19 09:59:54 EDT
I20080812-0800

Have this code in Java project 'J':

//----
package snippet;

import java.util.ArrayList;

public class Snippet {
    public static void main(String[] args) {
        ArrayList<String> strings= null;
        System.out.println(strings);
    }
}
//----

The handle identifier for the local variable 'strings' is:
=J/src<snippet{Snippet.java[Snippet~main~\[QString;@strings!129!160!147!153!QArrayList<QString;>;

When I pass this to JavaCore.create(String), I get an invalid ILocalVariable with this handle identifier:
=J/src<snippet{Snippet.java[Snippet~main~\[QString;@strings!129!160!147!153!QArrayList

'<QString;>;' is missing at the end.

I know that handles for local variables are not stable when the source changes, but I would still expect this to work as long as there are no changes.

This is a problem for bug 233632, where I encode links in the browser widget using the handle identifier.
Comment 1 Jerome Lanneluc CLA 2008-08-21 06:14:38 EDT
Created attachment 110547 [details]
Proposed fix and regression test
Comment 2 Jerome Lanneluc CLA 2008-08-21 06:15:52 EDT
Fix and test released for 3.5M2
Comment 3 Olivier Thomann CLA 2008-09-15 10:33:04 EDT
Verified for 3.5M2 using I20080914-2000