Here is my code:
public CommitResponse getOneCommitInfo(String commitHash) {
CommitResponse commit = new CommitResponse();
for (int i = 0; i < allCommitsList.size(); i++) {
if (((CommitResponse) allCommitsList.get(i)).getHash().equals(commitHash)) {
commit = (CommitResponse) allCommitsList.get(i);
return commit;
}
}
throw new HttpStatusCodeException(HttpStatus.NOT_FOUND);
}
The exception gives Cannot instantiate the type HttpStatusCodeException
Error, and I didn't find any related topics after searching for a while,