fix: resolve 5 SonarQube issues (5 minor)#1945
fix: resolve 5 SonarQube issues (5 minor)#1945sonarqube-agent[bot] wants to merge 1 commit intomasterfrom
Conversation
Fixed issues: - AZv9xbSbClKDVB-iUu2x for java:S1874 rule - AZv9xbRYClKDVB-iUu2c for java:S1874 rule - AZv9xbRYClKDVB-iUu2d for java:S1874 rule - AZv9xbRYClKDVB-iUu2e for java:S1874 rule - AZv9xbRYClKDVB-iUu2f for java:S1874 rule Generated by SonarQube Agent (task: 36a79da5-0805-4518-8768-2b8d08814e0c)
SummaryAddresses 5 SonarQube deprecation warnings by removing use of deprecated APIs in test code. Two categories of changes: (1) removes unused integer parameter from 4 What reviewers should knowChanges are straightforward API deprecation cleanups. The test code itself is unchanged—only the test setup/mock construction differs. In
|
This PR includes automated code changes to address 5 SonarQube issues: MINOR (5).
View Project in SonarCloud
Fixed Issues
java:S1874 - Remove this use of "AnalyzeFilesAndTrackParams"; it is deprecated. • MINOR • View issue
Location:
sonarlint-core-parent:medium-tests/src/test/java/mediumtest/issues/CheckResolutionStatusChangePermittedMediumTests.java:267Why is this an issue?
Code is sometimes annotated as deprecated by developers maintaining libraries or APIs to indicate that the method, class, or other programming element is no longer recommended for use. This is typically due to the introduction of a newer or more effective alternative. For example, when a better solution has been identified, or when the existing code presents potential errors or security risks.
What changed
The deprecated usage of
AnalyzeFilesAndTrackParamsat line 320 is caused by calling a deprecated constructor overload that accepts an extra integer parameter. By removing the, 0argument, this hunk switches the call to the non-deprecated constructor overload ofAnalyzeFilesAndTrackParams.java:S1874 - Remove this use of "AnalyzeFilesAndTrackParams"; it is deprecated. • MINOR • View issue
Location:
sonarlint-core-parent:medium-tests/src/test/java/mediumtest/issues/CheckResolutionStatusChangePermittedMediumTests.java:320Why is this an issue?
Code is sometimes annotated as deprecated by developers maintaining libraries or APIs to indicate that the method, class, or other programming element is no longer recommended for use. This is typically due to the introduction of a newer or more effective alternative. For example, when a better solution has been identified, or when the existing code presents potential errors or security risks.
What changed
The deprecated usage of
AnalyzeFilesAndTrackParamsat line 381 is caused by calling a deprecated constructor overload that accepts an extra integer parameter. By removing the, 0argument, this hunk switches the call to the non-deprecated constructor overload ofAnalyzeFilesAndTrackParams.java:S1874 - Remove this use of "AnalyzeFilesAndTrackParams"; it is deprecated. • MINOR • View issue
Location:
sonarlint-core-parent:medium-tests/src/test/java/mediumtest/issues/CheckResolutionStatusChangePermittedMediumTests.java:381Why is this an issue?
Code is sometimes annotated as deprecated by developers maintaining libraries or APIs to indicate that the method, class, or other programming element is no longer recommended for use. This is typically due to the introduction of a newer or more effective alternative. For example, when a better solution has been identified, or when the existing code presents potential errors or security risks.
What changed
The deprecated usage of
AnalyzeFilesAndTrackParamsat line 435 is caused by calling a deprecated constructor overload that accepts an extra integer parameter. By removing the, 0argument, this hunk switches the call to the non-deprecated constructor overload ofAnalyzeFilesAndTrackParams, resolving the deprecation warning about using the old constructor signature. This also addresses any additional deprecated usage warnings related to the same deprecated constructor pattern in this area of the file.java:S1874 - Remove this use of "AnalyzeFilesAndTrackParams"; it is deprecated. • MINOR • View issue
Location:
sonarlint-core-parent:medium-tests/src/test/java/mediumtest/issues/CheckResolutionStatusChangePermittedMediumTests.java:435Why is this an issue?
Code is sometimes annotated as deprecated by developers maintaining libraries or APIs to indicate that the method, class, or other programming element is no longer recommended for use. This is typically due to the introduction of a newer or more effective alternative. For example, when a better solution has been identified, or when the existing code presents potential errors or security risks.
What changed
The deprecated usage of
AnalyzeFilesAndTrackParamsat line 435 is caused by calling a deprecated constructor overload that accepts an extra integer parameter. By removing the, 0argument, this hunk switches the call to the non-deprecated constructor overload ofAnalyzeFilesAndTrackParams, resolving the deprecation warning about using the old constructor signature. This also addresses any additional deprecated usage warnings related to the same deprecated constructor pattern in this area of the file.java:S1874 - Remove this use of "setSeverity"; it is deprecated. • MINOR • View issue
Location:
sonarlint-core-parent:medium-tests/src/test/java/mediumtest/http/ProxyMediumTests.java:115Why is this an issue?
Code is sometimes annotated as deprecated by developers maintaining libraries or APIs to indicate that the method, class, or other programming element is no longer recommended for use. This is typically due to the introduction of a newer or more effective alternative. For example, when a better solution has been identified, or when the existing code presents potential errors or security risks.
What changed
This hunk directly fixes the deprecated 'setSeverity' usage at line 115 by replacing the deprecated '.setSeverity("INFO").setType(Common.RuleType.BUG)' calls with the modern alternatives '.setCleanCodeAttribute(Common.CleanCodeAttribute.CONVENTIONAL).setImpacts(Rules.Rule.Impacts.newBuilder().build())'. This eliminates the use of the deprecated API method as flagged by the static analysis tool.
SonarQube Remediation Agent uses AI. Check for mistakes.