generator = Randomness.choice(getGeneratorsForSpecialCase(clazz)); if (generator == null) { logger.warn("No generator for special case class: " + clazz);
/** * Get a list of all generator objects for the type * * @param clazz * @param resolve * @return * @throws ConstructionFailedException */ public Set<GenericAccessibleObject<?>> getGenerators(GenericClass clazz, boolean resolve) throws ConstructionFailedException { // Instantiate generic type if (clazz.hasWildcardOrTypeVariables()) { GenericClass concreteClass = clazz.getGenericInstantiation(); if (!concreteClass.equals(clazz)) return getGenerators(concreteClass, false); } if (isSpecialCase(clazz)) { return getGeneratorsForSpecialCase(clazz); } if (!hasGenerator(clazz)) throw new ConstructionFailedException("No generators of type " + clazz); return generatorCache.get(clazz); }
Collection<GenericAccessibleObject<?>> generators = getGeneratorsForSpecialCase(clazz); if (generators.isEmpty()) { logger.warn("No generators for class: " + clazz);