Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jul 9, 2025

Fixes the build failure introduced by the ErrorProne upgrade to 2.39.0 in PR #4288.

Issue

ErrorProne 2.39.0 introduced a new TooManyParameters check that flags methods with more than 5 parameters as a warning. Since the build uses -Werror (warnings as errors), this caused the compilation to fail:

error: warnings found and -Werror specified
/home/runner/work/ApplicationInsights-Java/ApplicationInsights-Java/agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/profiler/upload/UploadService.java:130: warning: [TooManyParameters] Consider using a builder pattern (or a library like @AutoBuilder) instead of a method with 9 parameters.

Solution

Added @SuppressWarnings("TooManyParameters") annotation to the uploadFile() method in UploadService that has 9 parameters. This follows the existing pattern in the codebase for suppressing specific ErrorProne warnings (e.g., in BytecodeUtil).

Verification

  • Compilation passes for all modules
  • Test compilation passes
  • No other TooManyParameters warnings found in the codebase
  • Smoke test compilation verified

This is a minimal fix that allows the ErrorProne 2.39.0 upgrade to proceed without breaking the build or requiring architectural changes to the existing API.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI changed the title [WIP] fix the build issues @microsoft/ApplicationInsights-Java/pull/4288 Fix ErrorProne 2.39.0 TooManyParameters warning in UploadService Jul 9, 2025
Copilot AI requested a review from trask July 9, 2025 15:05
Copilot finished work on behalf of trask July 9, 2025 15:05
@trask trask changed the base branch from main to dependabot/gradle/errorProneVersion-2.39.0 July 9, 2025 15:44
@trask trask marked this pull request as ready for review July 9, 2025 15:45
@trask trask merged commit a10510c into dependabot/gradle/errorProneVersion-2.39.0 Jul 9, 2025
1 check passed
@trask trask deleted the copilot/fix-ea728597-9ac9-4ad9-a323-90903fc96e70 branch July 9, 2025 15:45
@trask trask restored the copilot/fix-ea728597-9ac9-4ad9-a323-90903fc96e70 branch July 9, 2025 15:47
@trask trask deleted the copilot/fix-ea728597-9ac9-4ad9-a323-90903fc96e70 branch July 9, 2025 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants