Skip to content

Commit

Permalink
set version as 4.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
liaochong committed May 25, 2024
1 parent d02b15c commit 28aedf7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
5 changes: 3 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<groupId>com.github.liaochong</groupId>
<artifactId>myexcel</artifactId>
<version>4.5.0</version>
<version>4.6.0</version>
<packaging>jar</packaging>

<name>myexcel</name>
Expand All @@ -36,6 +36,7 @@
<junit-jupiter-api.version>5.8.2</junit-jupiter-api.version>
<imageio-jpeg.version>3.9.4</imageio-jpeg.version>
<commons-csv.version>1.10.0</commons-csv.version>
<hibernate-validator.version>6.0.18.Final</hibernate-validator.version>
</properties>

<dependencies>
Expand Down Expand Up @@ -121,7 +122,7 @@
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
<version>6.0.18.Final</version>
<version>${hibernate-validator.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ public ValidationObject<T> validRead(File file) {

private void doValidRead(T t, RowContext rowContext, ValidationObject<T> validationObject) {
validationObject.getObjects().add(t);
Set<ConstraintViolation<T>> violations = validator.validate(t, t.getClass());
Set<ConstraintViolation<T>> violations = getValidator().validate(t, t.getClass());
ValidationObject.ValidationInfo<T> validationInfo = new ValidationObject.ValidationInfo<>();
validationInfo.setRowNum(rowContext.getRowNum());
validationInfo.setConstraintViolations(violations);
Expand Down Expand Up @@ -300,11 +300,12 @@ public static WorkbookMetaData getWorkbookMetaData(File file) {

private synchronized Validator getValidator() {
if (validator == null) {
ValidatorFactory validatorFactory = Validation
try (ValidatorFactory validatorFactory = Validation
.byProvider(HibernateValidator.class)
.configure()
.buildValidatorFactory();
validator = validatorFactory.getValidator();
.buildValidatorFactory()) {
validator = validatorFactory.getValidator();
}
}
return validator;
}
Expand Down

0 comments on commit 28aedf7

Please sign in to comment.