question: @ VisibleForTesting protected static PlacementTask buildPatch ( TaskState . TaskStage patchStage , boolean isDirect , Throwable t ) { PlacementTask state = new PlacementTask ( ) ; state . taskState = new TaskState ( ) ; state . taskState . stage = patchStage ; state . taskState . isDirect = isDirect ; if ( null != t ) { state . taskState . failure = Utils . toServiceErrorResponse ( t ) ; } return state ; }
target:  Builds a new PlacementTask with the specified stage and isDirect boolean. If Throwable t is set then the failure response is added to the task state.