The methods isToolUseStart and isToolUseFinish in the StreamHelper class contain repeated logic for checking if a StreamEvent is valid and matches a specific EventType. Specifically, both methods include repetitive null checks for event and event.type(). This duplication increases maintenance overhead and reduces code clarity.
Description
The methods isToolUseStart and isToolUseFinish in the StreamHelper class contain repeated logic for checking if a StreamEvent is valid and matches a specific EventType. Specifically, both methods include repetitive null checks for event and event.type(). This duplication increases maintenance overhead and reduces code clarity.
StreamHelper.java
isToolUseStart
isToolUseFinish
Suggest Improvement