This patch replaces the excessive extraction of a qualifier via `ExpressionUtils.getEffectiveQualifier` with a simple `call.getMethodExpression().getQualifierExpression`
Signed-off-by: Nikita Eshkeev <nikita.eshkeev@jetbrains.com>
GitOrigin-RevId: 4a4f1c6b218c63691fa2bd4610e9901874d3c712
This patch removes the detection of redundant calls to `StringBuilder#toString` from the `RedundantStringOperationInspection` since there is a more general inspection called `UnnecessaryToStringCallInspection` which handles all the redundant `Object#toString` calls. All the related tests were moved to the test data of `UnnecessaryToStringCallInspectionTest`
Signed-off-by: Nikita Eshkeev <nikita.eshkeev@jetbrains.com>
GitOrigin-RevId: 1fe7723fa4369b797120c5bbc6a6b24947c84a94
This patch alters the `getRedundantStringBuilderToStringProblem` method with more sophisticated algorithm to detect unnecessary freestanding `StringBuilder#toString` calls. If the call is a part of a polyadic expression it checks if there is at least one string operand (either a constant literal or a local variable or a constant variable or a method call) and based on that information it detects redundant `StringBuilder#toString` calls.
Signed-off-by: Nikita Eshkeev <nikita.eshkeev@jetbrains.com>
GitOrigin-RevId: e09ea8b8829ad9e28e8ff1bcfad34cf6b191aa6b
This patch enhances RedundantStringOperationInspection with detecting either unnecessary naked calls StringBuilder.toString or redundant toString in StringBuilder.toString.substring.
Signed-off-by: Nikita Eshkeev <nikita.eshkeev@jetbrains.com>
GitOrigin-RevId: 3cd7e964c0acc73fb1ac38061ef31264035f82dc