SONARJAVA-6801 Remove redundant fully qualified names in TransactionalMethodCheckedExceptionCheck - #5933
Open
sonarqube-agent[bot] wants to merge 1 commit into
Open
Conversation
Fixed issues: - AaATHsqG8ziIV05gbeJS for java:S1942 rule - AaATHsqG8ziIV05gbeJT for java:S1942 rule Generated by SonarQube Agent (task: 33c62758-3516-4e0d-b01b-90e55202f06f)
romainbrenguier
approved these changes
Aug 19, 2026
Contributor
Contributor
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




Replace unnecessary fully qualified class names with their simple names in TransactionalMethodCheckedExceptionCheck.java, since AssignmentExpressionTree and IdentifierTree are already imported in the file. This eliminates code smell violations and improves code readability by using consistent import-based references.
View Project in SonarCloud
Fixed Issues
java:S1942 - Replace this fully qualified name with "AssignmentExpressionTree" • MINOR • View issue 1
java:S1942 - Replace this fully qualified name with "IdentifierTree" • MINOR • View issue 2
Location:
java:java-checks/src/main/java/org/sonar/java/checks/spring/TransactionalMethodCheckedExceptionCheck.java:266Why is this an issue?
Java’s
importmechanism allows the use of simple class names. Therefore, using a class' fully qualified name in a file thatimports the class is redundant and confusing.What changed
This hunk replaces fully qualified class names with their simple names. Specifically, it changes
org.sonar.plugins.java.api.tree.AssignmentExpressionTreetoAssignmentExpressionTreeandorg.sonar.plugins.java.api.tree.IdentifierTreetoIdentifierTree. Since these classes are already imported in the file, using their fully qualified names is redundant and confusing. This directly fixes the code smell warning about the redundant fully qualified name for AssignmentExpressionTree on line 266, as well as the code smell warning about the redundant fully qualified name for IdentifierTree on line 267. Both replacements use the simple class names that are available through the file's existing imports.SonarQube Remediation Agent uses AI. Check for mistakes.