JDTModelLoader: refactored some code due to ceylon/ceylon-compiler#1604