private Class<?> toClass(String classId) { if (this.idClassMapping.containsKey(classId)) { return this.idClassMapping.get(classId); } if (classId.equals(DEFAULT_HASHTABLE_TYPE_ID)) { return this.defaultMapClass; } try { if (!isTrustedPackage(classId)) { throw new IllegalArgumentException("The class '" + classId + "' is not in the trusted packages: " + this.trustedPackages + ". " + "If you believe this class is safe to deserialize, please provide its name. " + "If the serialization is only done by a trusted source, you can also enable trust all (*)."); } else { return ClassUtils.forName(classId, ClassUtils.getDefaultClassLoader()); } } catch (ClassNotFoundException | LinkageError e) { throw new MessageConversionException( "failed to resolve class name [" + classId + "]", e); } }