Fix UdevDevice.getSysname() calling udev_device_get_syspath#1715
Merged
dbwiddis merged 1 commit intojava-native-access:masterfrom Apr 13, 2026
Merged
Fix UdevDevice.getSysname() calling udev_device_get_syspath#1715dbwiddis merged 1 commit intojava-native-access:masterfrom
dbwiddis merged 1 commit intojava-native-access:masterfrom
Conversation
udev_device_get_sysname UdevDevice.getSysname() was calling udev_device_get_syspath instead of udev_device_get_sysname due to a copy-paste error. Fix: getSysname() now calls udev_device_get_sysname. Test: added assertion that sysname is strictly shorter than syspath, which would have caught this originally.
matthiasblaesing
approved these changes
Apr 13, 2026
Member
matthiasblaesing
left a comment
There was a problem hiding this comment.
Makes sense to me. I bet some poor soul did not read the docs, but it is the right thing to do.
Contributor
Author
I've heard this type of copy-paste bug is one of the most common bug types, particularly at the start or end of a list. Easily flagged by today's automated AI code reviewers. Speaking of which, you might consider installing CodeRabbit on this repo. It's immensely helped me on other repos I maintain in getting through that initial back-and-forth with the contributor to handle obvious things before a human spends time reviewing it. It's free for open source.... and 80% of its findings are useful (and it learns from you if you comment on the non useful ones.) |
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.
UdevDevice.getSysname()has been callingudev_device_get_syspathsince it was introduced in 2020 -- a sloppy copy-paste bug by whoever wrote it. At least he caught the bug six years later.The existing test technically covered this with:
But since
getSysname()returned the syspath itself,syspath.endsWith(syspath)is always true, so the bug sailed right through.Added test assertion that sysname is strictly shorter than syspath, which would have caught this originally.