Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR applies various cleanups across the web module, focusing on modernizing generics usage, optimizing collection allocations, refining annotation list setup, and improving logging and return-type consistency.
- Replace explicit generic types with the diamond operator
- Pre-size ArrayList instances to match expected element counts
- Refactor annotation-list initialization for clarity
- Add
isTraceEnabledguard around trace logging and broaden return type toCollection
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| web/src/main/java/com/navercorp/pinpoint/web/service/ProxyRequestTypeRegistryServiceImpl.java | Use diamond operator for ArrayList instantiation |
| web/src/main/java/com/navercorp/pinpoint/web/calltree/span/Node.java | Pre-size alignList based on spanEventBoList.size() |
| web/src/main/java/com/navercorp/pinpoint/web/calltree/span/MetaSpanCallTreeFactory.java | Consolidate annotations list creation in unknown and corrupted methods |
| web/src/main/java/com/navercorp/pinpoint/web/calltree/span/CallTreeIterator.java | Pre-size values list using nodes.size() |
| web/src/main/java/com/navercorp/pinpoint/web/applicationmap/map/VirtualLinkHandler.java | Change helper return type to Collection and guard logger.trace calls |
40cfe8e to
a910ee4
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #12475 +/- ##
============================================
- Coverage 33.59% 33.59% -0.01%
- Complexity 10738 10740 +2
============================================
Files 3941 3941
Lines 91809 91809
Branches 9551 9553 +2
============================================
- Hits 30846 30844 -2
- Misses 58328 58332 +4
+ Partials 2635 2633 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
a910ee4 to
9ce77bc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request focuses on improving code efficiency, readability, and logging throughout the
webmodule. The most significant changes include optimizing the initialization of collections, enhancing logging for debugging, and improving consistency in method return types.Code efficiency improvements:
ArrayListinstances to include initial capacity where applicable, improving memory allocation efficiency inCallTreeIterator,Node, andMetaSpanCallTreeFactory. ([[1]](https://github.com/pinpoint-apm/pinpoint/pull/12475/files#diff-eb3a3e58cc17eeca043134aebe7207eee60f725b5e5d6d30cf189304e0672e39L248-R248),[[2]](https://github.com/pinpoint-apm/pinpoint/pull/12475/files#diff-90618b20ad38a7a731382592e26581870901eda13a5e43700a62d148c712502bL141-R141),[[3]](https://github.com/pinpoint-apm/pinpoint/pull/12475/files#diff-7fc61eafdca60bd93e071196758b677a2102b10cb460bb11abcf02e003c332afL52-R59),[[4]](https://github.com/pinpoint-apm/pinpoint/pull/12475/files#diff-7fc61eafdca60bd93e071196758b677a2102b10cb460bb11abcf02e003c332afL77-R86))ArrayListby removing redundant type arguments inProxyRequestTypeRegistryServiceImpl. ([web/src/main/java/com/navercorp/pinpoint/web/service/ProxyRequestTypeRegistryServiceImpl.javaL78-R78](https://github.com/pinpoint-apm/pinpoint/pull/12475/files#diff-bdc7a6f08ff84d6c2b1f1e6772a35b065cdb71bf23ad9b916234d41780291e0aL78-R78))Method return type consistency:
getUnpopulatedEmulatedNodesfromListtoCollectioninVirtualLinkHandlerto better reflect the method's implementation and usage. ([[1]](https://github.com/pinpoint-apm/pinpoint/pull/12475/files#diff-a7126b4b2e85315a3bad368e2fdf2a44e7d859984c3ef004816fd3da987426c2L62-R62),[[2]](https://github.com/pinpoint-apm/pinpoint/pull/12475/files#diff-a7126b4b2e85315a3bad368e2fdf2a44e7d859984c3ef004816fd3da987426c2L78-R86))Logging enhancements:
logger.isTraceEnabled()before trace-level logging inVirtualLinkHandlerto avoid unnecessary string concatenation when trace logging is disabled. ([web/src/main/java/com/navercorp/pinpoint/web/applicationmap/map/VirtualLinkHandler.javaR98-R107](https://github.com/pinpoint-apm/pinpoint/pull/12475/files#diff-a7126b4b2e85315a3bad368e2fdf2a44e7d859984c3ef004816fd3da987426c2R98-R107))