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

Avoid usage of getLines method from FileText #4641

Closed
MEZk opened this Issue Jul 6, 2017 · 4 comments

Comments

@MEZk
Contributor

MEZk commented Jul 6, 2017

Taken from #4525

After merge of #4525 all calls to FileText#getLines will create the copy of the inner array of strings. We should avoid usage of the method (ideally we need to remove it) and replace all method calls with FileText#get(i) and FileText#size().

@timurt

This comment has been minimized.

Show comment
Hide comment
@timurt

timurt Jul 7, 2017

Collaborator

@MEZk
Inside RegexpSinglelineCheck#processFiltered should I create List<String> and copy values from FileText using FileText#get and FileText#size methods
or
Inside SinglelineDetector class create new method with signature
public void processLines(FileText fileText)

Collaborator

timurt commented Jul 7, 2017

@MEZk
Inside RegexpSinglelineCheck#processFiltered should I create List<String> and copy values from FileText using FileText#get and FileText#size methods
or
Inside SinglelineDetector class create new method with signature
public void processLines(FileText fileText)

@MEZk

This comment has been minimized.

Show comment
Hide comment
@MEZk

MEZk Jul 7, 2017

Contributor

@timurt
I think that the second approach will be better.

Contributor

MEZk commented Jul 7, 2017

@timurt
I think that the second approach will be better.

@romani

This comment has been minimized.

Show comment
Hide comment
@romani

romani Jul 7, 2017

Member

Second approach please, to keep performance as it was before.

Please recheck that getLines is used, if not used in our code, so should be removed

Member

romani commented Jul 7, 2017

Second approach please, to keep performance as it was before.

Please recheck that getLines is used, if not used in our code, so should be removed

timurt added a commit to timurt/checkstyle that referenced this issue Jul 9, 2017

@MEZk MEZk moved this from To Do to In Progress in Flexible Suppression Model Jul 9, 2017

timurt added a commit to timurt/checkstyle that referenced this issue Jul 9, 2017

timurt added a commit to timurt/checkstyle that referenced this issue Jul 9, 2017

timurt added a commit to timurt/checkstyle that referenced this issue Jul 10, 2017

romani added a commit that referenced this issue Jul 10, 2017

@romani romani added this to the 8.1 milestone Jul 10, 2017

@romani

This comment has been minimized.

Show comment
Hide comment
@romani

romani Jul 10, 2017

Member

fix is merged

Member

romani commented Jul 10, 2017

fix is merged

@romani romani closed this Jul 10, 2017

@MEZk MEZk moved this from In Progress to Done in Flexible Suppression Model Jul 10, 2017

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