-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Fix IEEE preview does not display month #3983
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
Merged
tobiasdiez
merged 9 commits into
JabRef:maintable-beta
from
DevSiroukane:fixMonthPreview
May 2, 2018
Merged
Changes from 6 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
6738711
Fix IEEE preview does not display month (#3239)
DrSiroukane 4d7525e
Fix IEEE preview does not display month (#3239)
DevSiroukane 99c6dd5
Fix IEEE preview does not display month (#3239)
DevSiroukane cb5a8a3
Fix IEEE preview does not display month (#3239)
DevSiroukane 0255d0f
Fix IEEE preview does not display month (#3239)
DevSiroukane 2f022b2
Fix IEEE preview does not display month (#3239)
DevSiroukane 82b05d1
Fix IEEE preview does not display month (#3239)
DevSiroukane f548163
Fix IEEE preview does not display month (#3239)
DevSiroukane eb2ad39
Fix IEEE preview does not display month (#3239)
DevSiroukane File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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.
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.
The code changes above work but are more complicated than they need to. I think an easier solution is to extract the lambda expression in this line (
ifPresent(value -> ...)
) to a new methodsetFieldValue(bibTeXEntry, key, value)
. In this new method, you can then simply checkif (FieldName.MONTH.equals(key)) {
and useMonth.parse
to get the correct month value.Uh oh!
There was an error while loading. Please reload this page.
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 did not notice that bibEntry and BibTeXEntry are different object. I think we do not need to clone bibEntry anymore.
Instead of create a new method setFieldValue(...) I thought of making if block direct on lamda expression. What do you think?
I execute this code and it work.
About https://github.com/JabRef/jabref/blob/master/src/test/java/org/jabref/logic/citationstyle/CitationStyleTest.java I have no idea what I can do if you help me please. I am not used with test on java yet.
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.
That is also an idea, but I would not make the regex. If you have the field month, I would really get the shortname from the BibEntry then, so value = key.getMonth().getShortName
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.
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.
Very good, we are almost there. Please replace the value assignment line by
Background: the
get
method for anOptional
throws an null pointer exception if the optional is empty. Thus, one has to checkisPresent
before usingget
or, alternatively, useorElse
instead.Please push the change to your branch and then we can merge!
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 just post my last request