Previously, for new class tree like new @Slot1 ArrayList<String>(); the default type for slot1 was derived by visiting the identifier tree, not the new class tree. By overriding this method, the default type for slot1 now is derived by visiting the new class tree, which is a more precise context for annotating.
And I don't think we have to do anything else, like getting the default type for the type argument String in the above example, as the new method will recursively call visitParameterizedType and do corresponding things there.
Previously, for new class tree like
new @Slot1 ArrayList<String>();
the default type for slot1 was derived by visiting the identifier tree, not the new class tree. By overriding this method, the default type for slot1 now is derived by visiting the new class tree, which is a more precise context for annotating.And I don't think we have to do anything else, like getting the default type for the type argument
String
in the above example, as the new method will recursively callvisitParameterizedType
and do corresponding things there.