PackagingElementEntity () { assert myStorage != null; EntityStorage base = myStorage.getBase(); ExternalEntityMapping<Object> externalMapping = base.getExternalMapping("intellij.artifacts.packaging.elements"); PackagingElementEntity entity = (PackagingElementEntity)externalMapping.getFirstEntity(this); if (entity == null) { throw new RuntimeException("Cannot find an entity"); } return entity; }