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

#990: refactor script options parser #468

Merged
merged 8 commits into from
Oct 24, 2024

Conversation

tomuben
Copy link
Collaborator

@tomuben tomuben commented Oct 23, 2024

1. Splitted up Converter into Legacy and V2
2. Splitted up Extractor into Interface and Implementation
3. JavaContainerBuilder now instantiates Extractor instead of parser.
2. Removed unnecessary include in parser_ctpg.cc
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Tests for ConverterLegacy and ConverterV2 are currently the same.

exaudfclient/base/javacontainer/javacontainer_impl.cc Outdated Show resolved Hide resolved
exaudfclient/base/javacontainer/script_options/converter.h Outdated Show resolved Hide resolved
Comment on lines +24 to +26
const std::set<std::string> & getJarPaths() const {
return m_jarPaths;
}
Copy link
Member

Choose a reason for hiding this comment

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

Often, it is sufficient to expose only iterators rather than the full underlying (internal) data structure.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This function will change in a future PR completely. I only wanted to keep the size of the PR as small as possible.

Comment on lines 14 to 20
void ConverterV2::convertExternalJar(const std::string & value) {
std::istringstream stream(value);
std::string jar;

while (std::getline(stream, jar, ':')) {
m_jarPaths.insert(jar); // If m_jarPaths is a Set or you make it a Set, uniqueness implicitly is taken care of
}
Copy link
Member

Choose a reason for hiding this comment

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

I think now it is duplicated .cc and in the .h there is the same impl.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No, this is the other implementation. In the next PR I will change the implementation in ConverterV2

std::string jar;

while (std::getline(stream, jar, ':')) {
m_jarPaths.insert(jar);
Copy link
Collaborator

Choose a reason for hiding this comment

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

The trimming happens in the Parser, or?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, here

Also there is unit test ensuring that we don't change the behavior:

TEST(JavaContainer, basic_jar_with_white_spaces) {

@tomuben tomuben merged commit 23d5d1a into master Oct 24, 2024
24 checks passed
@tomuben tomuben deleted the refactoring/990_refactor_script_options_parser branch October 24, 2024 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants