-
Notifications
You must be signed in to change notification settings - Fork 15
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
#990: refactor script options parser #468
Conversation
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
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.
Tests for ConverterLegacy and ConverterV2 are currently the same.
exaudfclient/base/javacontainer/script_options/converter_legacy.cc
Outdated
Show resolved
Hide resolved
const std::set<std::string> & getJarPaths() const { | ||
return m_jarPaths; | ||
} |
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.
Often, it is sufficient to expose only iterators rather than the full underlying (internal) data structure.
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.
This function will change in a future PR completely. I only wanted to keep the size of the PR as small as possible.
exaudfclient/base/javacontainer/script_options/converter_legacy.cc
Outdated
Show resolved
Hide resolved
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 | ||
} |
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 think now it is duplicated .cc
and in the .h
there is the same impl.
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.
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); |
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.
The trimming happens in the Parser, or?
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.
Yes, here
Also there is unit test ensuring that we don't change the behavior:
TEST(JavaContainer, basic_jar_with_white_spaces) { |
exasol/script-languages-release#990