From 2f022b2d9c0d73aee79a6eaf3f332a9640a27b95 Mon Sep 17 00:00:00 2001 From: Siroukane Date: Sat, 28 Apr 2018 13:24:30 +0200 Subject: [PATCH] Fix IEEE preview does not display month (#3239) Remove Superfluous Comments https://github.com/JabRef/jabref/pull/3983#discussion_r184842438 --- .../java/org/jabref/logic/citationstyle/CSLAdapter.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/jabref/logic/citationstyle/CSLAdapter.java b/src/main/java/org/jabref/logic/citationstyle/CSLAdapter.java index ede73d2a55d..4fba69f2e10 100644 --- a/src/main/java/org/jabref/logic/citationstyle/CSLAdapter.java +++ b/src/main/java/org/jabref/logic/citationstyle/CSLAdapter.java @@ -83,10 +83,13 @@ private static class JabRefItemDataProvider implements ItemDataProvider { /** * Converts the {@link BibEntry} into {@link CSLItemData}. + * + * Clone bibEntry to make a save changes, + * Change month field from JabRefFormat #mon# to ShortName mon + * because CSL does not support JabRefFormat. */ private static CSLItemData bibEntryToCSLItemData(BibEntry bibEntry) { - // create a copy of bibEntry bibEntry = (BibEntry) bibEntry.clone(); String citeKey = bibEntry.getCiteKeyOptional().orElse(""); @@ -97,7 +100,6 @@ private static CSLItemData bibEntryToCSLItemData(BibEntry bibEntry) { RemoveNewlinesFormatter removeNewlinesFormatter = new RemoveNewlinesFormatter(); for (String key : bibEntry.getFieldMap().keySet()) { if (FieldName.MONTH.equals(key)) { - // change month field value from "#mon#" to "mon" bibEntry.getFieldMap().put(FieldName.MONTH, bibEntry.getMonth().get().getShortName()); }