Community
Participate
Working Groups
Build 20020409 public class QuickFixTest { public void foo() { fField= null; } } Try to quick fix fField. All proposals try to create something like "null fField"
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.