Use getResourceAsStream for JStyle reload#13080
Conversation
Signed-off-by: subhramit <subhramit.bb@live.in>
| URL resUrl = JStyle.class.getResource(path); | ||
| if (resUrl != null) { | ||
| try (InputStream stream = resUrl.openStream()) { | ||
| try (InputStream stream = JStyle.class.getResourceAsStream(path)) { |
There was a problem hiding this comment.
The try block covers multiple statements, which is against the guideline to cover as few statements as possible. This can make exception handling less precise.
There was a problem hiding this comment.
Maybe a small comment, why styleFile is not used here, but path.
The two variables should be put togehter at the declaration above in this file maybe? Maybe, there could be comments added to each variable.
There was a problem hiding this comment.
needs to support both internal and extenral style files
There was a problem hiding this comment.
The two variables should be put togehter at the declaration above in this file maybe?
Class level variables, used at different places.
Maybe, there could be comments added to each variable.
Done. field-level javadoc should appear on hover.
Signed-off-by: subhramit <subhramit.bb@live.in>
|
@trag-bot didn't find any issues in the code! ✅✨ |
Follow-up to #13075
Addresses #13075 (comment)
Refs. JabRef#693, #13073
Mandatory checks
CHANGELOG.mddescribed in a way that is understandable for the average user (if change is visible to the user)