Skip to content

SLCORE-2249 fix: resolve 5 SonarQube issues (5 minor)#1930

Open
sonarqube-agent[bot] wants to merge 1 commit intomasterfrom
remediate-master-20260320-000253-752ef293
Open

SLCORE-2249 fix: resolve 5 SonarQube issues (5 minor)#1930
sonarqube-agent[bot] wants to merge 1 commit intomasterfrom
remediate-master-20260320-000253-752ef293

Conversation

@sonarqube-agent
Copy link
Contributor

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. • MINORView issue

Location: sonarlint-core-parent:medium-tests/src/test/java/mediumtest/analysis/AnalysisMediumTests.java:1078

Why 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

Replaces the deprecated 6-parameter AnalyzeFilesAndTrackParams constructor (which includes a timestamp argument via System.currentTimeMillis()) at line 1078 with the non-deprecated 5-parameter constructor, removing the use of the deprecated API.

--- a/medium-tests/src/test/java/mediumtest/analysis/AnalysisMediumTests.java
+++ b/medium-tests/src/test/java/mediumtest/analysis/AnalysisMediumTests.java
@@ -1078,1 +1078,1 @@ class AnalysisMediumTests {
-    backend.getAnalysisService().analyzeFilesAndTrack(new AnalyzeFilesAndTrackParams(CONFIG_SCOPE_ID, analysisId1, List.of(fileUri), Map.of(), true, System.currentTimeMillis()))
+    backend.getAnalysisService().analyzeFilesAndTrack(new AnalyzeFilesAndTrackParams(CONFIG_SCOPE_ID, analysisId1, List.of(fileUri), Map.of(), true))
java:S1874 - Remove this use of "AnalyzeFilesAndTrackParams"; it is deprecated. • MINORView issue

Location: sonarlint-core-parent:medium-tests/src/test/java/mediumtest/analysis/AnalysisMediumTests.java:1081

Why 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

Replaces the deprecated 6-parameter AnalyzeFilesAndTrackParams constructor (which includes a timestamp argument via System.currentTimeMillis()) at line 1081 with the non-deprecated 5-parameter constructor, removing the use of the deprecated API.

--- a/medium-tests/src/test/java/mediumtest/analysis/AnalysisMediumTests.java
+++ b/medium-tests/src/test/java/mediumtest/analysis/AnalysisMediumTests.java
@@ -1081,1 +1081,1 @@ class AnalysisMediumTests {
-    backend.getAnalysisService().analyzeFilesAndTrack(new AnalyzeFilesAndTrackParams(configScope2, analysisId2, List.of(fileUri2), Map.of(), true, System.currentTimeMillis()))
+    backend.getAnalysisService().analyzeFilesAndTrack(new AnalyzeFilesAndTrackParams(configScope2, analysisId2, List.of(fileUri2), Map.of(), true))
java:S1874 - Remove this use of "AnalyzeFilesAndTrackParams"; it is deprecated. • MINORView issue

Location: sonarlint-core-parent:medium-tests/src/test/java/mediumtest/analysis/AnalysisMediumTests.java:1109

Why 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

Replaces the deprecated 6-parameter AnalyzeFilesAndTrackParams constructor (which includes a timestamp argument via System.currentTimeMillis()) at line 1109 with the non-deprecated 5-parameter constructor, removing the use of the deprecated API.

--- a/medium-tests/src/test/java/mediumtest/analysis/AnalysisMediumTests.java
+++ b/medium-tests/src/test/java/mediumtest/analysis/AnalysisMediumTests.java
@@ -1109,1 +1109,1 @@ class AnalysisMediumTests {
-      .analyzeFilesAndTrack(new AnalyzeFilesAndTrackParams(CONFIG_SCOPE_ID, UUID.randomUUID(), List.of(fileUri1), Map.of(), false, System.currentTimeMillis())).join();
+      .analyzeFilesAndTrack(new AnalyzeFilesAndTrackParams(CONFIG_SCOPE_ID, UUID.randomUUID(), List.of(fileUri1), Map.of(), false)).join();
java:S1874 - Remove this use of "AnalyzeFilesAndTrackParams"; it is deprecated. • MINORView issue

Location: sonarlint-core-parent:medium-tests/src/test/java/mediumtest/analysis/AnalysisMediumTests.java:1116

Why 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

Replaces the deprecated 6-parameter AnalyzeFilesAndTrackParams constructor (which includes a timestamp argument via System.currentTimeMillis()) at line 1116 with the non-deprecated 5-parameter constructor, removing the use of the deprecated API.

--- a/medium-tests/src/test/java/mediumtest/analysis/AnalysisMediumTests.java
+++ b/medium-tests/src/test/java/mediumtest/analysis/AnalysisMediumTests.java
@@ -1116,1 +1116,1 @@ class AnalysisMediumTests {
-      .analyzeFilesAndTrack(new AnalyzeFilesAndTrackParams(CONFIG_SCOPE_ID, UUID.randomUUID(), List.of(fileUri2), Map.of(), false, System.currentTimeMillis())).join();
+      .analyzeFilesAndTrack(new AnalyzeFilesAndTrackParams(CONFIG_SCOPE_ID, UUID.randomUUID(), List.of(fileUri2), Map.of(), false)).join();
java:S1874 - Remove this use of "AnalyzeFilesAndTrackParams"; it is deprecated. • MINORView issue

Location: sonarlint-core-parent:medium-tests/src/test/java/mediumtest/analysis/AnalysisMediumTests.java:1141

Why 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

Replaces the deprecated 6-parameter AnalyzeFilesAndTrackParams constructor (which includes a timestamp argument via System.currentTimeMillis()) at line 1141 with the non-deprecated 5-parameter constructor, removing the use of the deprecated API.

--- a/medium-tests/src/test/java/mediumtest/analysis/AnalysisMediumTests.java
+++ b/medium-tests/src/test/java/mediumtest/analysis/AnalysisMediumTests.java
@@ -1141,1 +1141,1 @@ class AnalysisMediumTests {
-      .analyzeFilesAndTrack(new AnalyzeFilesAndTrackParams(CONFIG_SCOPE_ID, UUID.randomUUID(), List.of(fileUri), Map.of(), false, System.currentTimeMillis())).join();
+      .analyzeFilesAndTrack(new AnalyzeFilesAndTrackParams(CONFIG_SCOPE_ID, UUID.randomUUID(), List.of(fileUri), Map.of(), false)).join();

Have a suggestion or found an issue? Share your feedback here.


SonarQube Remediation Agent uses AI. Check for mistakes.

Fixed issues:
- AZv9xbN2ClKDVB-iUu2K for java:S1874 rule
- AZv9xbN2ClKDVB-iUu2I for java:S1874 rule
- AZv9xbN2ClKDVB-iUu2J for java:S1874 rule
- AZv9xbN2ClKDVB-iUu2G for java:S1874 rule
- AZv9xbN2ClKDVB-iUu2H for java:S1874 rule

Generated by SonarQube Agent (task: ea53ad14-a93f-491a-8997-e13c85420b56)
@sonar-review-alpha
Copy link

sonar-review-alpha bot commented Mar 20, 2026

Summary

Removes deprecated API usage in test code. All 5 changes replace calls to the deprecated 6-parameter AnalyzeFilesAndTrackParams constructor with the 5-parameter version, eliminating the explicit System.currentTimeMillis() timestamp argument that is no longer needed. Changes are isolated to a single test file with no impact on production code.

What reviewers should know

All changes are in AnalysisMediumTests.java across 5 test methods, each containing one or more analysis service calls. The removals are mechanical—the timestamp parameter is simply dropped, which is safe because the newer constructor likely generates this internally. No test behavior changes; verification that existing tests pass confirms correctness.


  • Generate Walkthrough
  • Generate Diagram

🗣️ Give feedback

@hashicorp-vault-sonar-prod hashicorp-vault-sonar-prod bot changed the title fix: resolve 5 SonarQube issues (5 minor) SLCORE-2249 fix: resolve 5 SonarQube issues (5 minor) Mar 20, 2026
@hashicorp-vault-sonar-prod
Copy link

hashicorp-vault-sonar-prod bot commented Mar 20, 2026

SLCORE-2249

@sonarqube-next
Copy link

Copy link

@sonar-review-alpha sonar-review-alpha bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Conclusion: Clean, mechanical removal of deprecated constructor arguments in test code. No behavioral change, no production code affected — safe to merge.

🗣️ Give feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants