Skip to content

Commit

Permalink
Align '=' with the field key instead of the value
Browse files Browse the repository at this point in the history
  • Loading branch information
lenhard committed Dec 22, 2015
1 parent e22b060 commit 1f7f92d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions src/main/java/net/sf/jabref/bibtex/BibEntryWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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;
}
Expand Down
26 changes: 13 additions & 13 deletions src/test/java/net/sf/jabref/bibtex/BibEntryWriterTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 1f7f92d

Please sign in to comment.