Program: 5666
Project: 5666
Buggy source:
/** 
 * Executes a search for CDAP entities in the specified namespace with the specified search query and an optional set of   {@link MetadataSearchTargetType entity types} in the specified {@link MetadataScope}.
 * @param namespaceId the namespace id to filter the search by
 * @param searchQuery the search query
 * @param types the types of CDAP entity to be searched. If empty all possible types will be searched
 * @param sortInfo represents sorting information. Use {@link SortInfo#DEFAULT} to return search results withoutsorting (which implies that the sort order is by relevance to the search query)
 * @param offset the index to start with in the search results. To return results from the beginning, pass {@code 0}
 * @param limit the number of results to return, starting from #offset. To return all, pass {@link Integer#MAX_VALUE}
 * @param numCursors the number of cursors to return in the response. A cursor identifies the first index of thenext page for pagination purposes
 * @param cursor the cursor that acts as the starting index for the requested page. This is only applicable when#sortInfo is not  {@link SortInfo#DEFAULT}. If offset is also specified, it is applied starting at the cursor. If   {@code null}, the first row is used as the cursor
 * @return the {@link MetadataSearchResponse} containing search results for the specified search query and filters
 */
MetadataSearchResponse search(String namespaceId,String searchQuery,Set<MetadataSearchTargetType> types,SortInfo sortInfo,int offset,int limit,int numCursors,String cursor) throws Exception ;

Fixed version (ground truth):
/** 
 * Executes a search for CDAP entities in the specified namespace with the specified search query and an optional set of   {@link MetadataSearchTargetType entity types} in the specified {@link MetadataScope}.
 * @param namespaceId the namespace id to filter the search by
 * @param searchQuery the search query
 * @param types the types of CDAP entity to be searched. If empty all possible types will be searched
 * @param sortInfo represents sorting information. Use {@link SortInfo#DEFAULT} to return search results withoutsorting (which implies that the sort order is by relevance to the search query)
 * @param offset the index to start with in the search results. To return results from the beginning, pass {@code 0}
 * @param limit the number of results to return, starting from #offset. To return all, pass {@link Integer#MAX_VALUE}
 * @param numCursors the number of cursors to return in the response. A cursor identifies the first index of thenext page for pagination purposes. Defaults to  {@code 0}
 * @param cursor the cursor that acts as the starting index for the requested page. This is only applicable when#sortInfo is not  {@link SortInfo#DEFAULT}. If offset is also specified, it is applied starting at the cursor. If   {@code null}, the first row is used as the cursor
 * @return the {@link MetadataSearchResponse} containing search results for the specified search query and filters
 */
MetadataSearchResponse search(String namespaceId,String searchQuery,Set<MetadataSearchTargetType> types,SortInfo sortInfo,int offset,int limit,int numCursors,String cursor) throws Exception ;