Fix out of memory issue caused by iterative calls#518
Fix out of memory issue caused by iterative calls#518ChinthakaJ98 merged 1 commit intowso2:mi-ext-alpha-releasefrom
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
|
||
| public void addDependency(String path, Dependency dependency) { | ||
|
|
||
| if (path != null && dependency != null) { | ||
| dependencyMap.put(path, dependency); | ||
| cachedDependencyMap.put(path, dependency); | ||
| } |
There was a problem hiding this comment.
Log Improvement Suggestion No: 1
| public void addDependency(String path, Dependency dependency) { | |
| if (path != null && dependency != null) { | |
| dependencyMap.put(path, dependency); | |
| cachedDependencyMap.put(path, dependency); | |
| } | |
| public void addDependency(String path, Dependency dependency) { | |
| if (path != null && dependency != null) { | |
| cachedDependencyMap.put(path, dependency); | |
| log.debug("Added dependency for path: {}", path); | |
| } |
| public void addToVisitedPaths(String path) { | ||
|
|
||
| if (path != null) { | ||
| visitedPathSet.add(path); | ||
| } | ||
| } |
There was a problem hiding this comment.
Log Improvement Suggestion No: 2
| public void addToVisitedPaths(String path) { | |
| if (path != null) { | |
| visitedPathSet.add(path); | |
| } | |
| } | |
| public void addToVisitedPaths(String path) { | |
| if (path != null) { | |
| visitedPathSet.add(path); | |
| log.debug("Path marked as visited: {}", path); | |
| } |
| @@ -52,8 +52,12 @@ public class DependencyVisitorUtils { | |||
| public static Dependency visitSequence(String projectPath, String sequenceName, DependencyLookUp dependencyLookUp) { | |||
|
|
|||
| String inSequencePath = DependencyVisitorUtils.getDependencyPath(sequenceName, "sequences", projectPath); | |||
There was a problem hiding this comment.
Log Improvement Suggestion No: 3
| String inSequencePath = DependencyVisitorUtils.getDependencyPath(sequenceName, "sequences", projectPath); | |
| String inSequencePath = DependencyVisitorUtils.getDependencyPath(sequenceName, "sequences", projectPath); | |
| log.debug("Looking up dependency path for sequence: {}", sequenceName); |
| if (dependencyLookUp.isVisited(inSequencePath)) { | ||
| return null; |
There was a problem hiding this comment.
Log Improvement Suggestion No: 4
| if (dependencyLookUp.isVisited(inSequencePath)) { | |
| return null; | |
| if (dependencyLookUp.isVisited(inSequencePath)) { | |
| log.debug("Sequence already visited: {}", inSequencePath); | |
| return null; |
| protected void visitFilter(Filter node) { | ||
|
|
||
| addAnonymousOrAttributeSequence(node.getThen().getMediatorList(), node.getThen().getSequence()); | ||
| addAnonymousOrAttributeSequence(node.getElse_().getMediatorList(), node.getElse_().getSequence()); | ||
| if (node.getThen() != null) { | ||
| addAnonymousOrAttributeSequence(node.getThen().getMediatorList(), node.getThen().getSequence()); | ||
| } | ||
| if (node.getElse_() != null) { | ||
| addAnonymousOrAttributeSequence(node.getElse_().getMediatorList(), node.getElse_().getSequence()); | ||
| } | ||
| } |
There was a problem hiding this comment.
Log Improvement Suggestion No: 5
| protected void visitFilter(Filter node) { | |
| addAnonymousOrAttributeSequence(node.getThen().getMediatorList(), node.getThen().getSequence()); | |
| addAnonymousOrAttributeSequence(node.getElse_().getMediatorList(), node.getElse_().getSequence()); | |
| if (node.getThen() != null) { | |
| addAnonymousOrAttributeSequence(node.getThen().getMediatorList(), node.getThen().getSequence()); | |
| } | |
| if (node.getElse_() != null) { | |
| addAnonymousOrAttributeSequence(node.getElse_().getMediatorList(), node.getElse_().getSequence()); | |
| } | |
| } | |
| protected void visitFilter(Filter node) { | |
| if (node.getThen() != null) { | |
| log.debug("Processing 'then' branch of Filter mediator"); | |
| addAnonymousOrAttributeSequence(node.getThen().getMediatorList(), node.getThen().getSequence()); | |
| } else { | |
| log.warn("Filter mediator has null 'then' branch"); | |
| } | |
| if (node.getElse_() != null) { | |
| log.debug("Processing 'else' branch of Filter mediator"); | |
| addAnonymousOrAttributeSequence(node.getElse_().getMediatorList(), node.getElse_().getSequence()); | |
| } |
There was a problem hiding this comment.
AI Agent Log Improvement Checklist
- The log-related comments and suggestions in this review were generated by an AI tool to assist with identifying potential improvements. Purpose of reviewing the code for log improvements is to improve the troubleshooting capabilities of our products.
- Please make sure to manually review and validate all suggestions before applying any changes. Not every code suggestion would make sense or add value to our purpose. Therefore, you have the freedom to decide which of the suggestions are helpful.
✅ Before merging this pull request:
- Review all AI-generated comments for accuracy and relevance.
- Complete and verify the table below. We need your feedback to measure the accuracy of these suggestions and the value they add. If you are rejecting a certain code suggestion, please mention the reason briefly in the suggestion for us to capture it.
This PR will fix the issue wso2/mi-vscode#1416