Work around flow analysis bug in javac (JDK-8054569)

https://bugs.openjdk.java.net/browse/JDK-8054569
This commit is contained in:
Andy Wilkinson
2014-11-04 10:46:47 +00:00
parent adddb1471a
commit 57dd861958

View File

@@ -95,10 +95,10 @@ public class NotesController {
@RequestMapping(value = "/{id}/tags", method = RequestMethod.GET)
ResourceSupport noteTags(@PathVariable("id") long id) {
return new NestedContentResource<TagResource>(
this.tagResourceAssembler
.toResources(this.noteRepository.findById(id)
.orElseThrow(() -> new ResourceDoesNotExistException())
.getTags()));
this.tagResourceAssembler.toResources(this.noteRepository
.findById(id)
.orElseThrow(
() -> new ResourceDoesNotExistException()).getTags()));
}
@RequestMapping(value = "/{id}", method = RequestMethod.PATCH)
@@ -122,7 +122,7 @@ public class NotesController {
return tagLocations
.stream()
.map(location -> this.tagRepository.findById(extractTagId(location))
.orElseThrow(
.<IllegalArgumentException> orElseThrow(
() -> new IllegalArgumentException("The tag '" + location
+ "' does not exist")))
.collect(Collectors.toList());