Unqualified function imports are modelled in a peculiar way, as J.Import currently requires a J.FieldAccess. This modelling with a J.Empty later leads to a ClassCastException when calling packageName() on the import.
Until a proper fix is here (changing the model), this commit changes Autodetect so that it doesn't provoke the ClassCastException.
Unqualified function imports are modelled in a peculiar way, as
J.Import
currently requires aJ.FieldAccess
. This modelling with aJ.Empty
later leads to aClassCastException
when callingpackageName()
on the import.Until a proper fix is here (changing the model), this commit changes
Autodetect
so that it doesn't provoke theClassCastException
.