-
Notifications
You must be signed in to change notification settings - Fork 146
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 #454: fixed NPE in ConfusingConditionCheck #514
Conversation
Please give me example of code. |
@romani
another example:
Code and property define use for blocks, but I assume that means between {}s and these examples have no braces. It is just counting lines, not number of statements. |
yes, that is all we need to do. If there is no block (block is |
Please provide:
|
@romani I think its time we make some type of option in main checkstyle to prevent propagating the exception for these situations unless you know another way. Done correctly, the exception should be logged as a violation and show a difference. Maybe make changes for the diff tool to point them out. I don't think it can be just an option in CLI since we are using JXR and maven-checkstyle in regression. |
Here is stress report (not diff): Config:
|
simple launch have too much violations to state that there are no regression.
yes this is not typical . but diff is still possible, just demand a bit more manual actions.
Please rebase this branch. |
The point isn't it is easy to work around it, the point is the report is now false as it shows no NPEs fixed. Currently there are differences: http://rveach.no-ip.org/checkstyle/regression/reports/134/ It happens with code like: http://rveach.no-ip.org/checkstyle/regression/reports/134/apache-ant/xref/File1.html#L152
My new code is saying the first else has no lines because it isn't |
new report on current state: http://rveach.no-ip.org/checkstyle/regression/reports/136/ http://rveach.no-ip.org/checkstyle/regression/reports/136/nbia-dcm4che-tools/index.html#A1 This is a difference because of incorrect calculation of
For the else, All the removals I looked at follow this pattern. |
IF-ELSE-IF blocks can not be easily inverted , Check should skip them. Strange that is missed in javadoc. |
@romani Squashed.
Why prevent them from being flagged, shouldn't it still be possible as long as second+ if isn't a negative condition too?
|
discussion could be continued at #531 |
Issue #454
Fixed NPE in
getAmounOfCodeRowsInBlock
.Since the method is counting for
blocks
I set the return to 0 if there is no block. Please let me know if we should count lines even if there is no block.