Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sauliusg fix 2700 null pointer exception on get fulltext (#2751)
* Adding a bunch of debug prints and assert's to find a reason for the 'null pointer exception'. * Removing the 'HERE' debug print. * Removing the rest of my debug prints. * Adding a fix for the [WIP] Clicking 'Get fulltext' triggers a 'null pointer exception' when a databse is opened in a current directory. * Attempting to create a unit test for the new fix, but so far could not re-create the necessary run environment. * Creating a working unit test for the new relative path fix, and adding also three regression tests for the old functionality. * Fixing the order of imports in the newly created test file. * Temporarily commenting out of the new fix, to see if the new tests catch the previous bug. Indeed, the new unit test fails both in Eclipse and in the CLI './gradlew build' run. * Restoring my fix in the 'BibDatabaseContext.java' file, fixing the 'null pointer exception' if a database is passed as a local file without explicite path. The tests in 'BibDatabaseContextTest.java' pass again. * Removing the test line that is not needed for the tests to work in 'BibDatabaseContextTest'. * Adding explicite scope ('private') to 'FileDirectoryPreferences preferences'. * Fixed the coding style according to the JabRef conventions. * Switcing from 'assertTrue' to 'assertEquals' in the BibDatabaseContextTest unit test. * Changing 'assert ...path != null ...' to 'Objects.requireNonNull(...)'. * Commenting variables used in the 'BibDatabaseContextTest' unit test. * Fix paths handling in test and mock fileDirPrefs * Fix modernizer
- Loading branch information