[BZ-1054823] fix NPE when creating a kjar containing a type declaration referring to an existing java class