Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into sharelatex
Browse files Browse the repository at this point in the history
* upstream/master: (94 commits)
  Add missing localization for Any file
  Refactor dublin core utility (#3756)
  Add Localization
  Update Architecture Tests to catch static imports (#3766)
  Added <any file type> to the Import File Filter Dialog.
  Don't trim when migrating review field (#3761)
  Reorder again
  Rename confirmation into "Merge fields"
  Fix logic
  Reorder checklist in PR template and add "good commit message"
  Replace x11 by unity7
  Include desktop, desktop-legacy, wayland in snapcraft.yaml
  Improve Dublin Core (#3710)
  Incorporate suggestions by @Siedlerchr
  Update JUnit from 5.1.0-M2 -> 5.1.0
  Update Mockito from 2.13.0 -> 2.15.0
  Update wiremock from 2.14.0 -> 2.15.0
  Fix exceptions for jacoco
  update gradle
  Add link to contribute.jabref.org (#3748)
  ...

# Conflicts:
#	src/main/java/org/jabref/gui/JabRefFrame.java
  • Loading branch information
Siedlerchr committed Feb 24, 2018
2 parents 0ae5f11 + 437677c commit 172a03e
Show file tree
Hide file tree
Showing 395 changed files with 6,269 additions and 6,596 deletions.
7 changes: 5 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
<!-- describe the changes you have made here: what, why, ... -->
<!-- describe the changes you have made here: what, why, ...
Link issues by using the following pattern: [#333](https://github.com/JabRef/jabref/issues/333) or [koppor#49](https://github.com/koppor/jabref/issues/47).
The title of the PR must not reference an issue, because GitHub does not support autolinking there. -->


----

- [ ] Change in CHANGELOG.md described
- [ ] Tests created for changes
- [ ] Screenshots added (for bigger UI changes)
- [ ] Manually tested changed features in running JabRef
- [ ] Screenshots added in PR description (for bigger UI changes)
- [ ] Ensured that [the git commit message is a good one](https://github.com/joelparkerhenderson/git_commit_message)
- [ ] Check documentation status (Issue created for outdated help page at [help.jabref.org](https://github.com/JabRef/help.jabref.org/issues)?)
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,36 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
## [Unreleased]

### Changed
- Added "*.*" (any file type) to the Import File Filter Dialog. [#3757] (https://github.com/JabRef/jabref/issues/3757)
- Abbreviate journal names functionality is now running parallel, increasing performance significantly. [#2831] (https://github.com/JabRef/jabref/issues/2831)
- Changed order of items in context menu [#298] (https://github.com/koppor/jabref/issues/298)
- Changed ID-based entry generator to store the last used fetcher. [#2796] (https://github.com/JabRef/jabref/issues/2796)
- Reorganised annotation information on the right side of the "File annotations" tab. [#3109](https://github.com/JabRef/jabref/issues/3109)
- We now show a small notification icon in the entry editor when we detect data inconsistency or other problems. [#3145](https://github.com/JabRef/jabref/issues/3145)
- We added [oaDOI](https://oadoi.org/) as a fulltext provider, so that JabRef is now able to provide fulltexts for more than 90 million open-access articles.
- We changed one default of [Cleanup entries dialog](http://help.jabref.org/en/CleanupEntries): Per default, the PDF are not moved to the default file directory anymore. [#3619](https://github.com/JabRef/jabref/issues/3619)
- We added a new type of group that shows all items referenced in a given LaTeX file (actually the generated AUX file). [#1664](https://github.com/JabRef/jabref/issues/1664)
- We added an importer for the EndNote XML format. [Feature request in the forum](http://discourse.jabref.org/t/import-from-bookends-or-endnote/1048)
- We added the export of the `translator` field to the according MS-Office XML field. [#1750, comment](https://github.com/JabRef/jabref/issues/1750#issuecomment-357350986)
- We changed the import of the MS-Office XML fields `bookauthor` and `translator`. Both are now imported to their corresponding bibtex/biblatex fields.
- We improved the export of the `address` and `location` field to the MS-Office XML fields. If the address field does not contain a comma, it is treated as single value and exported to the field `city`. [#1750, comment](https://github.com/JabRef/jabref/issues/1750#issuecomment-357539167)
For more details refer to the [field mapping help page](http://help.jabref.org/en/MsOfficeBibFieldMapping)
- We added Facebook and Twitter icons in the toolbar to link to our [Facebook](https://www.facebook.com/JabRef/) and [Twitter](https://twitter.com/jabref_org) pages.
- Renamed the _Review_ Tab into _Comments_ Tab
- We no longer print empty lines when exporting an entry in RIS format [#3634](https://github.com/JabRef/jabref/issues/3634)
- We improved file saving so that hard links are now preserved when a save is performed [#2633](https://github.com/JabRef/jabref/issues/2633)
- We changed the default dialog option when removing a [file link](http://help.jabref.org/en/FileLinks#adding-external-links-to-an-entry) from an entry.
The new default removes the linked file from the entry instead of deleting the file from disk. [#3679](https://github.com/JabRef/jabref/issues/3679)
- The group editing window can now also be called by double-clicking the group to be edited. [koppor#277](https://github.com/koppor/jabref/issues/277)
- The magnifier icon at the search shows the [search mode](https://help.jabref.org/en/Search#search-modes) again. [#3535](https://github.com/JabRef/jabref/issues/3535)
- We added a new cleanup operation that replaces ligatures with their expanded form. [#3613](https://github.com/JabRef/jabref/issues/3613)
- Pressing <kbd>ESC</kbd> while searching will clear the search field and select the first entry, if available, in the table. [koppor#293](https://github.com/koppor/jabref/issues/293)
- We changed the metadata reading and writing. DublinCore is now the only metadata format, JabRef supports. (https://github.com/JabRef/jabref/pull/3710)
- We added another CLI functionality for reading and writing metadata to pdfs. (see https://github.com/JabRef/jabref/pull/3756 and see http://help.jabref.org/en/CommandLine)

### Fixed
- We fixed several performance problems with the management of journal abbreviations [#3323](https://github.com/JabRef/jabref/issues/3323)
- We fixed an issue where changing the type of an entry did not update the label in the tool bar of the entry editor and the contents of the currently visible entry editor tab
- We fixed an issue where pressing space caused the cursor to jump to the start of the text field. [#3471](https://github.com/JabRef/jabref/issues/3471)
- We fixed the missing dot in the name of an exported file. [#3576](https://github.com/JabRef/jabref/issues/3576)
- Autocompletion in the search bar can now be disabled via the preferences. [#3598](https://github.com/JabRef/jabref/issues/3598)
Expand All @@ -36,6 +50,7 @@ The new default removes the linked file from the entry instead of deleting the f
- Chaining modifiers in BibTeX key pattern now works as described in the documentation. [#3648](https://github.com/JabRef/jabref/issues/3648)
- We fixed an issue where not all bibtex/biblatex fields would be exported as latex-free to MS-Office XML [koppor#284](https://github.com/koppor/jabref/issues/284)
- We fixed an issue where linked files would be deleted from bibliography entries despite choosing the "Cancel" option in the dialog menu.
- We fixed the name of the group editing window to "Add group" instead of "Edit Group" when adding a new group. [koppor#277](https://github.com/koppor/jabref/issues/277)

### Removed
- We removed the [Look and Feels from JGoodies](http://www.jgoodies.com/freeware/libraries/looks/), because the open source version is not compatible with Java 9.
Expand Down
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ Your contribution is considered being made under [MIT license](https://tldrlegal

### Write a good commit message
See [good commit message] or [commit guidelines section of Pro Git].
The first line of your commit message is automatically taken as title for the pull-request.
All other lines make up the body of the pull request. Add the words `fixes #xxx` to your PR to auto-close the corresponding issue.


### Test your code
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ An explanation of donation possibilities and usage of donations is available at
[![Join the chat at https://gitter.im/JabRef/jabref](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/JabRef/jabref?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![OpenHub](https://www.openhub.net/p/jabref/widgets/project_thin_badge.gif)](https://www.openhub.net/p/jabref)

> Not a programmer? [Learn how to help.](http://contribute.jabref.org)
Want to be part of a free and open-source project that tens of thousands scientist use every day?
Check out our [issue tracker](https://github.com/JabRef/jabref/issues) to find something to work on.
You are also welcome to contribute new features.
Expand Down
37 changes: 13 additions & 24 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ buildscript {
}
}
dependencies {
classpath 'org.junit.platform:junit-platform-gradle-plugin:1.1.0-M1'
classpath 'org.junit.platform:junit-platform-gradle-plugin:1.1.0'
}
}

Expand Down Expand Up @@ -90,10 +90,9 @@ dependencies {
compile 'com.jgoodies:jgoodies-common:1.8.1'
compile 'com.jgoodies:jgoodies-forms:1.9.0'

// update to 2.0.x is not possible - see https://github.com/JabRef/jabref/pull/1096#issuecomment-208857517
compile 'org.apache.pdfbox:pdfbox:1.8.13'
compile 'org.apache.pdfbox:fontbox:1.8.13'
compile 'org.apache.pdfbox:jempbox:1.8.13'
compile 'org.apache.pdfbox:pdfbox:2.0.8'
compile 'org.apache.pdfbox:fontbox:2.0.8'
compile 'org.apache.pdfbox:xmpbox:2.0.8'

// required for reading write-protected PDFs - see https://github.com/JabRef/jabref/pull/942#issuecomment-209252635
compile 'org.bouncycastle:bcprov-jdk15on:1.59'
Expand Down Expand Up @@ -162,15 +161,15 @@ dependencies {
compile "org.bitbucket.cowwoc:diff-match-patch:1.1"


testCompile 'org.junit.jupiter:junit-jupiter-api:5.1.0-M2'
testCompile 'org.junit.jupiter:junit-jupiter-params:5.1.0-M2'
testRuntime 'org.junit.jupiter:junit-jupiter-engine:5.1.0-M2'
testRuntime 'org.junit.vintage:junit-vintage-engine:5.1.0-M2'
testCompile 'org.junit.platform:junit-platform-launcher:1.1.0-M2'
testCompile 'org.junit.jupiter:junit-jupiter-api:5.1.0'
testCompile 'org.junit.jupiter:junit-jupiter-params:5.1.0'
testRuntime 'org.junit.jupiter:junit-jupiter-engine:5.1.0'
testRuntime 'org.junit.vintage:junit-vintage-engine:5.1.0'
testCompile 'org.junit.platform:junit-platform-launcher:1.1.0'
testRuntime 'org.apache.logging.log4j:log4j-core:2.10.0'
testRuntime 'org.apache.logging.log4j:log4j-jul:2.10.0'
testCompile 'org.mockito:mockito-core:2.13.0'
testCompile 'com.github.tomakehurst:wiremock:2.14.0'
testCompile 'org.mockito:mockito-core:2.15.0'
testCompile 'com.github.tomakehurst:wiremock:2.15.0'
testCompile 'org.assertj:assertj-swing-junit:3.8.0'
testCompile 'org.reflections:reflections:0.9.11'
testCompile 'org.xmlunit:xmlunit-core:2.5.1'
Expand Down Expand Up @@ -223,27 +222,17 @@ dependencyUpdates.resolutionStrategy = {
selection.reject("Cannot be upgraded to version 2")
}
}
withModule("org.apache.pdfbox:fontbox") { ComponentSelection selection ->
if (selection.candidate.version ==~ /2.*/) {
selection.reject("update to 2.0.x is not possible - see https://github.com/JabRef/jabref/pull/1096#issuecomment-208857517")
}
}
withModule("org.apache.pdfbox:pdfbox") { ComponentSelection selection ->
if (selection.candidate.version ==~ /2.*/) {
selection.reject("update to 2.0.x is not possible - see https://github.com/JabRef/jabref/pull/1096#issuecomment-208857517")
}
}
withModule("mysql:mysql-connector-java") { ComponentSelection selection ->
if (selection.candidate.version ==~ /[6-9].*/) {
selection.reject("http://dev.mysql.com/downloads/connector/j/ lists the version 5.* as last stable version.")
}
}
withModule("org.jacoco.agent") { ComponentSelection selection ->
withModule("org.jacoco:org.jacoco.agent") { ComponentSelection selection ->
if (selection.candidate.version.equals("0.8.0")) {
selection.reject("As a native plugin we cannot control the actual version of jacoco. This dependency should be hidden.")
}
}
withModule("org.jacoco.ant") { ComponentSelection selection ->
withModule("org.jacoco:org.jacoco.ant") { ComponentSelection selection ->
if (selection.candidate.version.equals("0.8.0")) {
selection.reject("As a native plugin we cannot control the actual version of jacoco. This dependency should be hidden.")
}
Expand Down
62 changes: 34 additions & 28 deletions docs/adr/template.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,48 @@
# *[short title of solved problem and solution]*
# [short title of solved problem and solution]

**User Story:** *[ticket/issue-number]* <!-- optional -->
User Story: [ticket/issue-number] <!-- optional -->

*[context and problem statement]*
*[decision drivers | forces]* <!-- optional -->
[context and problem statement]
[decision drivers | forces | facing] <!-- optional -->

## Considered Alternatives
## Considered Options

* *[alternative 1]*
* *[alternative 2]*
* *[alternative 3]*
* *[...]* <!-- numbers of alternatives can vary -->
* [option 1]
* [option 2]
* [option 3]
* ... <!-- numbers of options can vary -->

## Decision Outcome

* Chosen Alternative: *[alternative 1]*
* *[justification. e.g., only alternative, which meets k.o. criterion decision driver | which resolves force force | ... | comes out best (see below)]*
* *[consequences. e.g., negative impact on quality attribute, follow-up decisions required, ...]* <!-- optional -->
Chosen option: [option 1], because [justification. e.g., only option, which meets k.o. criterion decision driver | which resolves force force | ... | comes out best (see below)].

## Pros and Cons of the Alternatives <!-- optional -->
Positive Consequences: <!-- optional -->
- [e.g., improvement of quality attribute satisfaction, follow-up decisions required, ...]
- ...

### *[alternative 1]*
Negative consequences: <!-- optional -->
- [e.g., compromising quality attribute, follow-up decisions required, ...]
- ...

* `+` *[argument 1 pro]*
* `+` *[argument 2 pro]*
* `-` *[argument 1 con]*
* *[...]* <!-- numbers of pros and cons can vary -->
## Pros and Cons of the Options <!-- optional -->

### *[alternative 2]*
### [option 1]

* `+` *[argument 1 pro]*
* `+` *[argument 2 pro]*
* `-` *[argument 1 con]*
* *[...]* <!-- numbers of pros and cons can vary -->
* Good, because [argument a]
* Good, because [argument b]
* Bad, because [argument c]
* ... <!-- numbers of pros and cons can vary -->

### *[alternative 3]*
### [option 2]

* `+` *[argument 1 pro]*
* `+` *[argument 2 pro]*
* `-` *[argument 1 con]*
* *[...]* <!-- numbers of pros and cons can vary -->
* Good, because [argument a]
* Good, because [argument b]
* Bad, because [argument c]
* ... <!-- numbers of pros and cons can vary -->

### [option 3]

* Good, because [argument a]
* Good, because [argument b]
* Bad, because [argument c]
* ... <!-- numbers of pros and cons can vary -->
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.5.1-bin.zip
15 changes: 15 additions & 0 deletions scripts/bib-file-generator.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
number_of_entries = 100000
file = open("generatedDatabase.bib", 'w')

for i in range(number_of_entries):
entry = """@article{%i,
author = {%i},
title = {%i},
journal = {%i},
volume = {%i},
year = {%i},
pages = {%i},
}""" % (i, i, i, i, i, i, i)
file.write(entry)
file.flush()
file.close()
8 changes: 4 additions & 4 deletions snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

name: jabref

# the version string 4.0-dev is replaced by scripts/run-snapcraft.sh with the current version provided in build.gradle
version: '4.0-dev'
# the version string 4.2-dev is replaced by scripts/run-snapcraft.sh with the current version provided in build.gradle
version: '4.2-dev'

summary: Bibliography manager
icon: buildres/snapcraft/JabRef-icon-256.png
Expand All @@ -21,8 +21,8 @@ confinement: strict

apps:
jabref:
command: desktop-launch java -jar $SNAP/jar/JabRef-4.0-dev.jar
plugs: [home, network-bind, x11]
command: desktop-launch java -jar $SNAP/jar/JabRef-4.2-dev.jar
plugs: [desktop, desktop-legacy, wayland, unity7, home, network-bind]
desktop: ../buildres/snapcraft/jabref.desktop

parts:
Expand Down
63 changes: 41 additions & 22 deletions src/main/java/org/jabref/JabRefExecutorService.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
package org.jabref;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Timer;
import java.util.TimerTask;
import java.util.concurrent.Callable;
Expand All @@ -12,7 +17,6 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;


/**
* Responsible for managing of all threads (except Swing threads) in JabRef
*/
Expand All @@ -36,24 +40,17 @@ public class JabRefExecutorService implements Executor {
private final Timer timer = new Timer("timer", true);
private Thread remoteThread;

private JabRefExecutorService() { }
private JabRefExecutorService() {
}

@Override
public void execute(Runnable command) {
if (command == null) {
LOGGER.debug("Received null as command for execution");
return;
}

Objects.requireNonNull(command);
executorService.execute(command);
}

public void executeAndWait(Runnable command) {
if (command == null) {
LOGGER.debug("Received null as command for execution");
return;
}

Objects.requireNonNull(command);
Future<?> future = executorService.submit(command);
while (true) {
try {
Expand All @@ -67,12 +64,8 @@ public void executeAndWait(Runnable command) {
}
}

public boolean executeAndWait(Callable command) {
if (command == null) {
LOGGER.debug("Received null as command for execution");
return false;
}

public boolean executeAndWait(Callable<?> command) {
Objects.requireNonNull(command);
Future<?> future = executorService.submit(command);
while (true) {
try {
Expand All @@ -87,6 +80,35 @@ public boolean executeAndWait(Callable command) {
}
}

/**
* Executes a callable task that provides a return value after the calculation is done.
*
* @param command The task to execute.
* @return A Future object that provides the returning value.
*/
public <T> Future<T> execute(Callable<T> command) {
Objects.requireNonNull(command);
return executorService.submit(command);
}

/**
* Executes a collection of callable tasks and returns a List of the resulting Future objects after the calculation is done.
*
* @param tasks The tasks to execute
* @return A List of Future objects that provide the returning values.
*/
public <T> List<Future<T>> executeAll(Collection<Callable<T>> tasks) {
Objects.requireNonNull(tasks);
List<Future<T>> futures = new ArrayList<>();
try {
futures = executorService.invokeAll(tasks);
} catch (InterruptedException exception) {
LOGGER.error("Unable to execute tasks", exception);
return Collections.emptyList();
}
return futures;
}

public void executeInterruptableTask(final Runnable runnable) {
this.lowPriorityExecutorService.execute(runnable);
}
Expand All @@ -96,10 +118,7 @@ public void executeInterruptableTask(final Runnable runnable, String taskName) {
}

public void executeInterruptableTaskAndWait(Runnable runnable) {
if (runnable == null) {
LOGGER.debug("Received null as command for execution");
return;
}
Objects.requireNonNull(runnable);

Future<?> future = lowPriorityExecutorService.submit(runnable);
while (true) {
Expand Down
Loading

0 comments on commit 172a03e

Please sign in to comment.