-
Notifications
You must be signed in to change notification settings - Fork 39
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
Fix for ArrayIndexOutOfBoundsException in #371 #612
Conversation
Codecov Report
@@ Coverage Diff @@
## master #612 +/- ##
============================================
+ Coverage 80.73% 80.75% +0.01%
+ Complexity 1746 1745 -1
============================================
Files 89 89
Lines 4614 4613 -1
Branches 1386 1385 -1
============================================
Hits 3725 3725
Misses 322 322
+ Partials 567 566 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/utils/AstNodeUtils.kt
Show resolved
Hide resolved
} else { | ||
calculateLineNumber() | ||
} | ||
fun ASTNode.getLineNumber(): Int? = |
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 it should return nullable??
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.
You're right, I use non-null assert on every call. I'll check and throw error here and return non-nullable value.
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.
lgtm
What's done:
This pull request closes #371