Skip to content

Conversation

@emeroad
Copy link
Member

@emeroad emeroad commented Jan 19, 2026

…e primitive int handling

This pull request refactors parts of the codebase to use Eclipse Collections' primitive collections for improved performance and memory efficiency, replacing standard Java collections and Guava's ImmutableSet. It also removes an unused annotation key and updates type handling for service type codes.

Collection Refactoring and Type Handling:

  • Replaced usage of Set<Integer> and Set<Short> (including Guava's ImmutableSet and Java's HashSet) with Eclipse Collections' IntSet and MutableIntSet in RpcURLPatternFilter and ApplicationNameMapper for more efficient primitive collection handling. [1] [2] [3] [4] [5] [6] [7]
  • Updated the type of serviceTypeCode from short to int in ApplicationNameMapper to align with the new primitive collection usage.

Code Cleanup:

  • Removed the unused "nimm.url" annotation key from the hardcoded list in RpcURLPatternFilter.

@emeroad emeroad requested a review from Copilot January 19, 2026 11:13
@emeroad emeroad added this to the 3.1.0 milestone Jan 19, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request refactors the codebase to use Eclipse Collections' primitive int collections (IntSet, MutableIntSet) instead of standard Java collections (HashSet, Set) and Guava's ImmutableSet for handling service type codes. This optimization eliminates boxing overhead when working with primitive integer values. The PR also removes an unused annotation key ("nimm.url") from the hardcoded list in RpcURLPatternFilter.

Changes:

  • Replaced HashSet<Short> with MutableIntSet in ApplicationNameMapper for collecting unique service type codes
  • Replaced Set<Integer> and ImmutableSet with IntSet and MutableIntSet in RpcURLPatternFilter for managing RPC endpoint annotation codes
  • Removed the unused "nimm.url" annotation key from RpcURLPatternFilter's initialization

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
web/src/main/java/com/navercorp/pinpoint/web/mapper/ApplicationNameMapper.java Migrated from HashSet to Eclipse Collections MutableIntSet for deduplicating service type codes; changed serviceTypeCode variable type from short to int to align with IntSet and ApplicationFactory API
web/src/main/java/com/navercorp/pinpoint/web/filter/RpcURLPatternFilter.java Replaced Guava ImmutableSet and HashSet with Eclipse Collections IntSet for storing RPC endpoint annotation codes; removed unused "nimm.url" annotation key from hardcoded list

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +51 to +64
MutableIntSet uniqueTypeCodes = IntSets.mutable.of();
String applicationName = CellUtils.rowToString(result);

Cell[] rawCells = result.rawCells();
for (Cell cell : rawCells) {
short serviceTypeCode = CellUtils.valueToShort(cell);
int serviceTypeCode = CellUtils.valueToShort(cell);
uniqueTypeCodes.add(serviceTypeCode);
}

List<Application> applicationList = new ArrayList<>();
for (short serviceTypeCode : uniqueTypeCodes) {
uniqueTypeCodes.forEach(serviceTypeCode -> {
final Application application = applicationFactory.createApplication(applicationName, serviceTypeCode);
applicationList.add(application);
}
});
Copy link

Copilot AI Jan 19, 2026

Choose a reason for hiding this comment

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

The refactored logic for collecting unique service type codes using Eclipse Collections IntSet lacks test coverage. Consider adding tests to verify that duplicate service type codes are correctly deduplicated and that the forEach iteration produces the expected Application instances. This is especially important given the change from a traditional for-each loop to a lambda-based forEach method.

Copilot uses AI. Check for mistakes.
@codecov
Copy link

codecov bot commented Jan 19, 2026

Codecov Report

❌ Patch coverage is 33.33333% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 33.24%. Comparing base (40dbb76) to head (0e31979).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...orp/pinpoint/web/mapper/ApplicationNameMapper.java 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             master   #13306   +/-   ##
=========================================
  Coverage     33.23%   33.24%           
- Complexity    10977    10980    +3     
=========================================
  Files          4070     4070           
  Lines         94448    94448           
  Branches       9835     9834    -1     
=========================================
+ Hits          31392    31398    +6     
+ Misses        60378    60374    -4     
+ Partials       2678     2676    -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@emeroad emeroad merged commit db9cc6f into pinpoint-apm:master Jan 19, 2026
9 of 11 checks passed
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.

1 participant