-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Fix author parsing of ACM #10142
Fix author parsing of ACM #10142
Conversation
Your code currently does not meet JabRef's code guidelines. The tool reviewdog already placed comments on GitHub to indicate the places. See the tab "Files" in you PR. Please carefully follow the setup guide for the codestyle. Afterwards, please run checkstyle locally and fix the issues. More information on code quality in JabRef is available at https://devdocs.jabref.org/getting-into-the-code/development-strategy.html. |
private List<Author> getAuthors(JsonArray authors) { | ||
List<Author> jabrefAuthors = new ArrayList<>(); | ||
|
||
for (JsonElement author : authors) { | ||
JsonObject authorJsonObject = author.getAsJsonObject(); | ||
|
||
String given = null; | ||
String family = null; | ||
if (authorJsonObject.has("given")) { | ||
given = authorJsonObject.get("given").getAsString(); | ||
} | ||
if (authorJsonObject.has("family")) { | ||
family = authorJsonObject.get("family").getAsString(); | ||
} | ||
Author jabrefAuthor = new Author(given, null, null, family, null); | ||
jabrefAuthors.add(jabrefAuthor); | ||
} | ||
return jabrefAuthors; | ||
} |
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.
Wouldn't it be more comprehensible, if the return type of this method would be already AuthorList instead of List, since in the only place you use this method, you create an Authorlist of this List of Authors...?
The build for this PR is no longer available. Please visit https://builds.jabref.org/main/ for the latest build. |
Fix cli debug log option
Fixes #10107
Follow up from #10137
Mandatory checks
CHANGELOG.md
described in a way that is understandable for the average user (if applicable)