diff --git a/apache-cxf/cxf-jaxrs-implementation/src/main/java/com/baeldung/cxf/jaxrs/implementation/Course.java b/apache-cxf/cxf-jaxrs-implementation/src/main/java/com/baeldung/cxf/jaxrs/implementation/Course.java index 9ab74bea58..802a19e961 100644 --- a/apache-cxf/cxf-jaxrs-implementation/src/main/java/com/baeldung/cxf/jaxrs/implementation/Course.java +++ b/apache-cxf/cxf-jaxrs-implementation/src/main/java/com/baeldung/cxf/jaxrs/implementation/Course.java @@ -61,13 +61,11 @@ public class Course { @Path("{studentOrder}") public Response deleteStudent(@PathParam("studentOrder") int studentOrder) { Student student = students.get(studentOrder); - Response response; if (student != null) { students.remove(studentOrder); - response = Response.ok().build(); + return Response.ok().build(); } else { - response = Response.notModified().build(); + return Response.notModified().build(); } - return response; } } \ No newline at end of file