Repository navigation
Improved Sysfs robustness - #652
Closed
JakubVanek wants to merge 2 commits into
Closed
JakubVanek wants to merge 2 commits into
JakubVanek wants to merge 2 commits into
Conversation
Seems that file.isWritable() is unreliable depending on the OS/JDK version. The catch clause of the block would capture if the file is really not writable anyways.
This commit makes some refactorings in Sysfs: - #650 is integrated. Together with this, the writeString() now manually encodes the string to bytes and writes it using FileOutputStream. This should ensure the best performance. - readString() is a bit tweaked to use exceptions in a better way. - getElements() is checking for null value of a result. - write* method do not return a boolean anymore. This is because I think exceptions already convey that an error occured. The only usage of this boolean was to throw an exception. - Slf4j formatting functions are used, so it is not necessary to check if tracing is enabled. Slf4j already checks if the level is enabled before the format is processed.
Contributor
Author
|
Here is a proof that loglevel Slf4j checks are not necessary: |
Member
|
Hi Jakub, it is not a refactoring, you are changing the signature of the methods. This class affect the whole project, I am going to close this Merge request. If you have some ideas, open an issue, share the ideas and discuss, not open a PR. Juan Antonio |
3 tasks done
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.
This PR builds on top of #650 and adds some small refactorings to Sysfs:
To keep this clean, a separate PR will follow to resolve #651.