-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Rewrite EndnoteXMLImporter as a StAX-Parser #9880
Conversation
# Conflicts: # src/main/java/org/jabref/logic/importer/fileformat/EndnoteXmlImporter.java
Hello, I have question about the expected format output of keywords. The expected keyword from EndnoteXmlImporterTest_EmptyKeywordStyle.xml has a semicolon and whitespace at the end: My Implementation to realize keywords: |
(on the road, therefore brief reply). Good to have no end whitespace. You can change the test cases accordingly. JabRef has a class KeywordList (or similar) to handle keywords. Maybe that could be used here too? #reuse |
Please also make sure to import and setup JabRef's code style https://devdocs.jabref.org/getting-into-the-code/guidelines-for-setting-up-a-local-workspace/intellij-13-code-style.html |
@koppor I'll look up the KeywordList (or similar), thank you. As for the test cases, I'm not quite understand what "change the test cases accordingly" mean. As far as I known, the ImporterTestEngine replace the .xml source file with .bib file and create the expected output by BibtexParser. It would be great to have more explanation. @Siedlerchr Sorry I forgot to run checkstyle before PR, will do it |
@DinjerChang That sounds good:) Regarding the test case, you should modify the xml file then in the folder: |
… in EndnoteXmlimporter, checksytle done, test cases all pass
The change in CHANGELOG.md can be reverted. End users will see no change. In case more data from EndNote is read, that needs to be mentioned in the CHANGELOG.md. Otherwise, technical changes are not important for end users. |
.flatMap(url -> OptionalUtil.toStream(getUrlValue(url))) | ||
.findFirst(); | ||
if (isEndXMLEvent(reader) && reader.getName().getLocalPart().equals(startElement)) { | ||
// System.out.println("keywords end"); |
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 LOGGER.debug
if this is important. Otherwise, remove the line.
I think, the XML is an EndNote file. We should not change the EndNote file. The expected BibTeX should be modified. See screenshot: I think, only the line at Line 15 in 2ee5c9c
|
@koppor Thank you! I have changed the .bib file accordingly, passed all the test case, removed redundant print statement and ran checkstyle to make sure it's aligned with the coding style. |
Yes, just remove the line and push the new commits. The PR gets automatically updated when you push your new commits. |
Do I have to fix the conflict listing above? |
Yes, you have to resolve the conflicts, otherwise the PR cannot be merged and tests won't run. It's probably just some formatter things which came from some other PRs recently. |
Looks good so far, there is only one additional code style checker failure: BUILD FAILED in 2m 9s |
…abref into fix-for-issue-9538
@Siedlerchr and @koppor Thank you guys so much for the guidance! Just two more question:
|
@DinjerChang No, check style is enough. The openRewrite is a new thing. The CI will tell you (if you click on the failed action on details) if you need to run it. For issues in general, we try to group and order them by e,g, difficulty or complexity: You can always take a loook here I have asked the other maintainers if they have something in mind or can come up with some that are easily testable. For tests, classes that reside in logic or model can be tested and already contain tests. |
@Siedlerchr Thanks! I'll look around the link and the classes you mentioned. |
@DinjerChang A good idea would be to craft some more tests for the citation key generator, especially the authors formatter see @koppor s work for how to do this #9799 |
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.
For me, this improves the state-of-the art. Thus, +1 for merging
@@ -339,3 +502,8 @@ public List<BibEntry> parseEntries(InputStream inputStream) { | |||
return Collections.emptyList(); | |||
} | |||
} | |||
|
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.
These are too many empty llines at the end. OK for me now to keep things going.
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.
Ok, will pay attention to this next time as well.
@koppor Thanks for the heads up regarding test. Yeah, we've been using the coverage technique to look around! We're working on some other part of the test cases |
Fixes #9538
This fixes #9538 by rewriting the org.jabref.logic.importer.fileformat.EndnoteXMLImporter class to use a StAX-Parser, and removes all JAXB dependencies from the class. The corresponding xjc task is also removed from build.gradle.
Compulsory checks