#vulnerable code 
                             public String getBeanId() {
		Class<?> factoryClass = objectFactory(destObjClass).getClass();
		Class<?> destClass = null;
		String methodName = "create" + destObjClass.substring(destObjClass.lastIndexOf(".") + 1) + StringUtils.capitalize(destFieldName);

		try {
			Method method = ReflectionUtils.findAMethod(factoryClass, methodName);
			Class<?>[] parameterTypes = method.getParameterTypes();
			for (Class<?> parameterClass : parameterTypes) {
				destClass = parameterClass;
				break;
			}
		} catch (NoSuchMethodException e) {
			MappingUtils.throwMappingException(e);
		}

		return destClass.getCanonicalName();
	} 
                            #location 17 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                             public String getBeanId() {
		Class<?> factoryClass = objectFactory(destObjClass).getClass();
		Class<?> destClass = null;
		String methodName = "create" + destObjClass.substring(destObjClass.lastIndexOf(".") + 1) + StringUtils.capitalize(destFieldName);

		try {
			Method method = ReflectionUtils.findAMethod(factoryClass, methodName);
			Class<?>[] parameterTypes = method.getParameterTypes();
			for (Class<?> parameterClass : parameterTypes) {
				destClass = parameterClass;
				break;
			}
		} catch (NoSuchMethodException e) {
			MappingUtils.throwMappingException(e);
		}

		return (destClass != null) ? destClass.getCanonicalName() : null;
	}