Summary: | BindingKey#internalToSignature() returns invalid signature for local type | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Markus Keller <markus.kell.r> |
Component: | Core | Assignee: | Jerome Lanneluc <jerome_lanneluc> |
Status: | VERIFIED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | CC: | martinae, Olivier_Thomann |
Version: | 3.1 | ||
Target Milestone: | 3.2 M2 | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Whiteboard: |
Description
Markus Keller
2005-07-22 16:07:06 EDT
What makes you believe that the key can be used to get the class name? This might be true for members, but not for locals where the position is used instead of the name. I see that the format of the signature does not explicitly specify how a type name is encoded in the "Indentifier" part of a signature. Would it be possible to include the local type's name in the identifier? If not, it would be very complicated for JDT/UI to handle such signatures correctly in import rewrites and hovers (we would basically have to assume that the number is a position in the source file and then we would have to resolve the element at that position, etc.) Changed the binding key for local types to include the local type's simple name (e.g. "Lxy/LocalTest$98$Local;"). Thus when asking the resulting signature for the simple name, it now returns "Local". Added regression test ASTConverter15Test#test0196() and updated other AST tests to reflect this change. Reopen. The refactoring 'Infer Generic Type Arguments' on the submitted test case generates a code that doesn't compile. I get: package xy; import java.util.ArrayList; import xy.LocalTest.98.Local; public class LocalTest { void m() { class Local { Local fSelf; } new ArrayList<Local>().add(new Local().fSelf); } } So the fix might not be good enough or the import statement should be removed by the UI. This might expose a UI bug. Olivier, please open another bug against JDT UI. The particular problem described in this bug (invalid signature) is fixed. Open bug 110390. Closing as VERIFIED. |