Summary: | Quick Fix: wrong proposal | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Dirk Baeumer <dirk_baeumer> |
Component: | Core | Assignee: | Olivier Thomann <Olivier_Thomann> |
Status: | RESOLVED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | P2 | CC: | martinae, Olivier_Thomann |
Version: | 2.0 | ||
Target Milestone: | 2.0 M6 | ||
Hardware: | PC | ||
OS: | Windows 2000 | ||
Whiteboard: |
Description
Dirk Baeumer
2002-04-10 08:36:21 EDT
The type binding I get in this case is a primitive type with the name 'null'. Is this a bug or just undocumented? null objects are of type NullBinding. If this is a well-known one, you could propose in place Object. Olivier - can you comment on this one ? I will try to see which binding is returned in this case. Ok, I checked. Indeed it is the NullTypeBinding. I can return java.lang.Object in this case if you want to. I think it makes more sense. Will be fixed today. In case you have a array like: tab = null; and you want tab to be an int[], then java.lang.Object is not exactly appropriate here. I am not sure that I should change anything. Let me know what you think. Let me know what do you want to do in the array case. If no answer, I consider this PR as invalid and it will be closed. but Object o= new int[0] is valid. if you don't want to change this, documentation in ITypeBinding is ok. I will update the documentation of the getName() method on ITypeBinding to add the "null" case for a NullTypeBinding. We should introduce a new kind of ITypeBinding for the null type. The null type is now specified in the ITypeBinding documentation. A new method has been added on ITypeBinding isNullType(). Regression test added. Fixed and released in HEAD. |