-
Notifications
You must be signed in to change notification settings - Fork 90
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
Allow parameter name patterns to be varied from and restored to default values. #622
Conversation
|
||
public Pattern getParameterPattern() { | ||
return paramsNames; | ||
return Pattern.compile(getParamPattern()); |
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.
Whitespace issue here noted.
daadd68
to
3652629
Compare
@MMatten I think something that should be OK. Just we rather have diffent naming since it's hard to guess what's the difference between |
Very true. I was already thinking of that too. How about |
Edit: above comment was a bit down the road and before I look at the current implementation. For the current implementation it might be OK except maybe that we have Another question is do we need any of these to be |
In general seems good to me. I guess we can merge it after polishing the naming. |
3652629
to
e8fb688
Compare
@javornikolov I still have to test this over some of the adapters but any review comments at this stage would be great. |
e8fb688
to
ba98a1b
Compare
I'm not sure how my local build didn't pick up that unused import. Fixed and force pushed. |
protected abstract Pattern getParameterPattern(); | ||
protected String defaultParamPatternString = ""; | ||
|
||
protected String getParamPatternString() { |
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.
Can we keep that method private (if we want a separate method at all)?
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.
Ah, I see we're using it in subclasses. I'm wondering about the getParameterPattern().toString()
alternative. My point is that having too many methods which is possible to override might lead to some confusion when implementing a new adapter.
defaultParamPatternString : Options.get(Options.OPTION_PARAMETER_PATTERN); | ||
} | ||
|
||
//protected abstract Pattern getParameterPattern(); |
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.
Isn't that comment redundant? Maybe we rather refer to defaultParamPatternString
attribute as a comment here?
@@ -23,20 +22,15 @@ | |||
|
|||
public DB2iEnvironment(String driverClassName) { | |||
super(driverClassName); | |||
defaultParamPatternString = "[@:]([A-Za-z0-9_]+)"; | |||
|
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'll delete this extra blank line.
return paramRegex; | ||
protected String parseCommandText(String commandText) { | ||
commandText = commandText.replaceAll(getParamPatternString(), "?"); | ||
return super.parseCommandText(commandText); |
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.
@javornikolov I'm thinking that now I've got this block in every adapter I should merge it into the super-class's method.
1896078
to
13d973a
Compare
@javornikolov I've now tested the current PR state with all adapters. |
13d973a
to
a786411
Compare
@javornikolov I think I've tidied things up a little. What do you think about the current methods and visibility of them in |
@javornikolov do you think this is close to being mergeable yet? |
@MMatten, sorry for the delay! Thank you for the reminder :-) |
Hi Team, I am trying to explore how can i connect to command line terminal and execute unix/shell commands. |
Use the full class name including the package name part or try |Import| of the package name.
…Sent from my iPhone
On 14 Mar 2018, at 10:26, nohoyuar <notifications@github.com<mailto:notifications@github.com>> wrote:
Hi Team,
I am trying to explore how can i connect to command line terminal and execute unix/shell commands.
Please help suggest me with a sample example on how to do it. I am exploring on this for past several days. I tried even with downloading the latest jar file commandlinefixture.jar but it is throwing error while i am using it in dbfit syntax. Can you elaborate on the steps to perform it.
Thanks & regards,
Arun K
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#622 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/ABztFQ1eVqyU1kGSVeuMrY3csDnhhMAOks5tePBfgaJpZM4R7pkJ>.
|
Allow parameter name pattern to be varied from and restored to the default name pattern string for each adapter via a new
Parameter Pattern
option.