FINERACT-2555: Refactor string validation by removing redundant length check#5695
FINERACT-2555: Refactor string validation by removing redundant length check#5695tiagosune wants to merge 1 commit intoapache:developfrom
Conversation
dr-fuch
left a comment
There was a problem hiding this comment.
I believe your change is OK.
I noticed that IP_HEADER_CANDIDATES in the corresponding test is defined but never used. Maybe we can define it in IpAddressUtils and use it in both CallerIpTrackingFilter and IpTrackingFilterTest classes, respectively.
I'm not sure if we should address that last observation within this ticket (changing its scope) or create a new one just for that.
Don't forget to assign the Jira ticket to yourself, since you just created it.
I suggest keeping just one commit for this PR; it seems you included an extra blank commit.
Thank you for the review and the suggestions! I agree that extracting IP_HEADER_CANDIDATES into IpAddressUtils would improve code reuse and consistency. To keep this PR focused, I suggest creating a separate JIRA ticket for that improvement. I can work on it right after this PR. I also noticed that I don't have permission to assign the JIRA ticket to myself, but I would be happy to take ownership of it. I will clean up the commits as suggested. |
561fbfd to
e0f4acb
Compare
dr-fuch
left a comment
There was a problem hiding this comment.
Please check the latest check failures.
e0f4acb to
61f1ef2
Compare
The issue was related to commit signing. I’ve re-signed the commit using GPG and force-pushed the updated commit. Please let me know if everything looks good now. |
61f1ef2 to
3fc43d9
Compare
|
I’ve re-triggered the CI by amending the commit to verify if the E2E failures were transient. |
Description
This PR simplifies string validation by removing redundant checks.
The previous condition used both length() != 0 and isEmpty(), which is unnecessary.
The updated version uses only !isEmpty(), improving readability and following best practices.
This change also aligns with SonarQube recommendations.
No functional changes are introduced.
Checklist
Please make sure these boxes are checked before submitting your pull request - thanks!
Your assigned reviewer(s) will follow our guidelines for code reviews.