diff --git a/src/main/java/net/sf/jabref/bibtex/BibEntryWriter.java b/src/main/java/net/sf/jabref/bibtex/BibEntryWriter.java index 9b38d109a29..c426ba3258a 100644 --- a/src/main/java/net/sf/jabref/bibtex/BibEntryWriter.java +++ b/src/main/java/net/sf/jabref/bibtex/BibEntryWriter.java @@ -142,7 +142,7 @@ private boolean writeField(BibEntry entry, Writer out, String name, boolean prep out.write(',' + Globals.NEWLINE); } - out.write(" " + getFieldDisplayName(name) + " = "); + out.write(" " + getFieldDisplayName(name)); try { out.write(fieldFormatter.format(field, name)); @@ -184,7 +184,7 @@ private String getFieldDisplayName(String field) { String suffix = suffixSB.toString(); String result; - result = field.toLowerCase() + suffix; + result = field.toLowerCase() + " = " + suffix; return result; } diff --git a/src/test/java/net/sf/jabref/bibtex/BibEntryWriterTest.java b/src/test/java/net/sf/jabref/bibtex/BibEntryWriterTest.java index 9091153a427..f06075dfcc5 100644 --- a/src/test/java/net/sf/jabref/bibtex/BibEntryWriterTest.java +++ b/src/test/java/net/sf/jabref/bibtex/BibEntryWriterTest.java @@ -60,10 +60,10 @@ public void testSerialization() throws IOException { // @formatter:off String expected = Globals.NEWLINE + Globals.NEWLINE + "@Article{," + Globals.NEWLINE + - " author = {Foo Bar}," + Globals.NEWLINE + - " journal = {International Journal of Something}," + Globals.NEWLINE + - " number = {1}," + Globals.NEWLINE + - " note = {some note}" + Globals.NEWLINE + + " author = {Foo Bar}," + Globals.NEWLINE + + " journal = {International Journal of Something}," + Globals.NEWLINE + + " number = {1}," + Globals.NEWLINE + + " note = {some note}" + Globals.NEWLINE + "}"; // @formatter:on @@ -169,10 +169,10 @@ public void roundTripWithModification() throws IOException { // @formatter:off String expected = Globals.NEWLINE + Globals.NEWLINE + "@Article{test," + Globals.NEWLINE + - " author = {BlaBla}," + Globals.NEWLINE + - " journal = {International Journal of Something}," + Globals.NEWLINE + - " number = {1}," + Globals.NEWLINE + - " note = {some note}" + Globals.NEWLINE + + " author = {BlaBla}," + Globals.NEWLINE + + " journal = {International Journal of Something}," + Globals.NEWLINE + + " number = {1}," + Globals.NEWLINE + + " note = {some note}" + Globals.NEWLINE + "}"; // @formatter:on assertEquals(expected, actual); @@ -215,11 +215,11 @@ public void roundTripWithCamelCasingInTheOriginalEntryAndResultInLowerCase() thr // @formatter:off String expected = Globals.NEWLINE + Globals.NEWLINE + "@Article{test," + Globals.NEWLINE + - " author = {BlaBla}," + Globals.NEWLINE + - " journal = {International Journal of Something}," + Globals.NEWLINE + - " number = {1}," + Globals.NEWLINE + - " note = {some note}," + Globals.NEWLINE + - " howpublished = {asdf}" + Globals.NEWLINE + + " author = {BlaBla}," + Globals.NEWLINE + + " journal = {International Journal of Something}," + Globals.NEWLINE + + " number = {1}," + Globals.NEWLINE + + " note = {some note}," + Globals.NEWLINE + + " howpublished = {asdf}" + Globals.NEWLINE + "}"; // @formatter:on assertEquals(expected, actual);