Skip to content

Conversation

Copy link

Copilot AI commented Aug 25, 2025

This PR updates the jfr-connection module to comply with the OpenTelemetry Java Contrib style guide (docs/style-guide.md), excluding the @Nullable annotation usage section as requested.

Changes Made

Static Imports

Added static imports for commonly used methods and constants according to the style guide:

  • Objects.requireNonNull in FlightRecorderMXBeanConnection and FlightRecorderDiagnosticCommandConnection
  • Collections.unmodifiableMap in RecordingOptions
  • Arrays.stream in FlightRecorderDiagnosticCommandConnection
  • java.util.stream.Collectors.* (toList, toMap, joining) across multiple files
  • StandardCharsets.UTF_8 in JfcFileConfiguration

Class Organization

Fixed class organization to follow the preferred order:

  • Moved constructor after methods in PredefinedConfiguration to comply with "methods before nested classes" ordering

Final Keyword Usage

Added final modifiers to public non-internal classes where appropriate:

  • JfrConnectionException, PredefinedConfiguration, JfcFileConfiguration, MapConfiguration, RecordingOptions

Note: The Recording class was left non-final due to ErrorProne constraints that prevent compilation when the class is marked final.

Verification

All changes are minimal and focused solely on style guide compliance. The module builds successfully, passes all existing tests, and maintains full backward compatibility.

Fixes #361.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@trask trask closed this Aug 25, 2025
Copilot AI changed the title [WIP] Update jfr-connection module to follow style guide Update jfr-connection module to follow style guide Aug 25, 2025
Copilot AI requested a review from trask August 25, 2025 00:35
Copilot finished work on behalf of trask August 25, 2025 00:35
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.

Update jfr-connection module to follow style guide

2 participants