-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Fix Nullwarnings - A #14116
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
base: main
Are you sure you want to change the base?
Fix Nullwarnings - A #14116
Conversation
|
|
||
| applyFilter(request.filter()).forEach(id -> { | ||
| EmbeddingRecord eRecord = embeddingsMap.get(id); | ||
| EmbeddingRecord eRecord = embeddingsMap.getOrDefault(id, new EmbeddingRecord(null, "", new float[0])); |
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.
We could think about a NULL_OBJECT constant
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.
NULL_OBJECT would also help here to avoid memory increase on all executions of this line. Reason: The fall-back object is created on all calls, even propbably never (!) used. --> we never had NPEs here, had we?
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.
Is this needed somewhere else?
koppor
left a comment
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 think, we should discuss the comments here, get this in and do other null fixes later. The fixes should get in ASAP - and not pile up.
|
|
||
| applyFilter(request.filter()).forEach(id -> { | ||
| EmbeddingRecord eRecord = embeddingsMap.get(id); | ||
| EmbeddingRecord eRecord = embeddingsMap.getOrDefault(id, new EmbeddingRecord(null, "", new float[0])); |
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.
NULL_OBJECT would also help here to avoid memory increase on all executions of this line. Reason: The fall-back object is created on all calls, even propbably never (!) used. --> we never had NPEs here, had we?
| DAY("day"), | ||
| DAYFILED("dayfiled"), | ||
| DOI("doi", "DOI", FieldProperty.VERBATIM, FieldProperty.IDENTIFIER), | ||
| DOI("doi", FieldProperty.VERBATIM, FieldProperty.IDENTIFIER), |
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.
OMG, maybe you found a core issue in JabRef's code here?
With #13867 it seems a large architectural change has been introduced. org.jabref.model.entry.field.FieldTextMapper is now used instead of .getDisplayName(). We should decide whether we want to have the DisplayName close to the field or at some other class. - I first thought that org.jabref.model.entry.field.FieldTextMapper was UI, but it is logic (because of usage by OO code).
I am a bit undecided where to put. I found the "old" way to have it annoted at the field itself better. One could argue to have the field information more lightweight and display is another concern. --> We should link org.jabref.model.entry.field.FieldTextMapper in StandardField
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.
We had the discussion if I recall correctly. We opted then for a clean separation of ui layer and internal representation.
|
Im okay with merging asap. We can make a series of null fix prs. Maybe also nice good first issues? Needs some thinking though. |
|
Will introduce null obj constant later today. After that rfr. |
| protected MVStore mvStore; | ||
|
|
||
| public MVStoreBase(@Nullable Path path, NotificationService dialogService) { | ||
| public MVStoreBase(@NonNull Path path, NotificationService dialogService) { |
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.
Hmm, but didn't it was nullable on purpose?
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.




Self describing.
Removed also artifact from #13867
Feel free to pick some classes and push some commits with null fixes to this PR.
Steps to test
Run gradle :jablib:build, see if null warnings have bin fixed.
Mandatory checks
CHANGELOG.mdin a way that is understandable for the average user (if change is visible to the user)