Bug 244549 - JavaCore.create(String handleIdentifier) fails for local variable with parameterized type
Summary: JavaCore.create(String handleIdentifier) fails for local variable with parame...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.5   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.5 M2   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-19 09:59 EDT by Markus Keller CLA
Modified: 2008-09-15 10:33 EDT (History)
1 user (show)

See Also:


Attachments
Proposed fix and regression test (3.44 KB, patch)
2008-08-21 06:14 EDT, Jerome Lanneluc CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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