Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into groupSorting
Browse files Browse the repository at this point in the history
* upstream/master:
  Localization: General: French: Translation of new entries
  Localization: Menu: French: Translation of an entry (#2685)
  Fix #2680 and fix #2667: Swing errors are catched properly and without freezing (#2681)
  Do not log AND throw
  Replace misleading error message for fetcher connection error
  Document CrossRef test
  Fix subtitle detection for CrossRef fetcher
  Revert "Invoke LogMessages.add in JavaFX thread"
  Use global user agent
  Update mockito from 2.7.17 to 2.7.18
  Move GuiAppender to GUI package
  Invoke LogMessages.add in JavaFX thread
  [WIP] Put the PDFAnnotationImporter under Test, enhance FileAnnotationTab (#2640)
  Fix for "Paying off technical debt: almost all utility classes have a private constructor now." (#2672)
  Revert "Paying off technical debt: almost all utility classes have a private constructor now. (#2649)" (#2670)
  Paying off technical debt: almost all utility classes have a private constructor now. (#2649)
  Changed codeformatting for better fxml annotation (#2668)
  Disalbe Google Scholar tests on all CI environments (#2654)
  Fix JSONException in Crossref fetcher as mentioned in #2442
  • Loading branch information
Siedlerchr committed Mar 25, 2017
2 parents 540444f + 9e63870 commit c41cfaa
Show file tree
Hide file tree
Showing 142 changed files with 852 additions and 232 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ dependencies {
compile 'com.github.tomtung:latex2unicode_2.12:0.2-SNAPSHOT'

testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:2.7.17'
testCompile 'org.mockito:mockito-core:2.7.18'
testCompile 'com.github.tomakehurst:wiremock:2.5.1'
testCompile 'org.assertj:assertj-swing-junit:3.5.0'
testCompile 'org.reflections:reflections:0.9.11'
Expand Down
4 changes: 2 additions & 2 deletions eclipse.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ tasks.eclipse.doFirst {
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
org.eclipse.jdt.core.formatter.indentation.size=4
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
Expand Down Expand Up @@ -454,7 +454,7 @@ tasks.eclipse.doFirst {
cleanup.make_variable_declarations_final=true
cleanup.never_use_blocks=false
cleanup.never_use_parentheses_in_expressions=false
cleanup.organize_imports=false
cleanup.organize_imports=true
cleanup.qualify_static_field_accesses_with_declaring_class=true
cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=false
cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=false
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/org/jabref/Globals.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ public class Globals {
private static GlobalFocusListener focusListener;
private static FileUpdateMonitor fileUpdateMonitor;

private Globals() {
}

// Key binding preferences
public static KeyBindingPreferences getKeyPrefs() {
if (keyPrefs == null) {
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/org/jabref/JabRefException.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@

public class JabRefException extends Exception {

private String localizedMessage;

private static final Log LOGGER = LogFactory.getLog(JabRefException.class);
private String localizedMessage;

public JabRefException(String message) {
super(message);
Expand All @@ -34,7 +33,7 @@ public JabRefException(Throwable cause) {
@Override
public String getLocalizedMessage() {
if (localizedMessage == null) {
LOGGER.warn("No localized message exception message defined. Falling back to getMessage().");
LOGGER.debug("No localized message exception message defined. Falling back to getMessage().");
return getMessage();
} else {
return localizedMessage;
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/org/jabref/cli/CrossrefFetcherEvaluator.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
*/
public class CrossrefFetcherEvaluator {

private CrossrefFetcherEvaluator() {
}

public static void main(String[] args) throws IOException, InterruptedException {
Globals.prefs = JabRefPreferences.getInstance();
try (FileReader reader = new FileReader(args[0])) {
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/org/jabref/cli/GenerateCharacterTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@

public class GenerateCharacterTable {

private GenerateCharacterTable() {
}

public static void main(String[] args) {
Map<Integer, String> characterMap = new TreeMap<>(HTMLUnicodeConversionMaps.NUMERICAL_LATEX_CONVERSION_MAP);
System.out.println("\\documentclass[10pt, a4paper]{article}");
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/org/jabref/cli/XMPUtilMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@

public class XMPUtilMain {

private XMPUtilMain() {
}

/**
* Command-line tool for working with XMP-data.
*
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/org/jabref/gui/EntryMarker.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ public class EntryMarker {

private static final Pattern MARK_NUMBER_PATTERN = Pattern.compile(JabRefPreferences.getInstance().MARKING_WITH_NUMBER_PATTERN);

private EntryMarker() {
}

/**
* @param increment whether the given increment should be added to the current one. Currently never used in JabRef. Could be used to increase marking color ("Mark in specific color").
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/org/jabref/gui/GUIGlobals.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ public class GUIGlobals {

public static final int MAX_BACK_HISTORY_SIZE = 10; // The maximum number of "Back" operations stored.

private GUIGlobals() {
}

public static JLabel getTableIcon(String fieldType) {
JLabel label = GUIGlobals.TABLE_ICONS.get(fieldType);
if (label == null) {
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/org/jabref/gui/actions/Actions.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,7 @@ public class Actions {
public static final String UNMARK_ENTRIES = "unmarkEntries";
public static final String WRITE_XMP = "writeXMP";
public static final String PRINT_PREVIEW = "printPreview";

private Actions() {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
*/
public class BackupUIManager {

private BackupUIManager() {
}

public static void showRestoreBackupDialog(JFrame frame, Path originalPath) {
int answer = JOptionPane.showConfirmDialog(frame,
new StringBuilder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@

public class CustomEntryTypesManager {

private CustomEntryTypesManager() {
}

/**
* Iterate through all entry types, and store those that are
* custom defined to preferences. This method is called from
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/org/jabref/gui/desktop/JabRefDesktop.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ public class JabRefDesktop {
private static final NativeDesktop NATIVE_DESKTOP = getNativeDesktop();
private static final Pattern REMOTE_LINK_PATTERN = Pattern.compile("[a-z]+://.*");

private JabRefDesktop() {
}

/**
* Open a http/pdf/ps viewer for the given link string.
*/
Expand Down
12 changes: 3 additions & 9 deletions src/main/java/org/jabref/gui/entryeditor/EntryEditor.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import java.util.Objects;
import java.util.Optional;
import java.util.Set;
import java.util.concurrent.ExecutionException;
import java.util.stream.Collectors;

import javax.swing.AbstractAction;
Expand Down Expand Up @@ -464,7 +463,7 @@ private void addPDFAnnotationTab() {
tabs.remove(fileAnnotationTab);
Optional<String> field = entry.getField(FieldName.FILE);
if (field.isPresent()) {
fileAnnotationTab = new FileAnnotationTab(this);
fileAnnotationTab = new FileAnnotationTab(this, panel.getAnnotationCache());
tabbed.addTab(Localization.lang("File annotations"), IconTheme.JabRefIcon.OPTIONAL.getSmallIcon(), fileAnnotationTab,

Localization.lang("Show file annotations"));
Expand Down Expand Up @@ -1158,12 +1157,7 @@ public void stateChanged(ChangeEvent event) {
//Initialize by getting notes from cache if they are cached

FileAnnotationTab tab = (FileAnnotationTab) activeTab;
try {
tab.initializeTab(tab,
panel.getAnnotationCache().getFromCache(entry));
} catch (ExecutionException e) {
tab.initializeTab((FileAnnotationTab) activeTab);
}
tab.initializeTab(tab);
}

if (activeTab instanceof EntryEditorTab) {
Expand Down Expand Up @@ -1480,7 +1474,7 @@ public void actionPerformed(ActionEvent e) {
}

BibtexKeyPatternUtil.makeAndSetLabel(panel.getBibDatabaseContext().getMetaData()
.getCiteKeyPattern(Globals.prefs.getBibtexKeyPatternPreferences().getKeyPattern()),
.getCiteKeyPattern(Globals.prefs.getBibtexKeyPatternPreferences().getKeyPattern()),
panel.getDatabase(), entry,
Globals.prefs.getBibtexKeyPatternPreferences());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ private void registerHyperlinkListener() {
this.addHyperlinkListener(e -> {
try {
if ((e.getURL() != null) && (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED)) {
new JabRefDesktop().openBrowser(e.getURL().toString());
JabRefDesktop.openBrowser(e.getURL().toString());
}
} catch (IOException e1) {
LOGGER.error(e1.getMessage(), e1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ public class FieldExtraComponents {

private static final Log LOGGER = LogFactory.getLog(FieldExtraComponents.class);

private FieldExtraComponents() {
}

private static final String ABBREVIATION_TOOLTIP_TEXT = "<HTML>"
+ Localization.lang("Switches between full and abbreviated journal name if the journal name is known.")
+ "<BR>" + Localization.lang("To set up, go to") + " <B>" + Localization.lang("Options") + " -> "
Expand Down
Loading

0 comments on commit c41cfaa

Please sign in to comment.