Refactor Phase 2: HashSet types, leaking naming, subLeakedByParent map - foundLeakingObjectIds / unprocessedLeakingIds: use HashSet<Long> instead of LongScatterSet (simpler API, .size not .size(), isNotEmpty() etc.) - Rename all 'seed' variables to 'leaking' (currentLeakingId, unprocessedLeakingIds) for clarity - Rename subLeakedObjectPaths → subLeakedObjectsByParentLeakedObject in PathFindingResults, PrioritizingShortestPathFinder, RealLeakTracerFactory - Track sub-leaked objects as subLeakedByParent: Map<Long, Long> (sub-leaked id → parent leaked id) internally; group into Map<Long, List<Long>> just before return - Move break@bfsLoop (early exit when last sub-leaked found) before visitedSet.add so we don't visit unnecessary objects - Sub-leaked branch falls through to the visitedSet/bfsQueue code below instead of duplicating it - break/continue always on their own line for readability Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
A memory leak detection library for Android.
🙏 If you like LeakCanary you can show support by starring ⭐ this repository.
Copyright 2015 Square, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.