Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Siedlerchr/jabref into co…
Browse files Browse the repository at this point in the history
…ntentSelector

* 'master' of https://github.com/Siedlerchr/jabref:
  Rework DBLPFetcher to new structure (#2314)
  Consider dev tag in version comparison (#2312)
  Update diffutils from 1.3.0 to 2.1.1
  Replace usages of Throwable with Exception (#2310)
  Add missing srcDir statement
  improve documentation of save order limitation - see #2305
  Adapt CSL tests to CRLF and LF (#2306)
  Use SPDX license identifiers
  Add key format of #2275 as requirement to CONTRIBUTING.md
  Add fallback exception handler (#2287)
  Update citeproc dependency to 1.0.1 (#2303)
  Remove duplicate code getResolvedFieldOrAlias (#2296)
  Update testCompile dependencies (mockito-core, wiremock)
  Change execution order (#2302)
  Use https for files.jabref.org
  Use compileJava instead of getdeps to decrease build time even more
  Update install4j from 6.1.1 to 6.1.3
  Fix local metadata synchronization
  • Loading branch information
Siedlerchr committed Nov 28, 2016
2 parents 624dfa3 + ff550e4 commit 12dc92d
Show file tree
Hide file tree
Showing 36 changed files with 298 additions and 397 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,13 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
- URLs can now be passed as arguments to the `-import` and `-importToOpen` command line options. The referenced file is downloaded and then imported as usual.

### Fixed
- We fixed an issue which caused a metadata loss on reconnection to shared database. [#2219](https://github.com/JabRef/jabref/issues/2219)
- We fixed an issue which caused an internal error when leaving the file path field empty and connecting to a shared database.
- We fixed an issue where the file permissions of the .bib-file were changed upon saving [#2279](https://github.com/JabRef/jabref/issues/2279).
- We fixed an issue which prevented that a database was saved successfully if JabRef failed to generate new BibTeX-keys [#2285](https://github.com/JabRef/jabref/issues/2285).
- We fixed an issue when JabRef restores its session and a shared database was used: The error message "No suitable driver found" will not appear.
- Update check now correctly notifies about new release if development version is used. [#2298](https://github.com/JabRef/jabref/issues/2298)
- Fixed [#2311](https://github.com/JabRef/jabref/issues/2311): The DBLP fetcher has been rewritten and is working again.

### Removed

Expand Down
11 changes: 11 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,17 @@ Add a line with your changes in the appropriate section.
If you did internal refactorings or improvements not visible to the user (e.g., UI, .bib file), then you don't need to put an entry there.


#### Key format
Example: `<kbd>Ctrl</kbd> + <kbd>Enter</kbd>`

In case you add keys to the changelog, please follow these rules:

- `<kbd>` tag for each key
- First letter of key capitalized
- Combined keys separated by `+`
- Spaces before and after separator `+`


### Author credits
You will be given credit in the `AUTHORS` file in the root of the repository and the 'About' pages inside the main application.
We will periodically update the contributors list inside `AUTHORS`.
Expand Down
20 changes: 5 additions & 15 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ dependencies {
compile 'org.openoffice:ridl:4.1.2'
compile 'org.openoffice:unoil:4.1.2'

compile 'com.googlecode.java-diff-utils:diffutils:1.3.0'
compile 'com.github.bkromhout:java-diff-utils:2.1.1'

antlr3 'org.antlr:antlr:3.5.2'
compile 'org.antlr:antlr-runtime:3.5.2'
Expand Down Expand Up @@ -122,11 +122,11 @@ dependencies {
// need to use snapshots as the stable version is from 2013 and doesn't support v1.0.1 CitationStyles
compile 'org.citationstyles:styles:1.0.1-SNAPSHOT'
compile 'org.citationstyles:locales:1.0.1-SNAPSHOT'
compile 'de.undercouch:citeproc-java:1.0.0-SNAPSHOT'
compile 'de.undercouch:citeproc-java:1.0.1'

testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:2.2.9'
testCompile 'com.github.tomakehurst:wiremock:2.2.2'
testCompile 'org.mockito:mockito-core:2.2.15'
testCompile 'com.github.tomakehurst:wiremock:2.3.1'
testCompile 'org.assertj:assertj-swing-junit:3.4.0'
}

Expand All @@ -141,6 +141,7 @@ sourceSets {
java {
compileClasspath += main.output + test.output
runtimeClasspath += main.output + test.output
srcDir file('src/databaseTest/java')
}
}
integrationTest {
Expand Down Expand Up @@ -382,17 +383,6 @@ task releaseJar(dependsOn: "shadowJar") {
}
}

// fetch all dependencies to speedup CircleCI build
// this is necessary until https://discuss.circleci.com/t/effective-caching-for-gradle/540 is resolved
// see http://stackoverflow.com/a/27455099/873282 for an inspiration of this task
// better solution: https://discuss.gradle.org/t/how-to-download-maven-dependencies-into-project-local-directory-and-set-eclipse-classpath/9851
task getdeps(type: Copy) {
from(configurations.compile + configurations.antlr3 + configurations.antlr4 + configurations.testCompile) {
include "*.jar"
}
into 'build/tmp/alldeps/'
}

jmh {
warmupIterations = 5
iterations = 10
Expand Down
2 changes: 1 addition & 1 deletion circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dependencies:
- install4j6/bin/install4jc --verbose --license=$INSTALL4J_KEY
override:
# We do this to decrease build time by using CircleCI's cache. See https://discuss.circleci.com/t/effective-caching-for-gradle/540 for a longer motivation.
- ./gradlew getdeps
- ./gradlew compileJava
cache_directories:
- "~/.install4j6"
- "~/downloads"
Expand Down
44 changes: 21 additions & 23 deletions external-libraries.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ This file is manually kept in sync with build.gradle and the binary jars contain

## License

* GPLv2+ means "GPLv2 or later"
* GPLv2! means "exactly version 2.0 of GPL"
* GPLv2 means, we haven't checked whether later options are allowed
* similar for LGPL and other version of GPL

We follow the [SPDX license identifiers](https://spdx.org/licenses/).
In case you add a library, please use these identifiers.
For instance, "BSD" is not exactg enough, there are numerous variants out there: BSD-2-Clouse, BSD-3-Clause-No-Nuclear-Warranty, ...

# Fonts and Icons

Expand Down Expand Up @@ -40,17 +38,17 @@ License: BSD
Id: commons-cli:commons-cli
Project: Apache Commons CLI
URL: http://commons.apache.org/cli/
License: Apache 2.0
License: Apache-2.0

Id: commons-logging:commons-logging
Project: Apache Commons Logging
URL: http://commons.apache.org/logging/
License: Apache 2.0
License: Apache-2.0

Id: com.googlecode.java-diff-utils
Id: com.github.bkromhout:java-diff-utils
Project: java-diff-utils
URL: http://code.google.com/p/java-diff-utils/
License: Apache 2.0
URL: https://github.com/bkromhout/java-diff-utils
License: Apache-2.0

Id: com.impossibl.pgjdbc-ng:pgjdbc-ng
Project: pgjdbc-ng
Expand Down Expand Up @@ -85,32 +83,32 @@ License: MIT
Id: mysql:mysql-connector-java
Project: MySQL Connector/J
URL: http://www.mysql.de/downloads/connector/j/
License: GPLv2! and Oracle's FOSS License Exception (http://www.mysql.com/about/legal/licensing/foss-exception/) allowing GPLv3
License: GPL-2.0 and Oracle's FOSS License Exception (http://www.mysql.com/about/legal/licensing/foss-exception/) allowing GPLv3

Id: net.java.dev.glazedlists:glazedlists_java15
Project: Glazed Lists
URL: http://www.glazedlists.com/
License: LPGL 2.1! (not explicitly, but no comments in the source header) and MPL
License: LGPL-2.1 (not explicitly, but no comments in the source header) and MPL-2.0

Id: org.apache.logging.log4j
Project: Apache Log2j 2
URL: http://logging.apache.org/log4j/2.x/
License: Apache 2.0
License: Apache-2.0

Id: org.apache.pdfbox:fontbox
Project: Apache PDFBox
URL: http://pdfbox.apache.org
License: Apache 2.0
License: Apache-2.0

Id: org.apache.pdfbox:jempbox
Project: Apache PDFBox
URL: http://pdfbox.apache.org
License: Apache 2.0
License: Apache-2.0

Id: org.apache.pdfbox:pdfbox
Project: Apache PDFBox
URL: http://pdfbox.apache.org
License: Apache 2.0
License: Apache-2.0

Id: org.bouncycastle:bcprov-jdk15on
Project: The Legion of the Bouncy Castle
Expand All @@ -130,22 +128,22 @@ License: LGPL 3.0
Id: org.openoffice:jurt
Project: OpenOffice.org
URL: http://www.openoffice.org/api/SDK
License: LGPL 3.0
License: Apache-2.0

Id: org.openoffice:ridl
Project: OpenOffice.org
URL: http://www.openoffice.org/api/SDK
License: LGPL 3.0
License: Apache-2.0

Id: org.openoffice:unoil
Project: OpenOffice.org
URL: http://www.openoffice.org/api/SDK
License: LGPL 3.0
License: Apache-2.0

Id: org.swinglabs.swingx:swingx-core
Project: SwingX
URL: https://swingx.java.net/
License: LGPL 3.0
License: LGPL-3.0

Id: microba
Path: lib/microba.jar
Expand All @@ -157,7 +155,7 @@ Id: spin
Path: lib/spin.jar
Project: Spin
URL: http://spin.sourceforge.net/
License: LGPL 2.1+
License: LGPL-2.1+

Id: org.citationstyles.styles
Project: CSL Styles
Expand All @@ -167,11 +165,11 @@ Licence: Creative Commons Attribution-ShareAlike 3.0 Unported license
Id: org.citationstyles.locales
Project: CSL Locales
URL: https://github.com/citation-style-language/locales
Licence: Creative Commons Attribution-ShareAlike 3.0 Unported license
Licence: CC-BY-SA-3.0

Id: de.undercouch.citeproc-java
Project: Citeproc-Java
URL: http://michel-kraemer.github.io/citeproc-java/
Licence: Apache License, Version 2.0
Licence: Apache-2.0

The last entry has to end with an empty line. Otherwise the entry is not present in About.html.
6 changes: 3 additions & 3 deletions jabref.install4j
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ return true;</string>
</applications>
</installerGui>
<mediaSets>
<windows name="Windows 32bit JRE" id="73" customizedId="" mediaFileName="${compiler:sys.shortName}_${compiler:sys.platform}_${compiler:version}" installDir="${compiler:sys.shortName}" overridePrincipalLanguage="false" jreBitType="32" runPostProcessor="false" postProcessor="" failOnPostProcessorError="false" useLegacyMediaFileIds="false" legacyMediaFileIds="" downloadURL="" includeAllDownloadableComponents="false" includedJRE="windows-x86-1.8.0_112" manualJREEntry="false" bundleType="2" jreURL="http://files.jabref.org/jres/windows-x86-1.8.0_112.tar.gz" jreShared="true" directDownload="false" installOnlyIfNecessary="true" customInstallBaseDir="" contentFilesType="1" verifyIntegrity="true">
<windows name="Windows 32bit JRE" id="73" customizedId="" mediaFileName="${compiler:sys.shortName}_${compiler:sys.platform}_${compiler:version}" installDir="${compiler:sys.shortName}" overridePrincipalLanguage="false" jreBitType="32" runPostProcessor="false" postProcessor="" failOnPostProcessorError="false" useLegacyMediaFileIds="false" legacyMediaFileIds="" downloadURL="" includeAllDownloadableComponents="false" includedJRE="windows-x86-1.8.0_112" manualJREEntry="false" bundleType="2" jreURL="https://files.jabref.org/jres/windows-x86-1.8.0_112.tar.gz" jreShared="true" directDownload="false" installOnlyIfNecessary="true" customInstallBaseDir="" contentFilesType="1" verifyIntegrity="true">
<excludedComponents />
<includedDownloadableComponents />
<excludedLaunchers />
Expand All @@ -721,7 +721,7 @@ return true;</string>
<customAttributes />
</autoUpdate>
</windows>
<windows name="Windows 64bit JRE" id="74" customizedId="" mediaFileName="${compiler:sys.shortName}_${compiler:sys.platform}_${compiler:version}" installDir="${compiler:sys.shortName}" overridePrincipalLanguage="false" jreBitType="64" runPostProcessor="false" postProcessor="" failOnPostProcessorError="false" useLegacyMediaFileIds="false" legacyMediaFileIds="" downloadURL="" includeAllDownloadableComponents="false" includedJRE="windows-amd64-1.8.0_112" manualJREEntry="false" bundleType="2" jreURL="http://files.jabref.org/jres/windows-amd64-1.8.0_112.tar.gz" jreShared="true" directDownload="false" installOnlyIfNecessary="true" customInstallBaseDir="" contentFilesType="1" verifyIntegrity="true">
<windows name="Windows 64bit JRE" id="74" customizedId="" mediaFileName="${compiler:sys.shortName}_${compiler:sys.platform}_${compiler:version}" installDir="${compiler:sys.shortName}" overridePrincipalLanguage="false" jreBitType="64" runPostProcessor="false" postProcessor="" failOnPostProcessorError="false" useLegacyMediaFileIds="false" legacyMediaFileIds="" downloadURL="" includeAllDownloadableComponents="false" includedJRE="windows-amd64-1.8.0_112" manualJREEntry="false" bundleType="2" jreURL="https://files.jabref.org/jres/windows-amd64-1.8.0_112.tar.gz" jreShared="true" directDownload="false" installOnlyIfNecessary="true" customInstallBaseDir="" contentFilesType="1" verifyIntegrity="true">
<excludedComponents />
<includedDownloadableComponents />
<excludedLaunchers />
Expand All @@ -734,7 +734,7 @@ return true;</string>
<customAttributes />
</autoUpdate>
</windows>
<macos name="Mac OS X Single Bundle JRE" id="77" customizedId="" mediaFileName="${compiler:sys.shortName}_${compiler:sys.platform}_${compiler:version}" installDir="${compiler:sys.fullName}" overridePrincipalLanguage="false" jreBitType="all" runPostProcessor="false" postProcessor="" failOnPostProcessorError="false" useLegacyMediaFileIds="false" legacyMediaFileIds="" downloadURL="" includeAllDownloadableComponents="false" includedJRE="macosx-amd64-1.8.0_112_unpacked" manualJREEntry="false" bundleType="2" jreURL="http://files.jabref.org/jres/macosx-amd64-1.8.0_112_unpacked.tar.gz" jreShared="false" directDownload="false" installOnlyIfNecessary="false" appleJre="false" requiredVmIdPrefix="" customInstallBaseDir="" contentFilesType="1" installerName="${i18n:InstallerName(${compiler:sys.fullName})}" volumeName="${compiler:sys.shortName}" compressDmg="false" launcherId="23">
<macos name="Mac OS X Single Bundle JRE" id="77" customizedId="" mediaFileName="${compiler:sys.shortName}_${compiler:sys.platform}_${compiler:version}" installDir="${compiler:sys.fullName}" overridePrincipalLanguage="false" jreBitType="all" runPostProcessor="false" postProcessor="" failOnPostProcessorError="false" useLegacyMediaFileIds="false" legacyMediaFileIds="" downloadURL="" includeAllDownloadableComponents="false" includedJRE="macosx-amd64-1.8.0_112_unpacked" manualJREEntry="false" bundleType="2" jreURL="https://files.jabref.org/jres/macosx-amd64-1.8.0_112_unpacked.tar.gz" jreShared="false" directDownload="false" installOnlyIfNecessary="false" appleJre="false" requiredVmIdPrefix="" customInstallBaseDir="" contentFilesType="1" installerName="${i18n:InstallerName(${compiler:sys.fullName})}" volumeName="${compiler:sys.shortName}" compressDmg="false" launcherId="23">
<excludedComponents />
<includedDownloadableComponents />
<excludedBeans />
Expand Down
12 changes: 5 additions & 7 deletions scripts/prepare-install4j.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,17 @@ fi

# ensure that tar archive of install4j exists
cd ~/downloads
if [ ! -f install4j_unix_6_1_1.tar.gz ]; then
wget --quiet http://download-aws.ej-technologies.com/install4j/install4j_unix_6_1_1.tar.gz
fi;
wget --quiet -nc http://download-keycdn.ej-technologies.com/install4j/install4j_unix_6_1_3.tar.gz

# extract tar archive of install4j into the source directory of JabRef
cd ~/jabref
tar -xzf ~/downloads/install4j_unix_6_1_1.tar.gz
tar -xzf ~/downloads/install4j_unix_6_1_3.tar.gz

# fetch JREs
if [ ! -d ~/.install4j6/jres/ ]; then
mkdir -p ~/.install4j6/jres/
fi
cd ~/.install4j6/jres/
wget --quiet -nc http://files.jabref.org/jres/windows-x86-1.8.0_112.tar.gz
wget --quiet -nc http://files.jabref.org/jres/windows-amd64-1.8.0_112.tar.gz
wget --quiet -nc http://files.jabref.org/jres/macosx-amd64-1.8.0_112_unpacked.tar.gz
wget --quiet -nc https://files.jabref.org/jres/windows-x86-1.8.0_112.tar.gz
wget --quiet -nc https://files.jabref.org/jres/windows-amd64-1.8.0_112.tar.gz
wget --quiet -nc https://files.jabref.org/jres/macosx-amd64-1.8.0_112_unpacked.tar.gz
24 changes: 24 additions & 0 deletions src/main/java/net/sf/jabref/FallbackExceptionHandler.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package net.sf.jabref;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.Marker;
import org.apache.logging.log4j.MarkerManager;

/**
* Catch and log any unhandled exceptions.
*/
public class FallbackExceptionHandler implements Thread.UncaughtExceptionHandler {

private static final Marker UncaughtException_MARKER = MarkerManager.getMarker("UncaughtException");

public static void installExceptionHandler() {
Thread.setDefaultUncaughtExceptionHandler(new FallbackExceptionHandler());
}

@Override
public void uncaughtException(Thread thread, Throwable exception) {
Logger logger = LogManager.getLogger(FallbackExceptionHandler.class);
logger.error(UncaughtException_MARKER, "Uncaught exception Occurred in " + thread, exception);
}
}
3 changes: 3 additions & 0 deletions src/main/java/net/sf/jabref/JabRefExecutorService.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public class JabRefExecutorService implements Executor {
private final ExecutorService executorService = Executors.newCachedThreadPool(r -> {
Thread thread = new Thread(r);
thread.setName("JabRef CachedThreadPool");
thread.setUncaughtExceptionHandler(new FallbackExceptionHandler());
return thread;
});
private final ConcurrentLinkedQueue<Thread> startedThreads = new ConcurrentLinkedQueue<>();
Expand Down Expand Up @@ -90,6 +91,7 @@ public void executeWithLowPriorityInOwnThread(final Runnable runnable, String na
final Thread thread = new Thread(target);
target.thread = thread;
thread.setName("JabRef - " + name + " - low prio");
thread.setUncaughtExceptionHandler(new FallbackExceptionHandler());
startedThreads.add(thread);
thread.setPriority(Thread.MIN_PRIORITY);
thread.start();
Expand All @@ -106,6 +108,7 @@ public void executeInOwnThread(Thread thread) {
public void executeWithLowPriorityInOwnThreadAndWait(Runnable runnable) {
Thread thread = new Thread(runnable);
thread.setName("JabRef low prio");
thread.setUncaughtExceptionHandler(new FallbackExceptionHandler());
startedThreads.add(thread);
thread.setPriority(Thread.MIN_PRIORITY);
thread.start();
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/net/sf/jabref/JabRefMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ public static void main(String[] args) {
}

private static void start(String[] args) {
FallbackExceptionHandler.installExceptionHandler();

JabRefPreferences preferences = JabRefPreferences.getInstance();

ProxyPreferences proxyPreferences = preferences.getProxyPreferences();
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/sf/jabref/gui/actions/BaseAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
@FunctionalInterface
public interface BaseAction {

void action() throws Throwable;
void action() throws Exception;
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public CopyBibTeXKeyAndLinkAction(MainTable mainTable) {
}

@Override
public void action() throws Throwable {
public void action() throws Exception {
List<BibEntry> entries = mainTable.getSelectedEntries();
if (!entries.isEmpty()) {
StringBuilder sb = new StringBuilder();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public void run() {
}

@Override
public void init() throws Throwable {
public void init() throws Exception {
panel.output(Localization.lang("Resolving duplicate BibTeX keys..."));

}
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/net/sf/jabref/gui/exporter/SaveDatabaseAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public SaveDatabaseAction(BasePanel panel, Path filePath) {
}

@Override
public void init() throws Throwable {
public void init() throws Exception {
success = false;
canceled = false;
fileLockedError = false;
Expand Down Expand Up @@ -280,7 +280,7 @@ private boolean saveDatabase(File file, boolean selectedOnly, Charset encoding)
* Run the "Save" operation. This method offloads the actual save operation to a background thread, but
* still runs synchronously using Spin (the method returns only after completing the operation).
*/
public void runCommand() throws Throwable {
public void runCommand() throws Exception {
// This part uses Spin's features:
Worker worker = getWorker();
// The Worker returned by getWorker() has been wrapped
Expand All @@ -300,12 +300,12 @@ public void runCommand() throws Throwable {
callback.update(); // Runs the update() method on the EDT.
}

public void save() throws Throwable {
public void save() throws Exception {
runCommand();
frame.updateEnabledState();
}

public void saveAs() throws Throwable {
public void saveAs() throws Exception {
// configure file dialog
FileDialog dialog = new FileDialog(frame);
dialog.withExtension(FileExtensions.BIBTEX_DB);
Expand All @@ -324,7 +324,7 @@ public void saveAs() throws Throwable {
* Run the "Save as" operation. This method offloads the actual save operation to a background thread, but
* still runs synchronously using Spin (the method returns only after completing the operation).
*/
public void saveAs(File file) throws Throwable {
public void saveAs(File file) throws Exception {
BibDatabaseContext context = panel.getBibDatabaseContext();

if (context.getLocation() == DatabaseLocation.SHARED) {
Expand Down
Loading

0 comments on commit 12dc92d

Please sign in to comment.