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

duplicate query parameter removed #5865

Merged
merged 1 commit into from
Jan 25, 2020
Merged

duplicate query parameter removed #5865

merged 1 commit into from
Jan 25, 2020

Conversation

MhhhxX
Copy link
Contributor

@MhhhxX MhhhxX commented Jan 24, 2020

Calling the Springer web search always throws an exception:

java.lang.NullPointerException
	at org.jabref.merged.module/kong.unirest.json.JSONObject.<init>(Unknown Source)
	at org.jabref.merged.module/kong.unirest.json.JSONObject.<init>(Unknown Source)
	at org.jabref/org.jabref.logic.importer.fetcher.SpringerFetcher.lambda$getParser$2(Unknown Source)
	at org.jabref/org.jabref.logic.importer.SearchBasedParserFetcher.performSearch(Unknown Source)
	at org.jabref/org.jabref.gui.importer.fetcher.WebSearchPaneViewModel.lambda$search$1(Unknown Source)
	at org.jabref/org.jabref.gui.util.BackgroundTask$1.call(Unknown Source)
	at org.jabref/org.jabref.gui.util.DefaultTaskExecutor$1.call(Unknown Source)
	at org.jabref.merged.module/javafx.concurrent.Task$TaskCallable.call(Unknown Source)
	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)

In the SpringerFetcher class I saw that the ?q= parameter is added twice to the request url.
Once here

private static final String API_URL = "http://api.springernature.com/meta/v1/json?q=";

and the second time in this line:
uriBuilder.addParameter("q", query); // Search query

This PR removes the duplicate search query parameter from the springer api url.

@Siedlerchr Siedlerchr added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Jan 24, 2020
@Siedlerchr
Copy link
Member

Thanks for your contribution 👍 , fix looks good to me, I will test it locally (as the fetcher tests for srpinger aren't executed on github)

Copy link
Member

@tobiasdiez tobiasdiez left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution and the detail PR description! The change looks good to me.

Copy link
Member

@Siedlerchr Siedlerchr left a comment

Choose a reason for hiding this comment

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

Thanks, tested it and it works fine!

@Siedlerchr Siedlerchr merged commit ac90ad2 into JabRef:master Jan 25, 2020
@MhhhxX
Copy link
Contributor Author

MhhhxX commented Jan 25, 2020

You're welcome :)

Siedlerchr added a commit that referenced this pull request Jan 26, 2020
# By Carl Christian Snethlage (9) and others
# Via Carl Christian Snethlage (5) and GitHub (1)
* upstream/master:
  Fixed Test
  Refactored constructors, PreferencesService and some minor improvements.
  Remove ampersand escape when writing to bib file (#5869)
  Fix #5862. It was indeed the throttler (at least it is working now for me) (#5868)
  duplicate query parameter removed (#5865)
  Minor refactoring, and changed comment
  forgotten l10n resources
  Minor visual adjustments
  Removed description, fixed ok button and added some minor improvements
  Moved GroupDescription-stuff to proper class
  Added hintTextFlow, some rewording and changed the hierarchicalContext RadioButtons to a ComboBox
  Converted GroupDialog to mvvm pattern

# Conflicts:
#	src/main/resources/l10n/JabRef_en.properties
Siedlerchr added a commit that referenced this pull request Jan 30, 2020
* master: (297 commits)
  Replace link to Workspace set-up with new one (#5896)
  Fixes making paths of linked files relative (web urls will not be touched anymore) (#5879)
  Switch to our IntelliJ config (#5881)
  Bump unirest-java from 3.4.00 to 3.4.01 (#5874)
  Bump junit-vintage-engine from 5.5.2 to 5.6.0 (#5875)
  Bump checkstyle from 8.28 to 8.29 (#5876)
  Bump junit-jupiter from 5.5.2 to 5.6.0 (#5877)
  Bump junit-platform-launcher from 1.5.2 to 1.6.0 (#5878)
  Change \ to /
  Bump byte-buddy-parent from 1.10.6 to 1.10.7 (#5873)
  Fix opening pdf with okular in linux (#5253) (#5855)
  Fixed Test
  Refactored constructors, PreferencesService and some minor improvements.
  Remove ampersand escape when writing to bib file (#5869)
  Fix #5862. It was indeed the throttler (at least it is working now for me) (#5868)
  duplicate query parameter removed (#5865)
  New Crowdin translations (#5864)
  Minor refactoring, and changed comment
  Bump antlr4 from 4.7.2 to 4.8-1 (#5852)
  Reintroducing master table index column (#5844)
  ...
koppor pushed a commit that referenced this pull request Mar 1, 2022
8f69d4e Container-title text-case set to title (#5931)
7200616 Create arrbhousestyle.csl (#5674)
8933609 Create hospital-a-domicilio.csl (#5924)
622bf63 Create international-journal-of-cosmetic-science.csl (#5886)
07e179f remove default-locale journal-de-la-societe-des-oceanistes.csl (#5887)
4435d1e update norsk-henvisningsstandard-for-rettsvitenskapelige-tekster.csl (#5892)
18e547f Added fixes for steel-research-international.csl (#5921)
79e53a2 Update springer-basic-brackets-no-et-al.csl (#5925)
e4f411f Update antiquites-africaines.csl (#5923)
f4b3830 Create hemijska-industrija.csl (#5881)
1b33712 Create dhd.csl (#5920)
8462846 Update China national standard GB/T 7714 styles (#5860)
2c298be ISO formatted dates in sodertorns hogskola citation styles (#5882)
1114ec2 Update sodertorns-hogskola-oxford.csl (#5865)
20c439b Create boletin-de-la-sociedad-geologica-mexicana.csl (#5841)
e02b500 Create jurisprudence.csl (#5856)
a860c30 Update organization-studies.csl (#5914)

git-subtree-dir: buildres/csl/csl-styles
git-subtree-split: 8f69d4e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants