Update SMIMETest.java - #2386
Closed
cragkhit wants to merge 1 commit into
Closed
Conversation
Add identity and null checks before comparing byte arrays.
Closed
Contributor
|
Appreciate the effort to improve the library. It's an interesting idea, although in this case it's really the wrong spot - it's a test class and the method should never be called with anything that's null. Perhaps more importantly, the patches "if (a == b)" will return true if both a and b are null, which would be a disaster for the test's effectiveness. For these reasons, this one I will not merge, however I would be interested to see what else you come up with. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi. We are researchers from Mahidol University, Thailand, and the State University of Ceará, Brazil, working on a research project for improving open-source projects by using the latest accepted answer from Stack Overflow that matched your code snippet. We found this recommendation for improving your code from https://stackoverflow.com/a/40056844.
Note: Our study is approved by the Institutional Review Board of Mahidol University. You can find the participant information sheet explaining this study at https://drive.google.com/file/d/1ml5AqrtWQ9pnifTQyTFTcWQmwp6RuPA7/view?usp=sharing.
Disclosure: This contribution was prepared with assistance from OpenAI Codex. I reviewed and verified the resulting change.
This replaces #2371, whose branch contained unrelated divergent history.
Proposed change
Add identity and null checks before comparing the byte arrays.
Testing
./gradlew :util:compileTestJavapassed../gradlew :util:testcompiled and ran, but 10 unrelated C509CertificateTest cases failed with FileNotFoundException because their resource files were unavailable in the checkout.