[jabref] 03/11: freshen patches for upstream 3.8

Tony Mancill tmancill at moszumanska.debian.org
Sun Dec 11 06:39:03 UTC 2016


This is an automated email from the git hooks/post-receive script.

tmancill pushed a commit to branch dev
in repository jabref.

commit d999a13ee96fade31ccf1d839581a8c3cedefe8c
Author: tony mancill <tmancill at debian.org>
Date:   Fri Dec 9 21:21:06 2016 -0800

    freshen patches for upstream 3.8
    
    Drop these patches which were applied upstream:
    
    - 060_disable_java-diff-utils.patch
    - 080_fix_medline_fetcher.patch
    - 090_fix_medline_NPE.patch
---
 debian/patches/010_gradle_build.patch              |  40 ++-
 .../020_disable_automatic_upgrade_check.patch      |   6 +-
 debian/patches/040_disable_macadapter.patch        |  15 +-
 debian/patches/050_unirest_json.patch              |  80 +++---
 debian/patches/060_disable_java-diff-utils.patch   | 286 ---------------------
 debian/patches/070_remove_lookup_DOI.patch         |   9 +-
 debian/patches/080_fix_medline_fetcher.patch       |  32 ---
 debian/patches/090_fix_medline_NPE.patch           |  21 --
 debian/patches/series                              |   3 -
 9 files changed, 67 insertions(+), 425 deletions(-)

diff --git a/debian/patches/010_gradle_build.patch b/debian/patches/010_gradle_build.patch
index 73ac6c5..c107adb 100644
--- a/debian/patches/010_gradle_build.patch
+++ b/debian/patches/010_gradle_build.patch
@@ -4,16 +4,17 @@ Forwarded: not-needed
 
 --- a/build.gradle
 +++ b/build.gradle
-@@ -1,5 +1,6 @@
- import org.gradle.internal.os.OperatingSystem
+@@ -2,6 +2,7 @@
+ 
+ // to update the gradle wrapper, execute ./gradlew wrapper --gradle-version 3.0
  
 +/*
  buildscript {
      repositories {
          maven {
-@@ -20,9 +21,11 @@
-     id "net.ltgt.errorprone" version "0.0.8"
-     id 'me.champeau.gradle.jmh' version '0.3.0'
+@@ -27,9 +28,11 @@
+     licenseAgreementUrl = 'https://gradle.com/terms-of-service'
+     licenseAgree = 'yes'
  }
 +*/
  
@@ -23,7 +24,7 @@ Forwarded: not-needed
  apply plugin: "project-report"
  apply plugin: 'jacoco'
  apply plugin: 'install4j'
-@@ -31,29 +34,34 @@
+@@ -38,17 +41,20 @@
  apply plugin: 'checkstyle'
  
  apply from: 'eclipse.gradle'
@@ -34,8 +35,8 @@ Forwarded: not-needed
  apply from: 'xjc.gradle'
  
  group = "net.sf.jabref"
- version = "3.6"
- project.ext.threeDotVersion = "3.6.0.0"
+ version = "3.8-dev"
+ project.ext.threeDotVersion = "3.7.0.1"
 -project.ext.install4jDir = hasProperty("install4jDir") ? getProperty("install4jDir") : (OperatingSystem.current().isWindows() ? 'C:/Program Files/install4j6' : 'install4j6')
 +//project.ext.install4jDir = hasProperty("install4jDir") ? getProperty("install4jDir") : (OperatingSystem.current().isWindows() ? 'C:/Program Files/install4j6' : 'install4j6')
  sourceCompatibility = 1.8
@@ -46,22 +47,15 @@ Forwarded: not-needed
  install4j {
      installDir = file(project.ext.install4jDir)
  }
-+*/
- 
- task wrapper(type: Wrapper) {
-     gradleVersion = '2.14.1'
- }
- 
--
-+/*
- repositories {
-     jcenter()
+@@ -60,6 +66,7 @@
+         url 'https://oss.sonatype.org/content/groups/public'
+     }
  }
 +*/
  
  configurations {
      antlr3
-@@ -67,6 +75,8 @@
+@@ -67,6 +74,8 @@
  }
  
  dependencies {
@@ -70,7 +64,7 @@ Forwarded: not-needed
      compile 'com.jgoodies:jgoodies-common:1.8.1'
      compile 'com.jgoodies:jgoodies-forms:1.9.0'
      compile 'com.jgoodies:jgoodies-looks:2.7.0'
-@@ -247,11 +257,12 @@
+@@ -255,11 +264,12 @@
  
  tasks.withType(Test) {
      reports.html.destination = file("${reporting.baseDir}/${name}")
@@ -86,7 +80,7 @@ Forwarded: not-needed
  jacocoTestReport {
      reports {
          xml.enabled = true // coveralls plugin depends on xml format report
-@@ -296,6 +307,7 @@
+@@ -297,6 +307,7 @@
          }
      })
  }
@@ -94,7 +88,7 @@ Forwarded: not-needed
  
  /*
   * Changes project.version to VERSION--snapshot--DATE--GIT_HASH
-@@ -330,6 +342,7 @@
+@@ -331,6 +342,7 @@
      project.version += "--snapshot--" + infoString
  }
  
@@ -102,7 +96,7 @@ Forwarded: not-needed
  // has to be defined AFTER 'dev' things to have the correct project.version
  task media(type: com.install4j.gradle.Install4jTask, dependsOn: "releaseJar") {
      projectFile = file('jabref.install4j')
-@@ -391,3 +404,4 @@
+@@ -383,3 +395,4 @@
      iterations = 10
      fork = 2
  }
diff --git a/debian/patches/020_disable_automatic_upgrade_check.patch b/debian/patches/020_disable_automatic_upgrade_check.patch
index b470842..75e2184 100644
--- a/debian/patches/020_disable_automatic_upgrade_check.patch
+++ b/debian/patches/020_disable_automatic_upgrade_check.patch
@@ -2,12 +2,10 @@ Description: disable automatic phone-home version check
 Author: tony mancill <tmancill at debian.org>
 Forwarded: not-needed
 
-diff --git a/src/main/java/net/sf/jabref/JabRefGUI.java b/src/main/java/net/sf/jabref/JabRefGUI.java
-index efec40a..fb43ff1 100644
 --- a/src/main/java/net/sf/jabref/JabRefGUI.java
 +++ b/src/main/java/net/sf/jabref/JabRefGUI.java
-@@ -63,7 +63,8 @@ public class JabRefGUI {
-         }
+@@ -61,7 +61,8 @@
+                 .orElse(Globals.prefs.get(JabRefPreferences.LAST_FOCUSED));
  
          openWindow();
 -        JabRefGUI.checkForNewVersion(false);
diff --git a/debian/patches/040_disable_macadapter.patch b/debian/patches/040_disable_macadapter.patch
index 6a1bc11..a15100c 100644
--- a/debian/patches/040_disable_macadapter.patch
+++ b/debian/patches/040_disable_macadapter.patch
@@ -4,15 +4,14 @@ Forwarded: not-needed
 
 --- a/src/main/java/osx/macadapter/MacAdapter.java
 +++ b/src/main/java/osx/macadapter/MacAdapter.java
-@@ -14,6 +14,7 @@
-     51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
- 
+@@ -1,5 +1,5 @@
+ package osx.macadapter;
+-
 +/*
  import java.io.File;
  import java.util.List;
  
-@@ -32,7 +33,10 @@
+@@ -18,7 +18,10 @@
  import com.apple.eawt.PreferencesHandler;
  import com.apple.eawt.QuitHandler;
  import com.apple.eawt.QuitResponse;
@@ -23,7 +22,7 @@ Forwarded: not-needed
  public class MacAdapter implements PreferencesHandler, AboutHandler, QuitHandler, OpenFilesHandler, AppReOpenedListener {
  
      private JabRefFrame parentFrame;
-@@ -96,4 +100,5 @@
+@@ -82,4 +85,5 @@
      public void appReOpened(AppEvent.AppReOpenedEvent appReOpenedEvent) {
          parentFrame.setVisible(true);
      }
@@ -31,7 +30,7 @@ Forwarded: not-needed
  }
 --- a/src/main/java/net/sf/jabref/gui/JabRefFrame.java
 +++ b/src/main/java/net/sf/jabref/gui/JabRefFrame.java
-@@ -654,6 +654,8 @@
+@@ -663,6 +663,8 @@
          //Note: The registration of Apple event is at the end of initialization, because
          //if the events happen too early (ie when the window is not initialized yet), the
          //opened (double-clicked) documents are not displayed.
@@ -40,7 +39,7 @@ Forwarded: not-needed
          if (OS.OS_X) {
              try {
                  new MacAdapter().registerMacEvents(this);
-@@ -661,6 +663,7 @@
+@@ -670,6 +672,7 @@
                  LOGGER.fatal("Could not interface with Mac OS X methods.", e);
              }
          }
diff --git a/debian/patches/050_unirest_json.patch b/debian/patches/050_unirest_json.patch
index ba6d300..3eed83c 100644
--- a/debian/patches/050_unirest_json.patch
+++ b/debian/patches/050_unirest_json.patch
@@ -4,42 +4,40 @@ Forwarded: not-needed
 
 --- a/src/main/java/net/sf/jabref/gui/worker/VersionWorker.java
 +++ b/src/main/java/net/sf/jabref/gui/worker/VersionWorker.java
-@@ -14,6 +14,7 @@
+@@ -17,6 +17,7 @@
  
  import org.apache.commons.logging.Log;
  import org.apache.commons.logging.LogFactory;
 +import org.json.JSONException;
  
- public class VersionWorker extends SwingWorker<Version, Void> {
  
-@@ -35,8 +36,8 @@
-     protected Version doInBackground() throws Exception {
+ /**
+@@ -53,7 +54,7 @@
+     protected List<Version> doInBackground() throws Exception {
          try {
-             return Version.getLatestVersion();
+             return Version.getAllAvailableVersions();
 -        } catch (IOException ioException) {
--            LOGGER.warn("Could not connect to the updateserver.", ioException);
-+        } catch (IOException | JSONException e) {
-+            LOGGER.warn("Could not connect to the updateserver.", e);
-             return null;
++        } catch (IOException | JSONException ioException) {
+             LOGGER.warn("Could not connect to the updateserver.", ioException);
+             return Collections.emptyList();
          }
-     }
 --- a/src/main/java/net/sf/jabref/logic/util/Version.java
 +++ b/src/main/java/net/sf/jabref/logic/util/Version.java
-@@ -11,6 +11,7 @@
- import org.apache.commons.logging.Log;
+@@ -16,6 +16,7 @@
  import org.apache.commons.logging.LogFactory;
+ import org.json.JSONArray;
  import org.json.JSONObject;
 +import org.json.JSONException;
  
  /**
   * Represents the Application Version with the major and minor number, the full Version String and if it's a developer version
-@@ -52,7 +53,7 @@
-     /**
-      * Grabs the latest release version from the JabRef GitHub repository
+@@ -87,7 +88,7 @@
+      *
+      * @throws IOException
       */
--    public static Version getLatestVersion() throws IOException {
-+    public static Version getLatestVersion() throws IOException, JSONException {
-         URLConnection connection = new URL(JABREF_GITHUB_URL).openConnection();
+-    public static List<Version> getAllAvailableVersions() throws IOException {
++    public static List<Version> getAllAvailableVersions() throws IOException, JSONException {
+         URLConnection connection = new URL(JABREF_GITHUB_RELEASES).openConnection();
          connection.setRequestProperty("Accept-Charset", "UTF-8");
          BufferedReader rd = new BufferedReader(new InputStreamReader(connection.getInputStream()));
 --- a/src/main/java/net/sf/jabref/logic/importer/fetcher/SpringerLink.java
@@ -74,7 +72,7 @@ Forwarded: not-needed
          return doi;
 --- a/src/main/java/net/sf/jabref/logic/importer/util/JSONEntryParser.java
 +++ b/src/main/java/net/sf/jabref/logic/importer/util/JSONEntryParser.java
-@@ -11,6 +11,7 @@
+@@ -10,6 +10,7 @@
  import org.apache.commons.logging.Log;
  import org.apache.commons.logging.LogFactory;
  import org.json.JSONArray;
@@ -82,7 +80,7 @@ Forwarded: not-needed
  import org.json.JSONObject;
  
  public class JSONEntryParser {
-@@ -30,11 +31,13 @@
+@@ -29,11 +30,13 @@
          // Fields that are accessible in the journal part of the BibJson object
          String[] journalSingleFieldStrings = {FieldName.PUBLISHER, FieldName.NUMBER, FieldName.VOLUME};
  
@@ -98,7 +96,7 @@ Forwarded: not-needed
          // Authors
          if (bibJsonEntry.has("author")) {
              JSONArray authors = bibJsonEntry.getJSONArray("author");
-@@ -127,6 +130,10 @@
+@@ -124,6 +127,10 @@
              }
          }
  
@@ -109,7 +107,7 @@ Forwarded: not-needed
          return entry;
      }
  
-@@ -144,6 +151,10 @@
+@@ -141,6 +148,10 @@
          BibEntry entry = new BibEntry();
          String nametype;
  
@@ -120,7 +118,7 @@ Forwarded: not-needed
          // Guess publication type
          String isbn = springerJsonEntry.optString("isbn");
          if (com.google.common.base.Strings.isNullOrEmpty(isbn)) {
-@@ -224,6 +235,10 @@
+@@ -221,6 +232,10 @@
              }
          });
  
@@ -133,7 +131,7 @@ Forwarded: not-needed
  }
 --- a/src/main/java/net/sf/jabref/gui/importer/fetcher/IEEEXploreFetcher.java
 +++ b/src/main/java/net/sf/jabref/gui/importer/fetcher/IEEEXploreFetcher.java
-@@ -210,6 +210,10 @@
+@@ -196,6 +196,10 @@
          StringBuilder bibtexQueryURLStringBuf = new StringBuilder();
          bibtexQueryURLStringBuf.append(URL_BIBTEX_START);
  
@@ -144,7 +142,7 @@ Forwarded: not-needed
          //loop over each record and create a comma-separate list of article numbers which will be used to download the raw Bibtex
          JSONArray recordsJsonArray = searchResultsJson.getJSONArray("records");
          for (int n = 0; n < recordsJsonArray.length(); n++) {
-@@ -229,6 +233,10 @@
+@@ -215,6 +219,10 @@
              bibtexQueryURLStringBuf.append("&citations-format=citation-only");
          }
  
@@ -157,23 +155,23 @@ Forwarded: not-needed
  
 --- a/src/main/java/net/sf/jabref/gui/importer/fetcher/SpringerFetcher.java
 +++ b/src/main/java/net/sf/jabref/gui/importer/fetcher/SpringerFetcher.java
-@@ -20,6 +20,7 @@
-     import org.apache.commons.logging.Log;
-     import org.apache.commons.logging.LogFactory;
-     import org.json.JSONArray;
-+    import org.json.JSONException;
-     import org.json.JSONObject;
+@@ -22,6 +22,7 @@
+ import org.apache.commons.logging.LogFactory;
+ import org.json.JSONArray;
+ import org.json.JSONObject;
++import org.json.JSONException;
  
  public class SpringerFetcher implements EntryFetcher {
-@@ -102,7 +103,7 @@
+ 
+@@ -97,7 +98,7 @@
                          Localization.lang("Search %0", getTitle()), JOptionPane.INFORMATION_MESSAGE);
                  return false;
              }
--        } catch (UnirestException e) {
-+        } catch (UnirestException | JSONException e) {
-             LOGGER.warn("Problem searching Springer", e);
-         } catch (UnsupportedEncodingException e) {
-             LOGGER.warn("Cannot encode query", e);
+-        } catch (IOException | UnirestException e) {
++        } catch (IOException | UnirestException | JSONException e) {
+             LOGGER.error("Error while fetching from " + getTitle(), e);
+             ((ImportInspectionDialog)inspector).showErrorMessage(this.getTitle(), e.getLocalizedMessage());
+         }
 --- a/src/main/java/net/sf/jabref/gui/importer/fetcher/DOAJFetcher.java
 +++ b/src/main/java/net/sf/jabref/gui/importer/fetcher/DOAJFetcher.java
 @@ -19,6 +19,7 @@
@@ -184,12 +182,12 @@ Forwarded: not-needed
  import org.json.JSONObject;
  
  public class DOAJFetcher implements EntryFetcher {
-@@ -99,7 +100,7 @@
-                         Localization.lang("Search %0", "DOAJ"), JOptionPane.INFORMATION_MESSAGE);
+@@ -93,7 +94,7 @@
+                         Localization.lang("Search %0", getTitle()), JOptionPane.INFORMATION_MESSAGE);
                  return false;
              }
 -        } catch (UnirestException e) {
 +        } catch (UnirestException | JSONException e) {
-             LOGGER.warn("Problem searching DOAJ", e);
-             status.setStatus(Localization.lang("%0 import canceled", "DOAJ"));
+             LOGGER.error("Error while fetching from " + getTitle(), e);
+             ((ImportInspectionDialog)inspector).showErrorMessage(this.getTitle(), e.getLocalizedMessage());
              return false;
diff --git a/debian/patches/060_disable_java-diff-utils.patch b/debian/patches/060_disable_java-diff-utils.patch
deleted file mode 100644
index 440441f..0000000
--- a/debian/patches/060_disable_java-diff-utils.patch
+++ /dev/null
@@ -1,286 +0,0 @@
-From 52e4b22224e3da8d3adf90b180d4cd7711887e63 Mon Sep 17 00:00:00 2001
-From: Oliver Kopp <kopp.dev at gmail.com>
-Date: Sun, 4 Dec 2016 11:26:17 +0100
-Subject: [PATCH] Remove dependency on java-diff-utils
-Comment: Edited patch originally found here:
- https://github.com/koppor/jabref/commit/52e4b22224e3da8d3adf90b180d4cd7711887e63.patch
-
----
- build.gradle                                       |   2 -
- .../sf/jabref/gui/mergeentries/MergeEntries.java   |  32 +------
- .../logic/util/strings/DiffHighlighting.java       | 101 ---------------------
- .../logic/util/strings/DiffHighlightingTest.java   |  81 -----------------
- 4 files changed, 5 insertions(+), 211 deletions(-)
- delete mode 100644 src/main/java/net/sf/jabref/logic/util/strings/DiffHighlighting.java
- delete mode 100644 src/test/java/net/sf/jabref/logic/util/strings/DiffHighlightingTest.java
-
---- a/build.gradle
-+++ b/build.gradle
-@@ -98,8 +98,6 @@
-     compile 'org.openoffice:ridl:4.1.2'
-     compile 'org.openoffice:unoil:4.1.2'
- 
--    compile 'com.googlecode.java-diff-utils:diffutils:1.3.0'
--
-     antlr3 'org.antlr:antlr:3.5.2'
-     compile 'org.antlr:antlr-runtime:3.5.2'
- 
---- a/src/main/java/net/sf/jabref/gui/mergeentries/MergeEntries.java
-+++ b/src/main/java/net/sf/jabref/gui/mergeentries/MergeEntries.java
-@@ -34,7 +34,6 @@
- import net.sf.jabref.logic.bibtex.LatexFieldFormatterPreferences;
- import net.sf.jabref.logic.formatter.casechanger.SentenceCaseFormatter;
- import net.sf.jabref.logic.l10n.Localization;
--import net.sf.jabref.logic.util.strings.DiffHighlighting;
- import net.sf.jabref.model.database.BibDatabaseMode;
- import net.sf.jabref.model.entry.BibEntry;
- import net.sf.jabref.model.entry.InternalBibtexFields;
-@@ -272,7 +271,7 @@
-         mergePanel.add(boldFontLabel(Localization.lang("Entry type")), CELL_CONSTRAINTS.xy(1, 1));
- 
-         JTextPane leftTypeDisplay = new DiffHighlightingTextPane();
--        leftTypeDisplay.setText(DiffHighlighting.HTML_START + leftEntry.getType() + DiffHighlighting.HTML_END);
-+        leftTypeDisplay.setText(leftEntry.getType());
-         mergePanel.add(leftTypeDisplay, CELL_CONSTRAINTS.xy(3, 1));
-         if (leftEntry.getType().equals(rightEntry.getType())) {
-             identicalTypes = true;
-@@ -290,13 +289,14 @@
-             typeRadioButtons.get(0).setSelected(true);
-         }
-         JTextPane rightTypeDisplay = new DiffHighlightingTextPane();
--        rightTypeDisplay.setText(DiffHighlighting.HTML_START + rightEntry.getType() + DiffHighlighting.HTML_END);
-+        rightTypeDisplay.setText(rightEntry.getType());
-         mergePanel.add(rightTypeDisplay, CELL_CONSTRAINTS.xy(11, 1));
-     }
- 
-     private void setupHeadingRows() {
-         mainPanel.add(boldFontLabel(Localization.lang("Use")), CELL_CONSTRAINTS.xyw(4, 1, 7, "center, bottom"));
-         mainPanel.add(diffMode, CELL_CONSTRAINTS.xy(11, 1, "right, bottom"));
-+        diffMode.setVisible(false);
- 
-         // Set headings
-         for (int i = 0; i < 6; i++) {
-@@ -362,33 +362,11 @@
-         for (String field : fields) {
-             String leftString = leftEntry.getFieldOptional(field).orElse("");
-             String rightString = rightEntry.getFieldOptional(field).orElse("");
--            switch (diffMode.getSelectedIndex()) {
--            case 0: // Plain text
--                break;
--            case 1: // Latexdiff style - word
--                rightString = DiffHighlighting.generateDiffHighlighting(leftString, rightString, " ");
--                break;
--            case 2: // Latexdiff style - character
--                rightString = DiffHighlighting.generateDiffHighlighting(leftString, rightString, "");
--                break;
--            case 3: // Symmetric style - word
--                String tmpLeftString = DiffHighlighting.generateSymmetricHighlighting(leftString, rightString, " ");
--                rightString = DiffHighlighting.generateSymmetricHighlighting(rightString, leftString, " ");
--                leftString = tmpLeftString;
--                break;
--            case 4: // Symmetric style - character
--                tmpLeftString = DiffHighlighting.generateSymmetricHighlighting(leftString, rightString, "");
--                rightString = DiffHighlighting.generateSymmetricHighlighting(rightString, leftString, "");
--                leftString = tmpLeftString;
--                break;
--            default: // Shouldn't happen
--                break;
--            }
-             if ((leftString != null) && leftTextPanes.containsKey(field)) {
--                leftTextPanes.get(field).setText(DiffHighlighting.HTML_START + leftString + DiffHighlighting.HTML_END);
-+                leftTextPanes.get(field).setText(leftString);
-             }
-             if ((rightString != null) && rightTextPanes.containsKey(field)) {
--                rightTextPanes.get(field).setText(DiffHighlighting.HTML_START + rightString + DiffHighlighting.HTML_END);
-+                rightTextPanes.get(field).setText(rightString);
-             }
-         }
-         SwingUtilities.invokeLater(() -> scrollPane.getVerticalScrollBar()
---- a/src/main/java/net/sf/jabref/logic/util/strings/DiffHighlighting.java
-+++ b/src/main/java/net/sf/jabref/logic/util/strings/DiffHighlighting.java
-@@ -1,101 +0,0 @@
--package net.sf.jabref.logic.util.strings;
--
--import java.util.ArrayList;
--import java.util.Arrays;
--import java.util.Collections;
--import java.util.List;
--import java.util.Objects;
--
--import difflib.Delta;
--import difflib.DiffUtils;
--
--public class DiffHighlighting {
--
--    private static final String ADDITION_START = "<span class=add>";
--    private static final String REMOVAL_START = "<span class=del>";
--    private static final String CHANGE_START = "<span class=change>";
--    private static final String TAG_END = "</span>";
--
--    public static final String HTML_START = "<html><body>";
--    public static final String HTML_END = "</body></html>";
--
--
--    public static String generateDiffHighlighting(String baseString, String modifiedString, String separator) {
--        Objects.requireNonNull(separator);
--        if ((baseString != null) && (modifiedString != null)) {
--            List<String> stringList = new ArrayList<>(Arrays.asList(baseString.split(separator)));
--            List<Delta<String>> deltaList = new ArrayList<>(
--                    DiffUtils.diff(stringList, Arrays.asList(modifiedString.split(separator))).getDeltas());
--            Collections.reverse(deltaList);
--            for (Delta<String> delta : deltaList) {
--                int startPos = delta.getOriginal().getPosition();
--                List<String> lines = delta.getOriginal().getLines();
--                int offset = 0;
--                switch (delta.getType()) {
--                case CHANGE:
--                    for (String line : lines) {
--                        stringList.set(startPos + offset, (offset == 0 ? DiffHighlighting.REMOVAL_START : "") + line);
--                        offset++;
--                    }
--                    stringList.set((startPos + offset) - 1,
--                            stringList.get((startPos + offset) - 1) + DiffHighlighting.TAG_END + separator + DiffHighlighting.ADDITION_START
--                                    + String.join(separator, delta.getRevised().getLines()) + DiffHighlighting.TAG_END);
--                    break;
--                case DELETE:
--                    for (String line : lines) {
--                        stringList.set(startPos + offset, (offset == 0 ? DiffHighlighting.REMOVAL_START : "") + line);
--                        offset++;
--                    }
--                    stringList.set((startPos + offset) - 1,
--                            stringList.get((startPos + offset) - 1) + DiffHighlighting.TAG_END);
--                    break;
--                case INSERT:
--                    stringList.add(delta.getOriginal().getPosition(),
--                            DiffHighlighting.ADDITION_START + String.join(separator, delta.getRevised().getLines()) + DiffHighlighting.TAG_END);
--                    break;
--                default:
--                    break;
--                }
--            }
--            return String.join(separator, stringList);
--        }
--        return modifiedString;
--    }
--
--    public static String generateSymmetricHighlighting(String baseString, String modifiedString, String separator) {
--        if ((baseString != null) && (modifiedString != null)) {
--            List<String> stringList = new ArrayList<>(Arrays.asList(baseString.split(separator)));
--            List<Delta<String>> deltaList = new ArrayList<>(DiffUtils
--                    .diff(stringList, new ArrayList<>(Arrays.asList(modifiedString.split(separator)))).getDeltas());
--            Collections.reverse(deltaList);
--            for (Delta<String> delta : deltaList) {
--                int startPos = delta.getOriginal().getPosition();
--                List<String> lines = delta.getOriginal().getLines();
--                int offset = 0;
--                switch (delta.getType()) {
--                case CHANGE:
--                    for (String line : lines) {
--                        stringList.set(startPos + offset, (offset == 0 ? DiffHighlighting.CHANGE_START : "") + line);
--                        offset++;
--                    }
--                    stringList.set((startPos + offset) - 1, stringList.get((startPos + offset) - 1) + DiffHighlighting.TAG_END);
--                    break;
--                case DELETE:
--                    for (String line : lines) {
--                        stringList.set(startPos + offset, (offset == 0 ? DiffHighlighting.ADDITION_START : "") + line);
--                        offset++;
--                    }
--                    stringList.set((startPos + offset) - 1, stringList.get((startPos + offset) - 1) + DiffHighlighting.TAG_END);
--                    break;
--                case INSERT:
--                    break;
--                default:
--                    break;
--                }
--            }
--            return String.join(separator, stringList);
--        }
--        return modifiedString;
--    }
--
--}
---- a/src/test/java/net/sf/jabref/logic/util/strings/DiffHighlightingTest.java
-+++ b/src/test/java/net/sf/jabref/logic/util/strings/DiffHighlightingTest.java
-@@ -1,81 +0,0 @@
--package net.sf.jabref.logic.util.strings;
--
--import org.junit.Test;
--
--import static org.junit.Assert.assertEquals;
--import static org.junit.Assert.assertNull;
--
--
--public class DiffHighlightingTest {
--
--    @Test
--    public void testGenerateDiffHighlightingBothNullReturnsNull() {
--        assertNull(DiffHighlighting.generateDiffHighlighting(null, null, ""));
--    }
--
--    @Test(expected = NullPointerException.class)
--    public void testNullSeparatorThrowsNPE() {
--        assertNull(DiffHighlighting.generateDiffHighlighting("", "", null));
--    }
--
--    @Test
--    public void testGenerateDiffHighlightingNoDiff() {
--        assertEquals("foo", DiffHighlighting.generateDiffHighlighting("foo", "foo", ""));
--    }
--
--    @Test
--    public void testGenerateDiffHighlightingSingleWordAddTextWordDiff() {
--        assertEquals("<span class=del>foo</span> <span class=add>foobar</span>",
--                DiffHighlighting.generateDiffHighlighting("foo", "foobar", " "));
--    }
--
--    @Test
--    public void testGenerateDiffHighlightingSingleWordAddTextCharacterDiff() {
--        assertEquals("foo<span class=add>bar</span>", DiffHighlighting.generateDiffHighlighting("foo", "foobar", ""));
--    }
--
--    @Test
--    public void testGenerateDiffHighlightingSingleWordDeleteTextWordDiff() {
--        assertEquals("<span class=del>foobar</span> <span class=add>foo</span>",
--                DiffHighlighting.generateDiffHighlighting("foobar", "foo", " "));
--    }
--
--    @Test
--    public void testGenerateDiffHighlightingSingleWordDeleteTextCharacterDiff() {
--        assertEquals("foo<span class=del>bar</span>", DiffHighlighting.generateDiffHighlighting("foobar", "foo", ""));
--    }
--
--    @Test
--    public void generateSymmetricHighlightingSingleWordAddTextWordDiff() {
--        assertEquals("<span class=change>foo</span>",
--                DiffHighlighting.generateSymmetricHighlighting("foo", "foobar", " "));
--    }
--
--    @Test
--    public void generateSymmetricHighlightingSingleWordAddTextCharacterDiff() {
--        assertEquals("foo", DiffHighlighting.generateSymmetricHighlighting("foo", "foobar", ""));
--    }
--
--    @Test
--    public void generateSymmetricHighlightingSingleWordDeleteTextWordDiff() {
--        assertEquals("<span class=change>foobar</span>",
--                DiffHighlighting.generateSymmetricHighlighting("foobar", "foo", " "));
--    }
--
--    @Test
--    public void generateSymmetricHighlightingSingleWordDeleteTextCharacterDiff() {
--        assertEquals("foo<span class=add>bar</span>", DiffHighlighting.generateSymmetricHighlighting("foobar", "foo", ""));
--    }
--
--    @Test
--    public void generateSymmetricHighlightingMultipleWordsDeleteTextCharacterDiff() {
--        assertEquals("foo<span class=add>bar</span> and <span class=add>some</span>thing",
--                DiffHighlighting.generateSymmetricHighlighting("foobar and something", "foo and thing", ""));
--    }
--
--    @Test
--    public void generateSymmetricHighlightingMultipleWordsDeleteTextWordDiff() {
--        assertEquals("foo <span class=add>bar</span> and <span class=add>some</span> thing",
--                DiffHighlighting.generateSymmetricHighlighting("foo bar and some thing", "foo and thing", " "));
--    }
--}
diff --git a/debian/patches/070_remove_lookup_DOI.patch b/debian/patches/070_remove_lookup_DOI.patch
index 4acc7f4..755288e 100644
--- a/debian/patches/070_remove_lookup_DOI.patch
+++ b/debian/patches/070_remove_lookup_DOI.patch
@@ -8,11 +8,9 @@ Origin: https://github.com/koppor/jabref/commit/ca49873efe2c90453e4fff4e9f690d90
  .../net/sf/jabref/gui/entryeditor/FieldExtraComponents.java   | 11 -----------
  1 file changed, 11 deletions(-)
 
-diff --git a/src/main/java/net/sf/jabref/gui/entryeditor/FieldExtraComponents.java b/src/main/java/net/sf/jabref/gui/entryeditor/FieldExtraComponents.java
-index 9b008ef2b..aac18bb17 100644
 --- a/src/main/java/net/sf/jabref/gui/entryeditor/FieldExtraComponents.java
 +++ b/src/main/java/net/sf/jabref/gui/entryeditor/FieldExtraComponents.java
-@@ -168,16 +168,6 @@ public class FieldExtraComponents {
+@@ -154,16 +154,6 @@
                  panel.output(Localization.lang("Unable to open link."));
              }
          });
@@ -29,7 +27,7 @@ index 9b008ef2b..aac18bb17 100644
          // fetch bibtex data
          JButton fetchButton = new JButton(
                  Localization.lang("Get BibTeX data from %0", FieldName.getDisplayName(FieldName.DOI)));
-@@ -188,7 +178,6 @@ public class FieldExtraComponents {
+@@ -174,7 +164,6 @@
          });
  
          controls.add(button, BorderLayout.NORTH);
@@ -37,6 +35,3 @@ index 9b008ef2b..aac18bb17 100644
          controls.add(fetchButton, BorderLayout.SOUTH);
  
          // enable/disable button
--- 
-2.11.0
-
diff --git a/debian/patches/080_fix_medline_fetcher.patch b/debian/patches/080_fix_medline_fetcher.patch
deleted file mode 100644
index 7355f50..0000000
--- a/debian/patches/080_fix_medline_fetcher.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-Author: Oliver Kopp <kopp.dev at gmail.com>
-Date: Wed, 23 Nov 2016 02:36:25 +0100
-Subject: [PATCH] Fix medline fetcher by using https
-Forwarded: not-needed
-Origin: https://github.com/JabRef/jabref/commit/a3f779a6008df46cc452a26ef8ddfacc21db2c46.patch
-
----
- src/main/java/net/sf/jabref/gui/importer/fetcher/MedlineFetcher.java | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/src/main/java/net/sf/jabref/gui/importer/fetcher/MedlineFetcher.java b/src/main/java/net/sf/jabref/gui/importer/fetcher/MedlineFetcher.java
-index c0da745..929ee18 100644
---- a/src/main/java/net/sf/jabref/gui/importer/fetcher/MedlineFetcher.java
-+++ b/src/main/java/net/sf/jabref/gui/importer/fetcher/MedlineFetcher.java
-@@ -66,7 +66,7 @@ private static String toSearchTerm(String in) {
-      */
-     private SearchResult getIds(String term, int start, int pacing) {
- 
--        String baseUrl = "http://eutils.ncbi.nlm.nih.gov/entrez/eutils";
-+        String baseUrl = "https://eutils.ncbi.nlm.nih.gov/entrez/eutils";
-         String medlineUrl = baseUrl + "/esearch.fcgi?db=pubmed&retmax=" + Integer.toString(pacing) +
-                 "&retstart=" + Integer.toString(start) + "&term=";
- 
-@@ -218,7 +218,7 @@ public boolean processQuery(String query, ImportInspector iIDialog, OutputPrinte
-      * @return Will return an empty list on error.
-      */
-     private static List<BibEntry> fetchMedline(String id, OutputPrinter status) {
--        String baseUrl = "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=pubmed&retmode=xml&rettype=citation&id=" +
-+        String baseUrl = "https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=pubmed&retmode=xml&rettype=citation&id=" +
-                 id;
-         try {
-             URL url = new URL(baseUrl);
diff --git a/debian/patches/090_fix_medline_NPE.patch b/debian/patches/090_fix_medline_NPE.patch
deleted file mode 100644
index 133f322..0000000
--- a/debian/patches/090_fix_medline_NPE.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-From: Christoph <cschwentker at gmail.com>
-Date: Tue, 4 Oct 2016 19:54:45 +0200
-Subject: [PATCH] Fix NPE in Medline fetcher on missing ISSN (#2113)
-Origin: https://github.com/JabRef/jabref/commit/195a17290a37ad7f75769a0ceecccaca76eba051.patch
-Forwarded: not-needed
-
-diff --git a/src/main/java/net/sf/jabref/logic/importer/fileformat/MedlineImporter.java b/src/main/java/net/sf/jabref/logic/importer/fileformat/MedlineImporter.java
-index 95f21ee..e4557d5 100644
---- a/src/main/java/net/sf/jabref/logic/importer/fileformat/MedlineImporter.java
-+++ b/src/main/java/net/sf/jabref/logic/importer/fileformat/MedlineImporter.java
-@@ -513,7 +513,9 @@ public class MedlineImporter extends ImportFormat {
-                 putIfValueNotNull(fields, FieldName.JOURNAL, journal.getTitle());
- 
-                 ISSN issn = journal.getISSN();
--                putIfValueNotNull(fields, FieldName.ISSN, issn.getContent());
-+                if (issn != null) {
-+                    putIfValueNotNull(fields, FieldName.ISSN, issn.getContent());
-+                }
- 
-                 JournalIssue journalIssue = journal.getJournalIssue();
-                 putIfValueNotNull(fields, FieldName.VOLUME, journalIssue.getVolume());
diff --git a/debian/patches/series b/debian/patches/series
index 9ecb8dd..105772b 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,7 +3,4 @@
 030_xjc.patch
 040_disable_macadapter.patch
 050_unirest_json.patch
-060_disable_java-diff-utils.patch
 070_remove_lookup_DOI.patch
-080_fix_medline_fetcher.patch
-090_fix_medline_NPE.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/jabref.git



More information about the pkg-java-commits mailing list