#788 - Fixed obvious warning in all touched files.

* Fixed assertions.
* Removed superfluous code.
* Simplified generics.
* Formatting.
This commit is contained in:
Jens Schauder
2019-01-22 16:05:36 +01:00
committed by Greg Turnquist
parent 4081e58a1f
commit 9f4f1ad79b
27 changed files with 397 additions and 254 deletions

View File

@@ -203,12 +203,12 @@ class HalFormsSerializers {
if (!(model.getHttpMethod() == HttpMethod.GET)) {
validate(resource, affordance, model);
validate(resource, model);
HalFormsTemplate template = HalFormsTemplate.forMethod(model.getHttpMethod()) //
.withProperties(model.getInputProperties());
/**
/*
* First template in HAL-FORMS is "default".
*/
templates.put(templates.isEmpty() ? "default" : model.getName(), template);
@@ -221,12 +221,11 @@ class HalFormsSerializers {
/**
* Verify that the resource's self link and the affordance's URI have the same relative path.
*
*
* @param resource
* @param affordance
* @param model
*/
private static void validate(ResourceSupport resource, Affordance affordance, HalFormsAffordanceModel model) {
private static void validate(ResourceSupport resource, HalFormsAffordanceModel model) {
String affordanceUri = model.getURI();
String selfLinkUri = resource.getRequiredLink(IanaLinkRelation.SELF.value()).expand().getHref();