JBIDE-12974 fix bug in generation of references so that type=0 and 1, not type=0 twice >> master