Skip to content

SimpleCompletionPolicy should have getChunkSize() method. #3738

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

Closed
MinJunKweon opened this issue Jul 4, 2020 · 3 comments · Fixed by #3742
Closed

SimpleCompletionPolicy should have getChunkSize() method. #3738

MinJunKweon opened this issue Jul 4, 2020 · 3 comments · Fixed by #3742

Comments

@MinJunKweon
Copy link
Contributor

MinJunKweon commented Jul 4, 2020

Currently, SimpleCompletionPolicy doesn't have getChunkSize().
But toString() method returns a string that include own chunk size by some format.

You can see them on this.

SimpleCompletionPolicy examplePolicy = new SimpleCompletionPolicy(50);
System.out.println(examplePolicy.toString());
// SimpleCompletionPolicy: chunkSize=50

I think it is a code smell.
If I want to get its chunk size, I have to parse toString() result. It is a very ugly way.

I suggest two options to solve this.

  1. Make toString() doesn't show own chunk size.
  2. Make getChunkSize() public method.

In my opinion, It should be second option.
If you approve this idea, comment, please. And then, I will make a pull request for this.

Thank you.

@MinJunKweon MinJunKweon added status: waiting-for-triage Issues that we did not analyse yet type: bug labels Jul 4, 2020
@LOG-INFO
Copy link

LOG-INFO commented Jul 5, 2020

I have same problem.

I'm parsing chunkSize using toString(). I know this is a bad way.
I'm worried that there will be an error if the toString() format is changed even a little.

I think the getChunkSize() should be a public method.

@SeoungJinKim
Copy link

I agree that problem.

So, I think getChunkSize() is good suggestion.

@fmbenhassine
Copy link
Contributor

There is already a setter for chunkSize, I see no harm in adding a getter as well.

If you approve this idea, comment, please. And then, I will make a pull request for this.

@MinJunKweon Go ahead and open a PR, thank you upfront!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants