felipevendrami opened a new pull request, #1321: URL: https://github.com/apache/commons-lang/pull/1321
### Encapsulate fields left and right in MutablePair to improve data integrity **Description:** This pull request addresses the issue identified by SpotBugs (PA_PUBLIC_PRIMITIVE_ATTRIBUTE) regarding the "left" and "right" fields in the MutablePair class. These fields were publicly accessible, which exposed them to potential unintended modification, violating the principle of encapsulation. **Changes made:** 1. Encapsulation: The fields "left" and "right" in MutablePair were changed from public to private to improve data integrity. 2. Getter methods: The getLeft() and getRight() methods were already present, so no additional getters were created. 3. Test class update: Updated MutablePairTest to use the getLeft() and getRight() methods instead of accessing the fields directly. **SpotBugs Reference:** This change resolves the SpotBugs warning: PA_PUBLIC_PRIMITIVE_ATTRIBUTE Reference: MutablePair.java:[line 138] **Why this change is important:** Encapsulating fields ensures better control over the internal state of the MutablePair object, preventing potential misuse and maintaining consistency within the class. -- 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]
