Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into moveFileDir
Browse files Browse the repository at this point in the history
* upstream/master: (67 commits)
  Medline fix test (#2463)
  Fix conversion of tilde n (#2459)
  ctrl+f selects current query while the searchbar is focusd (#2457)
  incorrect log name of JabRefExecutorService (#2452)
  unregister DateChangeListener in manual update method (#2450)
  Escaping of escape symbols in the MetaData (#2445)
  Fix typo
  Update gradle from 3.2.1 to 3.3
  Use instanceof
  Remove unused import
  Avoid ClassCastException in AutoCompleteListener
  Fix typo in CHANGELOG.md
  Add support for pages in the format 2:1-2:33 (#2440)
  L10N-ru update (#2441)
  Change https to http
  Update DBLP API endpoint
  Revert "Chistmas edition colors"
  Show development information
  Release v3.8.1
  Result of generate-authors.sh
  ...

# Conflicts:
#	CHANGELOG.md
#	src/main/java/net/sf/jabref/gui/date/DatePickerButton.java
  • Loading branch information
Siedlerchr committed Jan 13, 2017
2 parents 24c0f31 + d825953 commit a64dd54
Show file tree
Hide file tree
Showing 24 changed files with 156 additions and 78 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ gradlew eol=lf
*.properties text
*.java text

# disalbe after a release
# disable after a release
# CHANGELOG.md merge=union

src/main/resources/l10n/*.properties merge=union
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Andreas Rudert
Anh Nghia Tran
Antonio Ribeiro
Arno Blouin
avaucher
Behrouz Javanmardi
Bernd Kalbfuss
Bernhard Tempel
Expand Down
56 changes: 39 additions & 17 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,26 @@ Here, the categories "Changed" for added and changed functionality,

We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#NUM`.


## [Unreleased]

### Changed
- When [adding a new entry](http://help.jabref.org/en/BaseFrame#adding-a-new-entry), one can select "title" to create a full BibTeX entry based on a title.
- When editing an article, the tab "Optional fields" now shows "ISSN".
- When editing a book, the tab "Optional fields" now shows "ISBN".
- When using "Copy citation (HTML)" and pasting into a text editor, plain text is always pasted.
- When using the "Download from URL" functionality, one is not limited to http(s) URLs, but can, for instance, enter ftp URLs.
- When using the "Look up full text documents" functionality, JabRef warns more explicitly about multiple requests.
- The entry received from DOI does no longer contain the DOI as URL. Implements [#2417](https://github.com/JabRef/jabref/issues/2417).
- We use following parameters for the JVM on Windows and OSX: `-XX:+UseG1GC -XX:+UseStringDeduplication -XX:StringTableSize=1000003`.

### Fixed
- Fixed [#2391](https://github.com/JabRef/jabref/issues/2391): Clicking on "Get Fulltext" button sets links correctly for the entry being edited.
- The integrity check now determines the set of BibLaTeX-only fields differently. Fixes [#2390](https://github.com/JabRef/jabref/issues/2390).
- We fixed an issue where groups containing brackets were not working properly. Fixes [#2394](https://github.com/JabRef/jabref/issues/2394).
- We fixed issues with the [timestamp](http://help.jabref.org/en/TimeStamp) field. However, clearing with the clear button is not possible if timestamp format does not match the current settings. Fixes [#2403](https://github.com/JabRef/jabref/issues/2403).
- Fixes [#2406](https://github.com/JabRef/jabref/issues/2406) so that the integrity check filter works again
- Closing of subtrees in the groups panel using "close subtree" is working again. Fixes [#2319](https://github.com/JabRef/jabref/issues/2319).
- The proxy settings are now also applied to HTTPS connections. Fixes [#2249](https://github.com/JabRef/jabref/issues/2249).
- The formatter for normalizing pages now also can treat ACM pages such as `2:1--2:33`.
- Backslashes in content selectors are now correctly escaped. Fixes [#2426](https://github.com/JabRef/jabref/issues/2426).
- Non-ISO timestamp settings prevented the opening of the entry editor (see [#2447](https://github.com/JabRef/jabref/issues/2447))
- When pressing <kbd>Ctrl</kbd> + <kbd>F</kbd> and the searchbar is already focused the text will be selected.
- LaTeX symbols are now displayed as Unicode for the author column in the main table. Fixes [#2458](https://github.com/JabRef/jabref/issues/2458).

### Removed







### Removed



Expand Down Expand Up @@ -72,6 +68,31 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#







## [3.8.1] – 2016-12-24

### Changed
- When [adding a new entry](https://help.jabref.org/en/BaseFrame#adding-a-new-entry), one can select "title" to create a full BibTeX entry based on a title.
- When [editing](https://help.jabref.org/en/EntryEditor) an article, the tab "Optional fields" now shows "ISSN".
- When editing a book, the tab "Optional fields" now shows "ISBN".
- When using "Copy citation (HTML)" and pasting into a text editor, plain text is always pasted.
- When using the "Download from URL" functionality, one is not limited to http(s) URLs, but can, for instance, enter ftp URLs.
- When using the "Look up full text documents" functionality, JabRef warns more explicitly about multiple requests.
- The entry received from DOI does no longer contain the DOI as URL. Implements [#2417](https://github.com/JabRef/jabref/issues/2417).
- We use following parameters for the JVM on Windows and OSX: `-XX:+UseG1GC -XX:+UseStringDeduplication -XX:StringTableSize=1000003`.

### Fixed
- Clicking on "Get Fulltext" button sets links correctly for the entry being edited. Fixes [#2391](https://github.com/JabRef/jabref/issues/2391).
- The [integrity check](https://help.jabref.org/en/CheckIntegrity) now determines the set of BibLaTeX-only fields differently. Fixes [#2390](https://github.com/JabRef/jabref/issues/2390).
- The integrity check filter works again. Fixes [#2406](https://github.com/JabRef/jabref/issues/2406).
- The [ArXiv fetcher](http://help.jabref.org/en/arXiv) also accepts identifiers that include the "arXiv:" prefix. Fixes [#2427](https://github.com/JabRef/jabref/issues/2427).
- We fixed an issue where groups containing brackets were not working properly. Fixes [#2394](https://github.com/JabRef/jabref/issues/2394).
- Closing of subtrees in the groups panel using "close subtree" is working again. Fixes [#2319](https://github.com/JabRef/jabref/issues/2319).
- We fixed issues with the [timestamp](http://help.jabref.org/en/TimeStamp) field. However, clearing with the clear button is not possible if timestamp format does not match the current settings. Fixes [#2403](https://github.com/JabRef/jabref/issues/2403).
- The proxy settings are now also applied to HTTPS connections. Fixes [#2249](https://github.com/JabRef/jabref/issues/2249).


## [3.8] – 2016-12-16
Expand Down Expand Up @@ -722,7 +743,8 @@ Since much functionality has changed during development, a release of this versi

The changelog of 2.11 and versions before is maintained as [text file](https://github.com/JabRef/jabref/blob/v2.11.1/CHANGELOG) in the [v2.11.1 tag](https://github.com/JabRef/jabref/tree/v2.11.1).

[unreleased]: https://github.com/JabRef/jabref/compare/v3.8...HEAD
[unreleased]: https://github.com/JabRef/jabref/compare/v3.8.1...HEAD
[3.8.1]: https://github.com/JabRef/jabref/compare/v3.8...v3.8.1
[3.8]: https://github.com/JabRef/jabref/compare/v3.7...v3.8
[3.7]: https://github.com/JabRef/jabref/compare/v3.6...v3.7
[3.6]: https://github.com/JabRef/jabref/compare/v3.5...v3.6
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ apply from: 'localization.gradle'
apply from: 'xjc.gradle'

group = "net.sf.jabref"
version = "3.8.1-dev"
project.ext.threeDotVersion = "3.8.0.1"
version = "3.8.2-dev"
project.ext.threeDotVersion = "3.8.1.1"
project.ext.install4jDir = hasProperty("install4jDir") ? getProperty("install4jDir") : (OperatingSystem.current().isWindows() ? 'C:/Program Files/install4j6' : 'install4j6')
sourceCompatibility = 1.8
targetCompatibility = 1.8
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Tue Dec 06 07:56:11 CET 2016
#Thu Jan 05 09:52:38 CET 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.2.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-bin.zip
11 changes: 6 additions & 5 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,14 @@ if $cygwin ; then
fi

# Escape application args
for s in "${@}" ; do
s=\"$s\"
APP_ARGS=$APP_ARGS" "$s
done
save ( ) {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")

# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- "$DEFAULT_JVM_OPTS" "$JAVA_OPTS" "$GRADLE_OPTS" "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"

# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/net/sf/jabref/JabRefExecutorService.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
import java.util.concurrent.Executors;
import java.util.concurrent.Future;

import net.sf.jabref.gui.undo.UndoableInsertEntry;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

Expand All @@ -18,7 +16,7 @@
*/
public class JabRefExecutorService implements Executor {

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

public static final JabRefExecutorService INSTANCE = new JabRefExecutorService();

Expand Down
8 changes: 4 additions & 4 deletions src/main/java/net/sf/jabref/gui/IconTheme.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ public class IconTheme {
/* Colors */

// JabRef's default colors
//public static final Color DEFAULT_COLOR = new Color(79, 95, 143); // The purple color of the logo
//public static final Color DEFAULT_DISABLED_COLOR = new Color(200, 200, 200);
public static final Color DEFAULT_COLOR = new Color(79, 95, 143); // The purple color of the logo
public static final Color DEFAULT_DISABLED_COLOR = new Color(200, 200, 200);

// Christmas edition
public static final Color DEFAULT_COLOR = new Color(0x155115);
public static final Color DEFAULT_DISABLED_COLOR = new Color(0x990000);
//public static final Color DEFAULT_COLOR = new Color(0x155115);
//public static final Color DEFAULT_DISABLED_COLOR = new Color(0x990000);


public static final int DEFAULT_SIZE = 24;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ private boolean atEndOfWord(JTextComponent textField) {
* @param wordSeperatorTyped indicates whether the user has typed a white space character or a
*/
private void setUnmodifiedTypedLetters(JTextComponent comp, boolean lastBeginningContainsTypedCharacter,
boolean wordSeperatorTyped) {
boolean wordSeperatorTyped) {
if (lastBeginning == null) {
LOGGER.debug("No last beginning found");
// There was no previous input (if the user typed a word, where no autocompletion is available)
Expand Down Expand Up @@ -268,14 +268,15 @@ public void keyTyped(KeyEvent e) {
}

// don't do auto completion inside words
if (!atEndOfWord((JTextComponent) e.getSource())) {
if (!(e.getSource() instanceof JTextComponent) || !atEndOfWord((JTextComponent) e.getSource())) {
return;
}

if ((e.getModifiers() | InputEvent.SHIFT_MASK) == InputEvent.SHIFT_MASK) {
// plain key or SHIFT + key is pressed, no handling of CTRL+key, META+key, ...
if (Character.isLetter(ch) || Character.isDigit(ch)
|| (Character.isWhitespace(ch) && completer.isSingleUnitField())) {

JTextComponent comp = (JTextComponent) e.getSource();

if (toSetIn == null) {
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/net/sf/jabref/gui/date/DatePickerButton.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ public JComponent getDatePicker() {
* @param dateString
*/
public void updateDatePickerDate(String dateString) {
// unregister DateChangeListener before update to prevent circular calls resulting in IllegalStateExceptions
datePicker.removeDateChangeListener(this);

if(dateString!=null && !dateString.isEmpty()) {
try {
datePicker.setDate(LocalDate.parse(dateString, dateTimeFormatter));
Expand All @@ -87,5 +90,7 @@ public void updateDatePickerDate(String dateString) {
+ "Clear button in calender popup will not work.");
}
}

datePicker.addDateChangeListener(this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public Object getColumnValue(BibEntry entry) {
String result = content.orElse(null);

if (isNameColumn) {
result = MainTableNameFormatter.formatName(result);
result = MainTableNameFormatter.formatName(toUnicode.format(result));
}

if (result != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,8 @@ public void endSearch() {
public void focus() {
if (!searchField.hasFocus()) {
searchField.requestFocus();
searchField.selectAll();
}
searchField.selectAll();
}

private void clearSearch(BasePanel currentBasePanel) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ private static Map<String, String> serializeMetaData(Map<String, List<String>> s
StringBuilder stringBuilder = new StringBuilder();
for (String dataItem : metaItem.getValue()) {
stringBuilder.append(StringUtil.quote(dataItem, MetaData.SEPARATOR_STRING, MetaData.ESCAPE_CHARACTER)).append(MetaData.SEPARATOR_STRING);

//in case of save actions, add an additional newline after the enabled flag
if (metaItem.getKey().equals(MetaData.SAVE_ACTIONS)
&& (FieldFormatterCleanups.ENABLED.equals(dataItem)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,21 @@
import com.google.common.base.Strings;

/**
* This class includes sensible defaults for consistent formatting of BibTex page numbers.
* This class includes sensible defaults for consistent formatting of BibTeX page numbers.
*
* From BibTex manual:
* From BibTeX manual:
* One or more page numbers or range of numbers, such as 42--111 or 7,41,73--97 or 43+
* (the '+' in this last example indicates pages following that don't form a simple range).
* To make it easier to maintain Scribe-compatible databases, the standard styles convert
* a single dash (as in 7-33) to the double dash used in TEX to denote number ranges (as in 7--33).
*/
public class NormalizePagesFormatter implements Formatter {

private static final Pattern PAGES_DETECT_PATTERN = Pattern.compile("\\A(\\d+)(?:-{1,2}(\\d+))?\\Z");
// "startpage" and "endpage" are named groups. See http://stackoverflow.com/a/415635/873282 for a documentation
private static final Pattern PAGES_DETECT_PATTERN = Pattern.compile("\\A(?<startpage>(\\d+:)?\\d+)(?:-{1,2}(?<endpage>(\\d+:)?\\d+))?\\Z");

private static final String REJECT_LITERALS = "[^a-zA-Z0-9,\\-\\+,]";
private static final String PAGES_REPLACE_PATTERN = "$1--$2";
private static final String REJECT_LITERALS = "[^a-zA-Z0-9,\\-\\+,:]";
private static final String PAGES_REPLACE_PATTERN = "${startpage}--${endpage}";
private static final String SINGLE_PAGE_REPLACE_PATTERN = "$1";


Expand Down Expand Up @@ -66,9 +67,9 @@ public String format(String value) {
cleanValue = cleanValue.replaceAll("\u2013|\u2014", "-").replaceAll(REJECT_LITERALS, "");
// try to find pages pattern
Matcher matcher = PAGES_DETECT_PATTERN.matcher(cleanValue);
if(matcher.matches()) {
if (matcher.matches()) {
// replace
if(Strings.isNullOrEmpty(matcher.group(2))) {
if (Strings.isNullOrEmpty(matcher.group("endpage"))) {
return matcher.replaceFirst(SINGLE_PAGE_REPLACE_PATTERN);
} else {
return matcher.replaceFirst(PAGES_REPLACE_PATTERN);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,9 @@ private Optional<ArXivEntry> searchForEntry(String searchQuery) throws FetcherEx
}

private Optional<ArXivEntry> searchForEntryById(String identifier) throws FetcherException {
identifier = identifier.replaceAll("(?i)arxiv:", "");
List<ArXivEntry> entries = queryApi("", Collections.singletonList(identifier), 0, 1);
if (entries.size() == 1) {
if (entries.size() >= 1) {
return Optional.of(entries.get(0));
} else {
return Optional.empty();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*/
public class DBLPFetcher implements SearchBasedParserFetcher {

private static final String BASIC_SEARCH_URL = "http://www.dblp.org/search/api/";
private static final String BASIC_SEARCH_URL = "http://dblp.org/search/publ/api";

private final ImportFormatPreferences importFormatPreferences;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import net.sf.jabref.model.metadata.ContentSelectors;
import net.sf.jabref.model.metadata.MetaData;
import net.sf.jabref.model.metadata.SaveOrderConfig;
import net.sf.jabref.model.strings.StringUtil;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
Expand Down Expand Up @@ -53,7 +54,7 @@ public static MetaData parse(MetaData metaData, Map<String, String> data, Charac
metaData.setUserFileDirectory(user, getSingleItem(value));
continue;
} else if(entry.getKey().startsWith(MetaData.SELECTOR_META_PREFIX)){
metaData.addContentSelector(ContentSelectors.parse(entry.getKey().substring(MetaData.SELECTOR_META_PREFIX.length()), entry.getValue()));
metaData.addContentSelector(ContentSelectors.parse(entry.getKey().substring(MetaData.SELECTOR_META_PREFIX.length()), StringUtil.unquote(entry.getValue(), MetaData.ESCAPE_CHARACTER)));
continue;
}

Expand Down
12 changes: 6 additions & 6 deletions src/main/resources/l10n/Menu_ru.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!
#! created/edited by Popeye version 0.55 (github.com/JabRef/popeye)
#! created/edited by wuw (30/12/16)
#! encoding:UTF-8

Abbreviate_journal_names_(ISO)=Сокращения_названий_журналов_(ISO)
Expand Down Expand Up @@ -105,7 +105,7 @@ Decrease_table_font_size=Уменьшить_шрифт_в_таблице
Forward=Вперед
Back=Назад

Look_up_full_text_documents=
Look_up_full_text_documents=Поиск_цитируемых_документов
Set/clear/rename_fields=Задать/очистить/переименовать_поля

Resolve_duplicate_BibTeX_keys=Разрешение_дубликатов_ключей_BibTeX
Expand All @@ -119,7 +119,7 @@ Find_unlinked_files...=Найти_несвязанные_файлы...
Hide/show_toolbar=Показать/скрыть_панель_инструментов

Fork_me_on_GitHub=Моя_ветка_на_GitHub
Save_selected_as_plain_BibTeX...=Сохранить_выбранное_как_неформатированный_BibTeX_...
Save_selected_as_plain_BibTeX...=Сохранить_выбранное_как_неформатированный_BibTeX...

Groups=Группы
Delete_entry=Удалить_запись
Expand All @@ -133,7 +133,7 @@ Blog=Блог
JabRef_resources=Ресурсы_JabRef
Development_version=Версия_для_разработчиков
View_change_log=Просмотр_журнала_изменений
Copy_BibTeX_key_and_link=
Copy_DOI_url=
Copy_BibTeX_key_and_link=Копировать_ключ_BibTeX_и_ссылку
Copy_DOI_url=Копировать_URL-адрес_DOI

Copy_citation=
Copy_citation=Копировать_цитату
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package net.sf.jabref.logic.exporter;

import java.io.IOException;
import java.io.StringReader;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.nio.file.Path;
Expand Down Expand Up @@ -560,4 +562,20 @@ public void writeEntriesInOriginalOrderWhenNoSaveOrderConfigIsSetInMetadata() th
, session.getStringValue());
}

@Test
public void roundtripWithContentSelectorsAndUmlauts() throws IOException, SaveException {
String fileContent = "% Encoding: UTF-8" + OS.NEWLINE + OS.NEWLINE + "@Comment{jabref-meta: selector_journal:Test {\\\\\"U}mlaut;}" + OS.NEWLINE;
Charset encoding = StandardCharsets.UTF_8;

ParserResult firstParse = new BibtexParser(importFormatPreferences).parse(new StringReader(fileContent));

SavePreferences preferences = new SavePreferences().withEncoding(encoding).withSaveInOriginalOrder(true);
BibDatabaseContext context = new BibDatabaseContext(firstParse.getDatabase(), firstParse.getMetaData(),
new Defaults(BibDatabaseMode.BIBTEX));

StringSaveSession session = databaseWriter.savePartOfDatabase(context, firstParse.getDatabase().getEntries(), preferences);

assertEquals(fileContent, session.getStringValue());
}

}
Loading

0 comments on commit a64dd54

Please sign in to comment.