From 5791e9b201aa9681e80c5fcc7441ced497f7a162 Mon Sep 17 00:00:00 2001 From: Oliver Gierke Date: Thu, 1 May 2014 20:22:23 +0200 Subject: [PATCH] DATACMNS-495 - Prepare 1.8.0.RC1. Removed compiler warnings (obsolete @SuppressWarnings and obsolete code). Upgraded to Spring HATEOAS 0.11.0. --- pom.xml | 2 +- .../data/convert/JodaTimeConverters.java | 3 ++- .../data/util/ClassTypeInformation.java | 1 - .../data/util/ParameterizedTypeInformation.java | 1 - .../org/springframework/data/util/TypeDiscoverer.java | 3 +-- .../support/DomainClassConverterUnitTests.java | 11 +---------- .../support/DomainClassPropertyEditorUnitTests.java | 10 ---------- 7 files changed, 5 insertions(+), 26 deletions(-) diff --git a/pom.xml b/pom.xml index 6365b6731..5f949c2ab 100644 --- a/pom.xml +++ b/pom.xml @@ -18,7 +18,7 @@ 16.0.1 - 0.10.0.RELEASE + 0.11.0.RELEASE DATACMNS diff --git a/src/main/java/org/springframework/data/convert/JodaTimeConverters.java b/src/main/java/org/springframework/data/convert/JodaTimeConverters.java index b049ff7d7..a06d4f961 100644 --- a/src/main/java/org/springframework/data/convert/JodaTimeConverters.java +++ b/src/main/java/org/springframework/data/convert/JodaTimeConverters.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2014 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. @@ -34,6 +34,7 @@ import org.springframework.util.ClassUtils; * * @author Oliver Gierke */ +@SuppressWarnings("deprecation") public abstract class JodaTimeConverters { private static final boolean JODA_TIME_IS_PRESENT = ClassUtils.isPresent("org.joda.time.LocalDate", null); diff --git a/src/main/java/org/springframework/data/util/ClassTypeInformation.java b/src/main/java/org/springframework/data/util/ClassTypeInformation.java index 1d56725d6..afecda03a 100644 --- a/src/main/java/org/springframework/data/util/ClassTypeInformation.java +++ b/src/main/java/org/springframework/data/util/ClassTypeInformation.java @@ -97,7 +97,6 @@ public class ClassTypeInformation extends TypeDiscoverer { * * @param type */ - @SuppressWarnings("deprecation") ClassTypeInformation(Class type) { this(type, GenericTypeResolver.getTypeVariableMap(type)); } diff --git a/src/main/java/org/springframework/data/util/ParameterizedTypeInformation.java b/src/main/java/org/springframework/data/util/ParameterizedTypeInformation.java index 65e64c542..3c301ade3 100644 --- a/src/main/java/org/springframework/data/util/ParameterizedTypeInformation.java +++ b/src/main/java/org/springframework/data/util/ParameterizedTypeInformation.java @@ -54,7 +54,6 @@ class ParameterizedTypeInformation extends ParentTypeAwareTypeInformation * @see org.springframework.data.util.TypeDiscoverer#getMapValueType() */ @Override - @SuppressWarnings("deprecation") public TypeInformation getMapValueType() { if (Map.class.isAssignableFrom(getType())) { diff --git a/src/main/java/org/springframework/data/util/TypeDiscoverer.java b/src/main/java/org/springframework/data/util/TypeDiscoverer.java index c1534721d..c43b3407b 100644 --- a/src/main/java/org/springframework/data/util/TypeDiscoverer.java +++ b/src/main/java/org/springframework/data/util/TypeDiscoverer.java @@ -94,7 +94,6 @@ class TypeDiscoverer implements TypeInformation { return new ClassTypeInformation((Class) fieldType); } - @SuppressWarnings("deprecation") Map variableMap = GenericTypeResolver.getTypeVariableMap(resolveType(fieldType)); if (fieldType instanceof ParameterizedType) { @@ -136,7 +135,7 @@ class TypeDiscoverer implements TypeInformation { * @param type * @return */ - @SuppressWarnings({ "unchecked", "deprecation" }) + @SuppressWarnings("unchecked") protected Class resolveType(Type type) { return (Class) GenericTypeResolver.resolveType(type, getTypeVariableMap()); } diff --git a/src/test/java/org/springframework/data/repository/support/DomainClassConverterUnitTests.java b/src/test/java/org/springframework/data/repository/support/DomainClassConverterUnitTests.java index 41b3162e4..f78778d64 100644 --- a/src/test/java/org/springframework/data/repository/support/DomainClassConverterUnitTests.java +++ b/src/test/java/org/springframework/data/repository/support/DomainClassConverterUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2008-2013 the original author or authors. + * Copyright 2008-2014 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. @@ -20,8 +20,6 @@ import static org.junit.Assert.*; import static org.mockito.Matchers.*; import static org.mockito.Mockito.*; -import java.io.Serializable; - import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -35,11 +33,7 @@ import org.springframework.context.support.GenericApplicationContext; import org.springframework.core.convert.TypeDescriptor; import org.springframework.core.convert.support.DefaultConversionService; import org.springframework.data.repository.CrudRepository; -import org.springframework.data.repository.core.EntityInformation; -import org.springframework.data.repository.core.RepositoryInformation; -import org.springframework.data.repository.core.support.DummyEntityInformation; import org.springframework.data.repository.core.support.DummyRepositoryFactoryBean; -import org.springframework.data.repository.core.support.DummyRepositoryInformation; /** * Unit test for {@link DomainClassConverter}. @@ -62,9 +56,6 @@ public class DomainClassConverterUnitTests { @SuppressWarnings({ "unchecked", "rawtypes" }) public void setUp() { - EntityInformation information = new DummyEntityInformation(User.class); - RepositoryInformation repositoryInformation = new DummyRepositoryInformation(UserRepository.class); - converter = new DomainClassConverter(service); sourceDescriptor = TypeDescriptor.valueOf(String.class); diff --git a/src/test/java/org/springframework/data/repository/support/DomainClassPropertyEditorUnitTests.java b/src/test/java/org/springframework/data/repository/support/DomainClassPropertyEditorUnitTests.java index e457c1bf6..b7eb35ac2 100644 --- a/src/test/java/org/springframework/data/repository/support/DomainClassPropertyEditorUnitTests.java +++ b/src/test/java/org/springframework/data/repository/support/DomainClassPropertyEditorUnitTests.java @@ -28,7 +28,6 @@ import org.mockito.Mock; import org.mockito.runners.MockitoJUnitRunner; import org.springframework.beans.PropertyEditorRegistry; import org.springframework.data.domain.Persistable; -import org.springframework.data.repository.CrudRepository; import org.springframework.data.repository.core.CrudInvoker; import org.springframework.data.repository.core.EntityInformation; @@ -150,13 +149,4 @@ public class DomainClassPropertyEditorUnitTests { return getId() != null; } } - - /** - * Sample generic DAO interface. - * - * @author Oliver Gierke - */ - private static interface UserRepository extends CrudRepository { - - } }