-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Keep enclosing braces of authors #11034
Changes from all commits
45cfdba
71b2440
f5f2151
b0d490c
4b81e61
9187381
2750512
d7ad9da
aa48654
1690fe5
40c4ca7
dec0186
ed16b78
b588668
c54d006
856cf83
92a2024
9098099
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,14 +6,15 @@ | |
import java.util.HashSet; | ||
import java.util.List; | ||
import java.util.Locale; | ||
import java.util.Objects; | ||
import java.util.Optional; | ||
import java.util.Set; | ||
|
||
import org.jabref.model.entry.Author; | ||
import org.jabref.model.entry.AuthorList; | ||
import org.jabref.model.strings.StringUtil; | ||
|
||
import org.jspecify.annotations.NonNull; | ||
|
||
public class AuthorListParser { | ||
|
||
// Avoid partition where these values are contained | ||
|
@@ -94,9 +95,7 @@ private static StringBuilder buildWithAffix(Collection<Integer> indexArray, List | |
* @param listOfNames the String containing the person names to be parsed | ||
* @return a parsed list of persons | ||
*/ | ||
public AuthorList parse(String listOfNames) { | ||
Objects.requireNonNull(listOfNames); | ||
|
||
public AuthorList parse(@NonNull String listOfNames) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As I told you before I am not a fan of this NonNull stuff, It servers the same purpose as the Objects.requiresNonNull No benefit here There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I know. We always have that debate :) I'll collect pros and cons in an ADR. TL;DR for me. It enables static code analysis for nulls - not some runtime exception stuff. JabRef should not die because of NPEs. Links - it was approved twice and did not cause any issues yet |
||
// Handling of "and others" | ||
// Remove it from the list; it will be added at the very end of this method as special Author.OTHERS | ||
listOfNames = listOfNames.trim(); | ||
|
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.
This is somekind of silly, isn't it?
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.
Future work would be to introduce JSPecify more globally - but I did not want to escalate the PR here.