Skip to content

Commit 56f2ee0

Browse files
dukbongmp911de
authored andcommitted
Use Assert.state improve code readability.
Closes #3442
1 parent 8456d2e commit 56f2ee0

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

spring-data-jpa/src/main/java/org/springframework/data/jpa/mapping/JpaPersistentEntityImpl.java

+2-4
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,8 @@ public void verify() {
7979
super.verify();
8080

8181
JpaPersistentProperty versionProperty = getVersionProperty();
82-
83-
if (versionProperty != null && versionProperty.isAnnotationPresent(Version.class)) {
84-
throw new IllegalArgumentException(String.format(INVALID_VERSION_ANNOTATION, versionProperty));
85-
}
82+
Assert.state(versionProperty != null && versionProperty.isAnnotationPresent(Version.class),
83+
() -> String.format(INVALID_VERSION_ANNOTATION, versionProperty));
8684
}
8785

8886
JpaMetamodel getMetamodel() {

0 commit comments

Comments
 (0)