Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specialize getHostName() #1008

Merged
merged 5 commits into from
Oct 9, 2019
Merged

Conversation

2kindsofcs
Copy link
Contributor

@2kindsofcs 2kindsofcs commented Oct 6, 2019

Fixes #1006
on windows, getHostName() uses Kernel32Util.getComputerName().
and on Mac, Linux, Solaris, and BSD it returns the value from JNA's LibC class method getHostName().

I have a question. contributing guide says "Update CHANGELOG Again" and I'm somewhat confused. Do I have to update changelog at the moment I made a pull request or when my pull request got merged?

@coveralls
Copy link

coveralls commented Oct 6, 2019

Coverage Status

Coverage remained the same at 81.02% when pulling 9197746 on 2kindsofcs:specialize-getHostName into b7ff327 on oshi:master.

@codecov-io
Copy link

codecov-io commented Oct 6, 2019

Codecov Report

Merging #1008 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #1008   +/-   ##
=========================================
  Coverage     77.17%   77.17%           
  Complexity        2        2           
=========================================
  Files            23       23           
  Lines          1196     1196           
  Branches        154      154           
=========================================
  Hits            923      923           
  Misses          206      206           
  Partials         67       67

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b7ff327...9197746. Read the comment docs.

@2kindsofcs 2kindsofcs changed the title Specialize getHostName() #1006 Specialize getHostName() Oct 6, 2019
@dbwiddis
Copy link
Member

dbwiddis commented Oct 6, 2019

I have a question. contributing guide says "Update CHANGELOG Again" and I'm somewhat confused. Do I have to update changelog at the moment I made a pull request or when my pull request got merged?

The idea here is that the first time you complete the change log you don't know the number of your pull request (you can try to guess by looking at the next sequential issue/pull request number) so you would do another commit to insert the number. When that document was originally written, the request was to use an "amend" commit to minimize the number of actual commits to the project. Since then, Github has added a "Squash and merge" option that combines all commits for a PR into one so there's no need to do an "amend" commit (but you're welcome to do so).

Copy link
Member

@dbwiddis dbwiddis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job, a few minor requests!

@2kindsofcs 2kindsofcs force-pushed the specialize-getHostName branch from 4793455 to 5965051 Compare October 8, 2019 12:58
@dbwiddis
Copy link
Member

dbwiddis commented Oct 8, 2019

This looks good! Ready to merge... I might make a few tweaks on the inheritance first, as I realized (belatedly) that we should just make the CLibrary class inherit from the JNA LibCAPI. Then there are some functions that we can remove from the CLibrary. Happy to do that unless you want to make yet another change. :)

Did you want to make a changelog entry or are you good to go with this as is?

@dbwiddis
Copy link
Member

dbwiddis commented Oct 9, 2019

Looks good! I'll let the CI tests run and tweak the C library inheritance again and merge within the hour. Thanks for contributing to open source!

@2kindsofcs
Copy link
Contributor Author

2kindsofcs commented Oct 9, 2019

I checked my code once again and found that 2 files don't have "NOSONAR" footnote while there is import com.sun.jna.Native. so I added a footnote for each file.
and I updated the changelog! I appreciate your kindness and effort to help someone who wants to contribute to an opensource project but inexperienced. For those a couple of days, I was enjoying adding some code to a huge project source code that I didn't write and it was truly pleasing and thrilling.

@dbwiddis dbwiddis force-pushed the specialize-getHostName branch from b4238f1 to 9197746 Compare October 9, 2019 06:13
@dbwiddis dbwiddis merged commit 9fd6af9 into oshi:master Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

On windows, in some cases, NetworkParams.getHostName() return localhost
4 participants