diff --git a/build.gradle b/build.gradle index d8a23f7ccf2..ea5d8e813b2 100644 --- a/build.gradle +++ b/build.gradle @@ -95,9 +95,9 @@ dependencies { compile 'com.jgoodies:jgoodies-common:1.8.1' compile 'com.jgoodies:jgoodies-forms:1.9.0' - compile 'org.apache.pdfbox:pdfbox:2.0.13' - compile 'org.apache.pdfbox:fontbox:2.0.13' - compile 'org.apache.pdfbox:xmpbox:2.0.13' + compile 'org.apache.pdfbox:pdfbox:2.0.14' + compile 'org.apache.pdfbox:fontbox:2.0.14' + compile 'org.apache.pdfbox:xmpbox:2.0.14' compile group: 'org.apache.tika', name: 'tika-core', version: '1.20' @@ -134,7 +134,7 @@ dependencies { compile 'de.saxsys:mvvmfx:1.7.0' compile 'org.fxmisc.easybind:easybind:1.0.3' compile 'org.fxmisc.flowless:flowless:0.6.1' - compile 'org.fxmisc.richtext:richtextfx:0.9.2' + compile 'org.fxmisc.richtext:richtextfx:0.9.3' compile 'com.sibvisions.external.jvxfx:dndtabpane:0.1' compile 'javax.inject:javax.inject:1' compile 'com.jfoenix:jfoenix:8.0.8' diff --git a/src/main/java/org/jabref/logic/bibtex/LatexFieldFormatter.java b/src/main/java/org/jabref/logic/bibtex/LatexFieldFormatter.java index 64346eb96cb..b69a6480a71 100644 --- a/src/main/java/org/jabref/logic/bibtex/LatexFieldFormatter.java +++ b/src/main/java/org/jabref/logic/bibtex/LatexFieldFormatter.java @@ -23,7 +23,6 @@ public class LatexFieldFormatter { private final FieldContentParser parser; private StringBuilder stringBuilder; - public LatexFieldFormatter(LatexFieldFormatterPreferences prefs) { this(true, prefs); } @@ -48,26 +47,26 @@ private static void checkBraces(String text) throws InvalidFieldValueException { char item = text.charAt(i); boolean charBeforeIsEscape = false; - if (i > 0 && text.charAt(i - 1) == '\\') { + if ((i > 0) && (text.charAt(i - 1) == '\\')) { charBeforeIsEscape = true; } - if (!charBeforeIsEscape && item == '{') { + if (!charBeforeIsEscape && (item == '{')) { left++; - } else if (!charBeforeIsEscape && item == '}') { + } else if (!charBeforeIsEscape && (item == '}')) { right++; } } // Then we throw an exception if the error criteria are met. if (!(right == 0) && (left == 0)) { - throw new InvalidFieldValueException("Unescaped '}' character without opening bracket ends string prematurely."); + throw new InvalidFieldValueException("Unescaped '}' character without opening bracket ends string prematurely. Field value: " + text); } if (!(right == 0) && (right < left)) { - throw new InvalidFieldValueException("Unescaped '}' character without opening bracket ends string prematurely."); + throw new InvalidFieldValueException("Unescaped '}' character without opening bracket ends string prematurely. Field value: " + text); } if (left != right) { - throw new InvalidFieldValueException("Braces don't match."); + throw new InvalidFieldValueException("Braces don't match. Field value: " + text); } } @@ -146,9 +145,9 @@ private String formatAndResolveStrings(String content, String fieldName) throws pos1 = content.length(); // just write out the rest of the text, and throw no exception } else { throw new InvalidFieldValueException( - "The # character is not allowed in BibTeX strings unless escaped as in '\\#'.\n" - + "In JabRef, use pairs of # characters to indicate a string.\n" - + "Note that the entry causing the problem has been selected."); + "The # character is not allowed in BibTeX strings unless escaped as in '\\#'.\n" + + "In JabRef, use pairs of # characters to indicate a string.\n" + + "Note that the entry causing the problem has been selected. Field value: " + content); } } } @@ -161,7 +160,7 @@ private String formatAndResolveStrings(String content, String fieldName) throws // an occurrence of ## will simply be ignored. Should it instead // cause an error message? writeStringLabel(content, pos1 + 1, pos2, pos1 == pivot, - (pos2 + 1) == content.length()); + (pos2 + 1) == content.length()); } if (pos2 > -1) { @@ -187,7 +186,7 @@ private boolean shouldResolveStrings(String fieldName) { } else { // Default operation - we only resolve strings for standard fields: resolveStrings = InternalBibtexFields.isStandardField(fieldName) - || BIBTEX_STRING.equals(fieldName); + || BIBTEX_STRING.equals(fieldName); } return resolveStrings; } @@ -195,8 +194,7 @@ private boolean shouldResolveStrings(String fieldName) { private String formatWithoutResolvingStrings(String content, String fieldName) throws InvalidFieldValueException { checkBraces(content); - stringBuilder = new StringBuilder( - String.valueOf(FIELD_START)); + stringBuilder = new StringBuilder(String.valueOf(FIELD_START)); stringBuilder.append(parser.format(content, fieldName)); @@ -258,7 +256,7 @@ private void writeText(String text, int startPos, int endPos) { // We add a backslash before any ampersand characters, with one exception: if // we are inside an \\url{...} command, we should write it as it is. Maybe. if ((c == '&') && !escape && !(inCommand && "url".equals(commandName.toString())) - && (nestedEnvironments == 0)) { + && (nestedEnvironments == 0)) { stringBuilder.append("\\&"); } else { stringBuilder.append(c); @@ -271,7 +269,7 @@ private void writeText(String text, int startPos, int endPos) { private void writeStringLabel(String text, int startPos, int endPos, boolean first, boolean last) { putIn((first ? "" : " # ") + text.substring(startPos, endPos) - + (last ? "" : " # ")); + + (last ? "" : " # ")); } private void putIn(String s) { diff --git a/src/main/java/org/jabref/preferences/JabRefPreferences.java b/src/main/java/org/jabref/preferences/JabRefPreferences.java index a8bbd319222..c3070474954 100644 --- a/src/main/java/org/jabref/preferences/JabRefPreferences.java +++ b/src/main/java/org/jabref/preferences/JabRefPreferences.java @@ -650,7 +650,7 @@ private JabRefPreferences() { defaults.put(SPECIALFIELDSENABLED, Boolean.TRUE); defaults.put(SHOWCOLUMN_PRIORITY, Boolean.FALSE); defaults.put(SHOWCOLUMN_QUALITY, Boolean.FALSE); - defaults.put(SHOWCOLUMN_RANKING, Boolean.TRUE); + defaults.put(SHOWCOLUMN_RANKING, Boolean.FALSE); defaults.put(SHOWCOLUMN_RELEVANCE, Boolean.FALSE); defaults.put(SHOWCOLUMN_PRINTED, Boolean.FALSE); defaults.put(SHOWCOLUMN_READ, Boolean.FALSE);