imbajin commented on PR #718:
URL: 
https://github.com/apache/hugegraph-toolchain/pull/718#issuecomment-4266864827

   ### Code review
   
   Found 1 issue:
   
   1. **`build()` skips null validation even when url/graph become null via 
post-construction config methods** — The constructor checks and `build()` 
checks serve different purposes. The constructor guards against invalid initial 
state; `build()` guards against invalid mutations via `configUrl(null)` / 
`configGraph(null)` after construction. Bundling both under 
`skipRequiredChecks` means a user who creates a builder with 
`skipRequiredChecks=true` and then accidentally calls `configUrl(null)` will 
get a silent NPE deep inside `HugeClient` initialization rather than a clear 
`IllegalArgumentException`. The `skipRequiredChecks` flag should only apply to 
the constructor, not `build()`.
   
   
https://github.com/apache/hugegraph-toolchain/blob/aa8044bc32b263d6ebd462bf135f5d724538da3f/hugegraph-client/src/main/java/org/apache/hugegraph/driver/HugeClientBuilder.java#L90-L98
   
   <sub>- If this code review was useful, please react with a thumbs up. 
Otherwise, react with a thumbs down.</sub>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to