STS-3378: fix for ClassCastException when doing code completion in import statements