Oshi: DetectVM - Wrong comparison of result

Created on 17 Jul 2019  路  9Comments  路  Source: oshi/oshi

In the class DetectVM (package _oshi.demo_), the method _findOuiByMacAddressIfPossible_ returns an empty string if no entry was found in the _vmMacAddressOUI_ map. However, the result is checked to null (not empty String), which means that the method always ends after the MAC address check.

confirmed bug first-timers-only good first issue

Most helpful comment

I'm marking this issue for first-timers-only. That means that I will only accept a PR for this one from someone who's never contributed to open source before. This one is easy (but don't make that statement make you feel bad if you have a hard time with it, there's more to contributing to open source than changing lines of code, especially if it's your first time). I'll hold your hand through this if you need me to. :-) Here are the steps to get a PR merged here.

  • [ ] Read the CONTRIBUTING file for reference. I'll walk you through anything you don't understand.
  • [ ] Find the DetectVM.java class. At line 87, the code only checks for a non null string. This is a bug, because the code should also check for an empty string.
  • [ ] Alter the code to additionally check for an empty String.
  • [ ] Fork the project, commit your changes to your fork, create a PR, and get it merged
  • [ ] Celebrate

All 9 comments

Not only the MAC check, but the first MAC check. Looks like the error was introduced in #872.

I'm marking this issue for first-timers-only. That means that I will only accept a PR for this one from someone who's never contributed to open source before. This one is easy (but don't make that statement make you feel bad if you have a hard time with it, there's more to contributing to open source than changing lines of code, especially if it's your first time). I'll hold your hand through this if you need me to. :-) Here are the steps to get a PR merged here.

  • [ ] Read the CONTRIBUTING file for reference. I'll walk you through anything you don't understand.
  • [ ] Find the DetectVM.java class. At line 87, the code only checks for a non null string. This is a bug, because the code should also check for an empty string.
  • [ ] Alter the code to additionally check for an empty String.
  • [ ] Fork the project, commit your changes to your fork, create a PR, and get it merged
  • [ ] Celebrate

Hi @dbwiddis. I haven't contributed to open source before and would like to give it a go. Do you mind if I contribute?

Hey @dbwiddis! It has been done, this is my first time contributing to OS besides adding my name in the first-contribution github tutorial. It is PR #909. Thank you!

Hi, sorry @shannondavid it looks like @yzhang2907 beat you to the punch here! I can suggest a slightly more challenging issue for you to work on if you'd still like to help!

@dbwiddis I'd love to!

@shannondavid check out #877. This comment covers the basics of what to do, scroll down to the end for the better Windows solution using event log.

Fixed in #909

got it! checking out #877 now

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dbwiddis picture dbwiddis  路  12Comments

dustin-johnson picture dustin-johnson  路  3Comments

antonio-rodriges picture antonio-rodriges  路  12Comments

afnanRhy picture afnanRhy  路  13Comments

ghost picture ghost  路  6Comments