-
-
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
Fix NPE in Medline fetcher on missing ISSN #2113
Conversation
As a quick fix this seems to be ok. Two remarks:
Also adding a test would be nice :) |
@tobiasdiez I will check it if Journal issue is also possible null from the annotation in the Journal class But I wanted to add a test, too |
In theory, all fields can be null. JAXB will take whatever is there and will set null for everything that it cannot find. Ultimately, null values depend on how consistent the data from medline are, and I guess we should be rather conservative in our assumptions... There is already a fair amount of null checking code in the importer and it is quite hard to see what could be missing. @Siedlerchr We will rely on your knowledge and intuition here, but of course it is easy to miss something and then we will have to fix the error when someone opens an issue. Apart from that I second @tobiasdiez: Please add a test and this is ready to go! |
Apparently there is a way to let JAXB convert nulls to empty optionals http://stackoverflow.com/a/23113540/873661. Not sure how complicated this is versus just checking for null. |
@tobiasdiez If I understand it correctly, this solution is not feasible for us. It requires changing the annotations in the Java class and in our case this Java class is generated from an XSD. Apart from that I am always happy when we can avoid that darn Optional and do a good ol' null check ;-D |
* upstream/master: Ctrl-s parsing error message (#2114)
Apart from codecov having problems with parameterizest test, all works |
* upstream/master: (102 commits) Removed unused test code (#2140) Fix main table bug when creating a duplicate (#2135) Remove explicit author and add SPDX-License-Identifier Remove GPL from README.md and CONTRIBUTING.md fix preview update (#2125) Remove some UnicodeToLatex uses (#2132) Fix mixup in french/farsi localization FetcherException should extend JabRefException Fix exception when opening preference dialog (#2127) Unify ParserException and ParseException (#2124) Small refactoring in Importer package (#2053) Implement Datepicker "none"-button (#2122) revert change from 816d30c Change title/tooltip of source panel in biblatex mode (#2120) Refactoring: completey typed metadata and add detailed travis output (#2112) RTFchars fix (#2097) Fix NPE in Medline fetcher on missing ISSN (#2113) Ctrl-s parsing error message (#2114) Fix bad web search error messages (#2034) parse error freeze (#2106) ... # Conflicts: # src/main/java/net/sf/jabref/collab/FileUpdateMonitor.java # src/main/java/net/sf/jabref/gui/externalfiles/DownloadExternalFile.java # src/main/java/net/sf/jabref/gui/externalfiles/DroppedFileHandler.java # src/main/java/net/sf/jabref/gui/externalfiles/MoveFileAction.java # src/main/java/net/sf/jabref/logic/cleanup/RenamePdfCleanup.java # src/main/java/net/sf/jabref/logic/exporter/FileSaveSession.java # src/main/java/net/sf/jabref/logic/util/io/FileUtil.java # src/main/java/net/sf/jabref/preferences/JabRefPreferences.java
* Fix NPE in issn, Fix for JabRef#2110 * Add new test for journal with no ISSN
Fix for #2110
When issn was null, calling a method on it resulted in NPE.