Fix import of MS Office xml in case of invalid month#2538
Merged
Conversation
tobiasdiez
requested changes
Feb 12, 2017
| Month month = MonthUtil.getMonth(entry.month); | ||
| fieldValues.put(FieldName.MONTH, month.shortName); | ||
| //if we encouter an UnknownMonth/NULL_OBJECT month, the shortname returns null | ||
| if (month.shortName == null) { |
Member
There was a problem hiding this comment.
I think it is cleaner if you modify the getMonth method to return Optional<Month>̀ instead of NULL objects.
Member
Author
There was a problem hiding this comment.
Yeah. Thought about remodeling the stuff. The NULL_OBJECT stuff and UnknownMonth is really shitty,
Contributor
There was a problem hiding this comment.
You can use the isValid method of a Month to determine whether it is a valid month.
Member
Author
There was a problem hiding this comment.
Done and added also test
Member
|
Can you please add a test for this if possible? |
* upstream/master: (182 commits) Reorder pferences tab to be more intuitive (#2560) Reoder translations to be more meaningful move jmh benchmark fix prefs import test Add prefs migration add missing files replace text occurrences fix logging fix imports fix intellij code style fix jaxb based importers fix search generation move and fix tests fix compilation errors update checkstyle for correct positioning of org.jabref packages fix wrong positioning of some gui classes fix generation of sources second part of gui first part of gui second part of logic move ... # Conflicts: # CHANGELOG.md
Add test for importer
Member
Author
|
Check for valid month and added test |
Siedlerchr
added a commit
that referenced
this pull request
Feb 18, 2017
* upstream/master: Fix colour of tooltip Groups: click on arrow should toggle expansion status Fix import of MS Office xml in case of invalid month (#2538) Change MainClass from net.sf to org.jabref.JabRefMain
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix for: http://discourse.jabref.org/t/msbib-import-not-working/463
Fix month field.shortname returning null in case of invalid Month
- [ ] Screenshots added (for bigger UI changes)- [ ] Check documentation status (Issue created for outdated help page at [help.jabref.org](https://github.com/JabRef/help.jabref.org/issues)?)- [ ] If you changed the localization: Did you rungradle localizationUpdate?