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 #6764: fix some sonar warnings and small refactoring #6760
Conversation
We have profile at Sonar, please provide direct link to violation. Please put all details in PR description of what violations your are try to resolve. |
src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/AbstractJavadocCheck.java
Outdated
Show resolved
Hide resolved
@romani done. |
@strkkk since you made an issue for this it should be |
@rnveach sorry, I understood romani's comment in a wrong way. |
@rnveach can you clarify - codecov checks failed because of travis build (which failed because of unapproved issue)? |
Whole idea of TC is allow us to use the most of inspection set. I am fine to make code better, your change is good. But I want to get to know , what inspection is active on your side and disabled on our? |
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.
Item to discuss:
} | ||
return javadocTree; | ||
return blockCommentToJavadocTree.computeIfAbsent(blockComment, | ||
key -> new JavadocDetailNodeParser().parseJavadocAsDetailNode(blockComment).getTree()); |
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.
I might be old-school, but I like to have simple return statement, so it is easy to put break point on return and validate result. Extra local variable is super easy task for any optimizer, but it improve code maintenance.
@rnveach , what is your position on this ?
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.
I am even more old school then you. I am not a fan of lambdas and the new streams in Java 8 because they hide some functionality and some of them make the code harder to read, imo. I maintain the backport and these always give me issues converting since I have to understand them to convert them. Understanding them never comes instant for me even though I have converted a bunch.
Can't say I have really tried to put a breakpoint here but I tried and Eclipse Oxygen won't let me put it on the key ->
line unless there was {}s. Didn't try newer eclipse versions.
New code is still easy to read. We have alot of other areas I would choose to remove lambdas first over starting with this.
I am pretty much fine with this one.
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.
@strkkk ,
Please do me favor, keep return javadocTree
.
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.
@romani Ok, I've brought this one back.
@romani this particular inspection is |
Look at our config, we probably need to enable it, if it doesn't have special disablement comment. |
It is disabled by default - checkstyle/config/intellij-idea-inspections.xml Lines 3418 to 3422 in 141f5d6
I have no idea is this problem solved or not. |
Good. I didn't find in related PR or issue any details, but most likely this comment was included by me. So we are are not crazy about single statement style (functional), for good reason. But in same time do not want to be old code, so we do not force functional style automatically, and see all case by case. |
Pitest mutates the bytecode. There is no lambda in the byte code, so that is why there is no specific mutator for them.
Decompiled Bytecode:
https://dzone.com/articles/hacking-lambda-expressions-in-java |
Issue #6764