DATACMNS-1210 - Polishing.

More fixes of imports. Removed obsolete generics in constructor expressions. Removed a couple of compiler warnings in test cases. Removed assumption for test case to only run on JDK 9.

Original pull request: #259.
This commit is contained in:
Oliver Gierke
2017-11-14 17:43:51 +01:00
parent 309cdc5e43
commit 24c1b823c6
2 changed files with 19 additions and 12 deletions

View File

@@ -55,7 +55,7 @@ import org.springframework.data.mapping.Person;
import org.springframework.data.mapping.context.SampleMappingContext;
import org.springframework.data.mapping.context.SamplePersistentProperty;
import org.springframework.data.util.ClassTypeInformation;
import org.springframework.data.util.Version;
import org.springframework.lang.Nullable;
import org.springframework.test.util.ReflectionTestUtils;
/**
@@ -286,19 +286,16 @@ public class BasicPersistentEntityUnitTests<T extends PersistentProperty<T>> {
@Test // DATACMNS-1210
public void findAnnotationShouldBeThreadSafe() throws InterruptedException {
assumeTrue("Requires Java 9",
Version.parse(System.getProperty("java.version")).isGreaterThanOrEqualTo(Version.parse("9.0")));
CountDownLatch latch = new CountDownLatch(2);
CountDownLatch syncLatch = new CountDownLatch(1);
AtomicBoolean failed = new AtomicBoolean(false);
final AtomicBoolean failed = new AtomicBoolean(false);
PersistentEntity<EntityWithAnnotation, T> entity = new BasicPersistentEntity(
PersistentEntity<EntityWithAnnotation, T> entity = new BasicPersistentEntity<EntityWithAnnotation, T>(
ClassTypeInformation.from(EntityWithAnnotation.class), null) {
@Nullable
@Override
public Annotation findAnnotation(Class annotationType) {
public <A extends Annotation> A findAnnotation(Class<A> annotationType) {
try {
syncLatch.await();