Buggy code:
@ Path ( "model" ) @ Api ( value = "//model" , description = "Models<seq2seq4repair_space>API" ) public class ModelResource { @ Context UriInfo uriInfo ; @ EJB ModelHandler modelHandler ; @ EJB PredictionService predictionService ; @ GET @ Produces ( { MediaType . APPLICATION_JSON , "text//uri-list" } ) @ ApiOperation ( value = "Finds<seq2seq4repair_space>all<seq2seq4repair_space>Models" , notes = "Finds<seq2seq4repair_space>all<seq2seq4repair_space>Models<seq2seq4repair_space>from<seq2seq4repair_space>Jaqpot<seq2seq4repair_space>Dataset" , response = Model . class , responseContainer = "List" ) @ ApiResponses ( { @ ApiResponse ( code = 200 , message = "Models<seq2seq4repair_space>found<seq2seq4repair_space>and<seq2seq4repair_space>are<seq2seq4repair_space>listed<seq2seq4repair_space>in<seq2seq4repair_space>the<seq2seq4repair_space>response<seq2seq4repair_space>body" ) , @ ApiResponse ( code = 204 , message = "No<seq2seq4repair_space>content:<seq2seq4repair_space>The<seq2seq4repair_space>request<seq2seq4repair_space>succeeded,<seq2seq4repair_space>but<seq2seq4repair_space>there<seq2seq4repair_space>are<seq2seq4repair_space>no<seq2seq4repair_space>models<seq2seq4repair_space>" + "matching<seq2seq4repair_space>your<seq2seq4repair_space>search<seq2seq4repair_space>criteria." ) , @ ApiResponse ( code = 500 , message = "Internal<seq2seq4repair_space>server<seq2seq4repair_space>error<seq2seq4repair_space>-<seq2seq4repair_space>this<seq2seq4repair_space>request<seq2seq4repair_space>cannot<seq2seq4repair_space>be<seq2seq4repair_space>served." ) } ) public Response getModels ( @ ApiParam ( "Creator<seq2seq4repair_space>of<seq2seq4repair_space>the<seq2seq4repair_space>model<seq2seq4repair_space>(username)" ) @ QueryParam ( "creator" ) String creator ) { } @ GET @ Produces ( MediaType . APPLICATION_JSON ) @ Path ( "//{id}" ) @ ApiOperation ( value = "Finds<seq2seq4repair_space>Model<seq2seq4repair_space>by<seq2seq4repair_space>Id" , notes = "Finds<seq2seq4repair_space>specified<seq2seq4repair_space>Model" , response = Model . class ) @ ApiResponses ( { @ ApiResponse ( code = 200 , message = "Model<seq2seq4repair_space>is<seq2seq4repair_space>found" ) , @ ApiResponse ( code = 401 , message = "You<seq2seq4repair_space>are<seq2seq4repair_space>not<seq2seq4repair_space>authorized<seq2seq4repair_space>to<seq2seq4repair_space>access<seq2seq4repair_space>this<seq2seq4repair_space>model" ) , @ ApiResponse ( code = 403 , message = "This<seq2seq4repair_space>request<seq2seq4repair_space>is<seq2seq4repair_space>forbidden<seq2seq4repair_space>(e.g.,<seq2seq4repair_space>no<seq2seq4repair_space>authentication<seq2seq4repair_space>token<seq2seq4repair_space>is<seq2seq4repair_space>provided)" ) , @ ApiResponse ( code = 404 , message = "This<seq2seq4repair_space>model<seq2seq4repair_space>was<seq2seq4repair_space>not<seq2seq4repair_space>found." ) , @ ApiResponse ( code = 500 , message = "Internal<seq2seq4repair_space>server<seq2seq4repair_space>error<seq2seq4repair_space>-<seq2seq4repair_space>this<seq2seq4repair_space>request<seq2seq4repair_space>cannot<seq2seq4repair_space>be<seq2seq4repair_space>served." ) } ) public Response getModel ( @ PathParam ( "id" ) String id , @ ApiParam ( "Clients<seq2seq4repair_space>need<seq2seq4repair_space>to<seq2seq4repair_space>authenticate<seq2seq4repair_space>in<seq2seq4repair_space>order<seq2seq4repair_space>to<seq2seq4repair_space>access<seq2seq4repair_space>models" ) @ HeaderParam ( "subjectid" ) String subjectId ) { <START_BUG> Model model = modelHandler . find ( id ) ; <END_BUG> if ( model == null ) { return Response . ok ( ErrorReportFactory . notFoundError ( uriInfo . getPath ( ) ) ) . status ( NOT_FOUND ) . build ( ) ; } return Response . ok ( model ) . build ( ) ; } @ POST @ Produces ( { MediaType . APPLICATION_JSON } ) @ Path ( "//{id}" ) @ ApiOperation ( value = "Creates<seq2seq4repair_space>Prediction" , notes = "Creates<seq2seq4repair_space>Prediction" , response = Task . class ) public Response makePrediction ( @ FormParam ( "dataset_uri" ) String datasetURI , @ PathParam ( "id" ) String id , @ HeaderParam ( "subjectid" ) String subjectId ) throws GeneralSecurityException { } }

Fix:
Model model = modelHandler . findModelMeta ( id ) ;