-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Observable Preferences L (GrobidPreferences) #9065
Conversation
} catch (IOException ignored) { | ||
// Ignored | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wouldn't ignore this, because if it fails then preferences may have been corrupted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just copied it from getStringList. Also Exception occurs only, if the stringreader is fails to read a line in the prefs. Worst case is that a preference option is not loaded correctly and has to be reconfigured manually.
int i = 0; | ||
List<String> series = new ArrayList<>(); | ||
String item; | ||
while (!StringUtil.isBlank(item = get(key + i))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
StringUtil#isNotBlank
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isNotBlank is basically a method to be used as a reference in .map(StringUtil::isNotBlank)
like Objects::isNull
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But still adding a literal 'not' reads better than '!'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Follow up on #8422 to keep the big refactor going.
Stopping here to keep it reviewable
.
CHANGELOG.md
described in a way that is understandable for the average user (if applicable)