Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backward compatibility for 4.3.1 #6296

Merged
merged 5 commits into from
Apr 26, 2020
Merged

Backward compatibility for 4.3.1 #6296

merged 5 commits into from
Apr 26, 2020

Conversation

calixtus
Copy link
Member

@calixtus calixtus commented Apr 16, 2020

This PR should allow people in the future to return to JabRef 4.3.1 after using 5.0, if they want to keep using an old version without support or development.
Those, who already tried the latest version, can use in windows "JabRef-downgrade-regpatch.reg".

Still got two questions:

  1. How do we include this regpatch in the installer package and
  2. Who can test this. I don't have Java8 and JabRef 4.3.1 installed anymore...

fixes #5933,
fixes #6234,
refs #4579

  • Change in CHANGELOG.md described (if applicable)
  • Tests created for changes (if applicable)
  • Manually tested changed features in running JabRef (always required)
  • Screenshots added in PR description (for UI changes)
  • Checked documentation: Is the information available and up to date? If not created an issue at https://github.com/JabRef/user-documentation/issues or, even better, submitted a pull request to the documentation repository.

@koppor
Copy link
Member

koppor commented Apr 16, 2020

Testing

First my results of testing...

JabRef from this branch and then 4.3.1

  1. Run JabRef from this branch using ./gradlew run

  2. Quit JabRef

  3. Install corretto 4.3.1 jre

    choco install corretto8jre

  4. Start JabRef 4.3.1

    "C:\Program Files\Corretto\jre8\bin\java.exe" -jar "JabRef-4.3.1.jar"

Output:

20:37:37.356 [AWT-EventQueue-0] INFO  org.jabref.gui.maintable.MainTable - Exception while setting column widths. Choosing default.
java.lang.NumberFormatException: For input string: "28.0"
        at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) ~[?:1.8.0_252]

JabRef 5.0, then this JabRef, then 4.3.1

  1. Start JabRef 5.0

  2. Reset JabRef preferences

  3. Fix JAVA_HOME

  4. Run JabRef from this branch using ./gradlew run

  5. Close JabRef

  6. Start JabRef 4.3.1

    File: grouptree.fxml not found, attempting with camel case
    File: grouptree.css not found, attempting with camel case
    #
    # A fatal error has been detected by the Java Runtime Environment:
    #
    #  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0000000066c30754, pid=11032, tid=0x0000000000002b50
    
  7. Extract windows-amd64-1.8.0_172.tar.gz, use https://stackoverflow.com/a/14480193./873282. Rename *.jar.jar to *.jar

  8. C:\TEMP\jre-172\bin\java.exe -jar "JabRef-4.3.1.jar"

  9. Works fine

  10. Close JabRef

  11. C:\TEMP\jre-172\bin\java.exe -jar "JabRef-3.7.jar"

  12. Works fine

  13. Start JabRef 5.0

  14. Rearrange table columns

  15. Quit JabRef

  16. Start JabRef 5.0

  17. Table columns as configured

  18. Quit JabRef

  19. Start JabRef from this branch

  20. Table columns are reset!

  21. Reorder Table columns

  22. Quit JabRef

  23. Start JabRef

  24. Table column order restored

  25. Start JabRef 4.3.1

  26. Strange column headings

grafik

  1. Preferences to not open

    21:06:05.611 [AWT-EventQueue-0] ERROR org.jabref.FallbackExceptionHandler - Uncaught exception occurred in Thread[AWT-EventQueue-0,6,main]
    java.lang.NumberFormatException: For input string: "28.0"
    at java.lang.NumberFormatException.forInputString(Unknown Source) ~[?:1.8.0_172]

@@ -308,6 +312,18 @@ static void upgradePreviewStyleAllowMarkdown(JabRefPreferences prefs) {
prefs.setPreviewStyle(migratedStyle);
}

static void changeColumnVariableNamesFor51(JabRefPreferences preferences) {
// The variable names have to be hardcoded, because they have changed between 5.0 and 5.1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me, it is OK to have local string constants. Externalizing them feels over-engineered.

@calixtus
Copy link
Member Author

Do the test results still apply after the phone call?

@Siedlerchr
Copy link
Member

I think some of the failures with the preferences might be related to font face/font size. I remember that we changed that as well

@calixtus
Copy link
Member Author

@koppor : Something more to test... 😁

@tobiasdiez tobiasdiez added this to the v5.1 milestone Apr 22, 2020
@koppor
Copy link
Member

koppor commented Apr 22, 2020

TLDR: With the patch 7c260f5 works fine.

JabRef 4.3.1 -> JabRef 5.1-dev -> JabRef 4.3.1

  • JVM crash with Coretto, therefore using -172
  • C:\TEMP\jre-172\bin\java.exe -jar "JabRef-4.3.1.jar" -d all
  • Reordered table columns and changed font size
  • gradlew run
  • java.lang.ClassCastException: class java.lang.Integer cannot be cast to class java.lang.String (java.lang.Integer and java.lang.String
    are in module java.base of loader 'bootstrap')
          at org.jabref.preferences.JabRefPreferences.get(JabRefPreferences.java:901) ~[main/:?]
          at org.jabref.migrations.PreferencesMigrations.restoreVariablesForBackwardCompatibility(PreferencesMigrations.java:431)
    
  • Added a patch at 7c260f5.
  • Starts
  • Reordered table columns and changed font size
  • C:\TEMP\jre-172\bin\java.exe -jar "JabRef-4.3.1.jar" -d all
  • Starts fine (does have the font size configured for 4.3.1 not the one of 5.1-dev)
  • Start 5.1
  • Starts fine with large font size

JabRef 5.1-dev -> JabRef 4.3.1 -> JabRef 5.1-dev

  • gradlew run --args="-d dall"
    Error opening file '-d': Could not find a suitable import format.
    
  • Manually reset preferences
  • Close
  • Start JabRef 4.3.1
  • Works
  • Start JabRef 5.0
  • Works
  • Change font size and table column order
  • Start JabRef 5.1
  • Close
  • Start 4.3.1
  • Starts fine

@koppor
Copy link
Member

koppor commented Apr 22, 2020

Good to go from my side. - Cannot add a test for 7c260f5, because mockito does not allow returning an Integer when a String is requested. I cannot mock private final Preferences prefs; inside the preferences. I had to mock that if I wanted to emulate the Integer vs. String thing (the expection happens in

return Optional.ofNullable(prefs.get(key, (String) defaults.get(key)));
)

@calixtus
Copy link
Member Author

Ouch, I ran the test but did not do gradle run. Thanks for fixing that.

@koppor koppor merged commit d7a57b8 into master Apr 26, 2020
@koppor koppor deleted the backward_compat_columns branch April 26, 2020 16:34
Siedlerchr added a commit that referenced this pull request Apr 26, 2020
# By Tobias Diez (10) and others
# Via dimitra-karadima (5) and others
* upstream/master: (62 commits)
  Backward compatibility for 4.3.1 (#6296)
  Fix Export to clipboard Dialog icon (#6345)
  Refactor EntryEditorPreferences (#6245)
  Update label names
  Squashed 'src/main/resources/csl-locales/' changes from d0ee4d13c9..79845b087b
  Squashed 'src/main/resources/csl-styles/' changes from c1793d2..143464e
  Cite work by @ayaankazerouni
  Improve performance for loading files (#6332)
  Add ADR von JUnit vs. AssertJ (#6335)
  'Name' textfield on focus instead of 'OK' button when user clicks on 'Add subgroup' option (#6330)
  Bump jurt from 6.3.2 to 6.4.3 (#6325)
  Bump unoil from 6.3.2 to 6.4.3 (#6320)
  Bump ridl from 6.3.2 to 6.4.3 (#6326)
  Bump classgraph from 4.8.69 to 4.8.71 (#6322)
  Bump flexmark from 0.61.6 to 0.61.16 (#6318)
  Bump richtextfx from 0.10.4 to 0.10.5 (#6319)
  Bump guava from 28.2-jre to 29.0-jre (#6323)
  Bump flexmark-ext-gfm-tasklist from 0.61.6 to 0.61.16 (#6327)
  Bump org.beryx.jlink from 2.17.5 to 2.17.7 (#6324)
  Improve performance massively by fixing a stupid binding mistake (#6316)
  ...

# Conflicts:
#	build.gradle
Siedlerchr added a commit that referenced this pull request Apr 27, 2020
* upstream/master:
  Backward compatibility for 4.3.1 (#6296)
  Fix Export to clipboard Dialog icon (#6345)
  Refactor EntryEditorPreferences (#6245)
Siedlerchr added a commit that referenced this pull request Apr 30, 2020
…ionCaseInsensitive

* upstream/master:
  New Crowdin translations (#6375)
  Squashed 'src/main/resources/csl-styles/' changes from 143464e..906cd6d
  Fixes #6357: File directory (#6377)
  Disable the generate button if the ID field is empty (#6371)
  Fix Preferences style value too long (#6372)
  Fix various Dark theme issues (#6368)
  Correct label name in dependabot
  Bump java-diff-utils from 4.5 to 4.7 (#6365)
  Try with info.plist.template also (#6366)
  Fix wrong button order (Apply and Cancel) in ManageProtectedTermsDialog. (#6358)
  Bump flexmark-ext-gfm-strikethrough from 0.61.6 to 0.61.20 (#6361)
  Bump checkstyle from 8.31 to 8.32 (#6360)
  Bump flexmark-ext-gfm-tasklist from 0.61.16 to 0.61.20 (#6364)
  Bump flexmark from 0.61.16 to 0.61.20 (#6359)
  Bump org.beryx.jlink from 2.17.7 to 2.17.8 (#6362)
  Bump classgraph from 4.8.71 to 4.8.77 (#6363)
  Change blue and red colors in Merge entries dialog in Dark theme (#6356)
  Add Info plist to mac resources (#5986)
  Backward compatibility for 4.3.1 (#6296)
koppor pushed a commit that referenced this pull request Jan 1, 2023
43566f2 Update molecular-oncology.csl (#6354)
38f2b5f Update san-francisco-estuary-and-watershed-science.csl (#6350)
724cb12 Update australasian-journal-of-philosophy.csl (#6344)
df6af86 Fix webpage in-text citation for council-of-science-editors-author-date.csl (#6318)
6900b58 Add month to magazine for Bluebook
e0a8148 Update cambridge-university-press-author-date-cambridge-a.csl (#6345)
0823448 Add space & comma before pp (#6343)
ff38cd2 Update american-journal-of-respiratory-and-critical-care-medicine.csl (#6341)
8727dfb Update early-music-history.csl (#6323)
1154354 Update boletin-de-pediatria.csl (#6310)
f25438e Update pravnik.csl (#6309)
db7a4ae Update zoological-journal-of-the-linnean-society.csl (#6304)
6c043a7 Create polygraphia.csl (#6307)
255e00c Create intellect-newgen-books.csl (#6308)
323629f Update historical-materialism.csl (#6300)
f62b70d Create european-review-of-international-studies.csl (#6301)
dff2698 Update ucl-university-college-harvard.csl (#6298)
0ce09c9 Update sciences-po-ecole-doctorale-note-french.csl (#6290)
bdd53ec Update sciences-po-ecole-doctorale-author-date.csl (#6291)
efde4d4 Create journal-of-law-medicine-ethics.csl (#6296)
7539b2c Create theses-de-sorbonne-universite.csl (#6295)
905f25a Update biochemical-society-transactions.csl (#6292)
a76a3f5 Update smithsonian-institution-scholarly-press author-date and note (#6294)
e6b6c6c Create exploration-of-targeted-anti-tumor-therapy.csl (#6276)
024c9c8 Create nys-nydanske-studier.csl (#6331)
d9ac8e1 Update vox-sanguinis.csl (#6327)
9a98e92 Remove DOI from Genetics & Molecular Biology

git-subtree-dir: buildres/csl/csl-styles
git-subtree-split: 43566f2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants