-
Notifications
You must be signed in to change notification settings - Fork 147
Open
Description
Hello Stephane, I'm taking your course right now, and during it just found the approach you use, which in my opinion could be improved.
I understand that the course is not about "good practices" or "java coding", but since the students could refer to this code, it makes sense to use best practices.
In this case, ObjectId has a static method #isValid, and we can make this check (with returning INVALID_ARGUMENT status) instead of naive try-catch.
grpc-java-course/src/main/java/com/github/simplesteph/grpc/blog/server/BlogServiceImpl.java
Line 64 in f4352f6
| result = collection.find(eq("_id", new ObjectId(blogId))) |
Metadata
Metadata
Assignees
Labels
No labels