From 495ac13c6dcca5df8b1f9a37a78a05e19a49959a Mon Sep 17 00:00:00 2001 From: Michael Reiche <48999328+mikereiche@users.noreply.github.com> Date: Fri, 10 Dec 2021 10:52:13 -0800 Subject: [PATCH] Fix for 5_0_x branch. (#1281) Closes #1280. Co-authored-by: mikereiche --- .../event/ValidatingCouchbaseEventListener.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/springframework/data/couchbase/core/mapping/event/ValidatingCouchbaseEventListener.java b/src/main/java/org/springframework/data/couchbase/core/mapping/event/ValidatingCouchbaseEventListener.java index 66bdacfd..ebd388ef 100644 --- a/src/main/java/org/springframework/data/couchbase/core/mapping/event/ValidatingCouchbaseEventListener.java +++ b/src/main/java/org/springframework/data/couchbase/core/mapping/event/ValidatingCouchbaseEventListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors + * Copyright 2012-2021 the original author or authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,10 +16,11 @@ package org.springframework.data.couchbase.core.mapping.event; +import jakarta.validation.ConstraintViolationException; +import jakarta.validation.Validator; + import java.util.Set; - -import jakarta.validation.ConstraintViolationException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.data.couchbase.core.mapping.CouchbaseDocument; @@ -33,19 +34,20 @@ import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean; * @author Maciej Walkowiak * @author Michael Nitschinger * @author Mark Paluch + * @author Michael Reiche */ public class ValidatingCouchbaseEventListener extends AbstractCouchbaseEventListener { private static final Logger LOG = LoggerFactory.getLogger(ValidatingCouchbaseEventListener.class); - private final LocalValidatorFactoryBean validator; + private final Validator validator; /** * Creates a new {@link ValidatingCouchbaseEventListener} using the given {@link Validator}. * * @param validator must not be {@literal null}. */ - public ValidatingCouchbaseEventListener(LocalValidatorFactoryBean validator) { + public ValidatingCouchbaseEventListener(Validator validator) { Assert.notNull(validator, "Validator must not be null!"); this.validator = validator; }