-
Notifications
You must be signed in to change notification settings - Fork 687
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
SONARJAVA-5328 S7190 Before and After transaction methods should respect the contract #5018
Conversation
fd23577
to
e7b3935
Compare
e7b3935
to
e717bb2
Compare
@org.springframework.beans.factory.annotation.Autowired | ||
Object o; | ||
|
||
@Autowired |
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.
@Autowired | |
@Annotation |
Let's be a bit clearer on the intention
} | ||
|
||
@Test | ||
void testNoSemantics() { |
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.
void testNoSemantics() { | |
void test_no_semantics() { |
Let's stay consistent (I think it is the preferred way).
|
||
private void checkReturnType(MethodTreeImpl methodTree, String annotationName) { | ||
if (!methodTree.returnType().symbolType().isVoid()) { | ||
reportReturnType(methodTree, String.format(RETURN_VOID_MESSAGE, annotationName)); |
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.
let's inline reportReturnType, it used only here better to give more context when reading the code
private void checkParameters(MethodTreeImpl methodTree, String annotationName) { | ||
List<VariableTree> parameters = methodTree.parameters(); | ||
if (!parameters.isEmpty() && parameters.stream().anyMatch(parameter -> !isParameterAllowed(parameter))) { | ||
reportParameters(methodTree, String.format(NO_PARAMETERS_MESSAGE, annotationName)); |
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.
let's inline reportParameters, it used only here better to give more context when reading the code
|
SONARJAVA-5328