Fix missing jdeps by consistently calling collectTypeReferences
#1045
+213
−36
collectTypeReferences
#1045