Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Add new parser for MathSciNet search #11055
Add new parser for MathSciNet search #11055
Changes from 13 commits
b22a6ff
8ece060
3de80ef
bff1b11
3dc1f55
ec1b30e
95ac88c
8b6317d
a04b364
e1e1daa
e6a2ec7
4997846
bd801b6
021fd2f
6d70470
dd32e6a
d496968
aafc8aa
4e154bd
9a119ba
25afe1c
a6299eb
d1709ca
4eb516b
cde25ee
95b9288
73c165d
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try to route through
DOI#parse
. If that optional is present, usedoi.getNormalized()
, otherwise use thedoi
variable. In That way, the http prefix is removed if it is a valid doi, but the full string is kept in case of a DOI parsing error.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use the new instance of pattern matching syntax, which makes the extra casting step necessary
https://docs.oracle.com/en/java/javase/17/language/pattern-matching-instanceof-operator.html#GUID-843060B5-240C-4F47-A7B0-95C42E5B08A7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, I just went through the docs. If I'm not wrong, did you mean that it would make the extra casting step "unnecessary"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the casts and followed the new syntax. It is odd that IntelliJ is giving me red squiggly lines and a suggestion to cast it back. Will ignore for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay nope, I added the obj syntax but seems like the cast is necessary, else I'm getting this compilation error:
error: cannot find symbol
value = value.opt(key);
^
symbol: method opt(String)
location: variable value of type Object
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the examples in the linked docs, you need to use value = obj.get... After the if
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it!