-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Issue #4641: Avoid usage of getLines method from FileText #4670
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4670 +/- ##
======================================
Coverage 100% 100%
======================================
Files 284 284
Lines 15367 15372 +5
Branches 3499 3500 +1
======================================
+ Hits 15367 15372 +5
Continue to review full report at Codecov.
|
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.
@timurt , please launch diff regression testing on affected Checks, no diff is expected.
few items to improve:
* @return line number of first occurrence. If no key found in properties | ||
* file, 0 is returned | ||
*/ | ||
protected static int getLineNumber(FileText fileText, String keyName) { |
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.
ideally it should be private, but will need it in Tests to avoid even deeper refactoring.
I will create separate issue on UT refactoring, it could be done later.
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.
Issue #4694
@@ -104,9 +103,7 @@ protected void processFiltered(File file, FileText fileText) { | |||
* file, 0 is returned | |||
*/ | |||
protected static int getLineNumber(List<String> lines, String keyName) { |
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 method is not in use in Check so should be removed. Looks like it is required by Tests, Tests need to use new method.
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.
Issue #4694
9e55814
to
3711642
Compare
* method return value. | ||
*/ | ||
@Test | ||
public void testNotFoundKey() { | ||
public void testNotFoundKeyFileText() { |
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.
Why do we need FileText
on the end of test name?
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.
resolved
* Processes a set of lines looking for matches. | ||
* @param fileText {@link FileText} object contains the lines to process. | ||
*/ | ||
public void processLines(FileText fileText) { |
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.
There is also a method public void processLines(List<String> lines)
.
Why is the other method remaining? Shouldn't it be swapped for this new method instead of keeping both?
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, you are right, done
@romani |
#4641