diff --git a/src/main/java/org/springframework/hateoas/mvc/TypeReferences.java b/src/main/java/org/springframework/hateoas/mvc/TypeReferences.java index 2ea7afa0..b352b10d 100644 --- a/src/main/java/org/springframework/hateoas/mvc/TypeReferences.java +++ b/src/main/java/org/springframework/hateoas/mvc/TypeReferences.java @@ -40,7 +40,8 @@ public class TypeReferences { * @author Oliver Gierke * @since 0.17 */ - public static class Resource extends SyntheticParameterizedTypeReference> {} + public static class ResourceType extends + SyntheticParameterizedTypeReference> {} /** * A {@link ParameterizedTypeReference} to return a {@link org.springframework.hateoas.Resources} of some type. @@ -48,7 +49,7 @@ public class TypeReferences { * @author Oliver Gierke * @since 0.17 */ - public static class Resources extends + public static class ResourcesType extends SyntheticParameterizedTypeReference> {} /** @@ -57,7 +58,7 @@ public class TypeReferences { * @author Oliver Gierke * @since 0.17 */ - public static class PagedResources extends + public static class PagedResourcesType extends SyntheticParameterizedTypeReference> {} /** @@ -71,7 +72,7 @@ public class TypeReferences { private final Type type; - @SuppressWarnings("rawtypes") + @SuppressWarnings({ "rawtypes", "deprecation" }) protected SyntheticParameterizedTypeReference() { Class foo = getClass(); diff --git a/src/test/java/org/springframework/hateoas/mvc/TypeReferencesIntegrationTests.java b/src/test/java/org/springframework/hateoas/mvc/TypeReferencesIntegrationTests.java index 19c8ebf6..4cd59890 100644 --- a/src/test/java/org/springframework/hateoas/mvc/TypeReferencesIntegrationTests.java +++ b/src/test/java/org/springframework/hateoas/mvc/TypeReferencesIntegrationTests.java @@ -34,6 +34,8 @@ import org.springframework.hateoas.Resource; import org.springframework.hateoas.Resources; import org.springframework.hateoas.config.EnableHypermediaSupport; import org.springframework.hateoas.config.EnableHypermediaSupport.HypermediaType; +import org.springframework.hateoas.mvc.TypeReferences.ResourceType; +import org.springframework.hateoas.mvc.TypeReferences.ResourcesType; import org.springframework.http.HttpMethod; import org.springframework.http.ResponseEntity; import org.springframework.test.context.ContextConfiguration; @@ -83,7 +85,7 @@ public class TypeReferencesIntegrationTests { server.expect(requestTo("/resource")).andRespond(withSuccess(RESOURCE, MediaTypes.HAL_JSON)); ResponseEntity> response = template.exchange("/resource", HttpMethod.GET, null, - new TypeReferences.Resource() {}); + new ResourceType() {}); assertExpectedUserResource(response.getBody()); } @@ -97,7 +99,7 @@ public class TypeReferencesIntegrationTests { server.expect(requestTo("/resources")).andRespond(withSuccess(RESOURCES_OF_USER, MediaTypes.HAL_JSON)); ResponseEntity> response = template.exchange("/resources", HttpMethod.GET, null, - new TypeReferences.Resources() {}); + new ResourcesType() {}); Resources body = response.getBody(); assertThat(body.hasLink("self"), is(true)); @@ -117,7 +119,7 @@ public class TypeReferencesIntegrationTests { server.expect(requestTo("/resources")).andRespond(withSuccess(RESOURCES_OF_RESOURCE, MediaTypes.HAL_JSON)); ResponseEntity>> response = template.exchange("/resources", HttpMethod.GET, null, - new TypeReferences.Resources>() {}); + new ResourcesType>() {}); Resources> body = response.getBody(); assertThat(body.hasLink("self"), is(true));