fix: Moving from List datastructure to Set to reduce the number of array list creations.#37963
fix: Moving from List datastructure to Set to reduce the number of array list creations.#37963trishaanand wants to merge 1 commit intoreleasefrom
Conversation
…ray list creations.
WalkthroughThe changes in this pull request focus on the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Outside diff range and nitpick comments (1)
app/server/appsmith-server/src/main/java/com/appsmith/server/onload/internal/OnLoadExecutablesUtilCEImpl.java (1)
Line range hint
704-712: Simplify Addition to 'allBindings'Since
allBindingsis aSet<String>, adding bindings inside the inner loop is acceptable but can be simplified. Consider adding all bindings frombindingsInWidgetdirectly toallBindingsto enhance readability.You can replace the inner loop with:
allBindings.addAll(bindingsInWidget);
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (1)
app/server/appsmith-server/src/main/java/com/appsmith/server/onload/internal/OnLoadExecutablesUtilCEImpl.java(5 hunks)
🔇 Additional comments (2)
app/server/appsmith-server/src/main/java/com/appsmith/server/onload/internal/OnLoadExecutablesUtilCEImpl.java (2)
669-671: Verify the Impact of Changing 'bindings' from List to Set
Converting the bindings parameter from List<String> to Set<String> and then to a List with new ArrayList<>(bindings) may affect the order of elements and remove duplicates. Ensure that astService.getPossibleReferencesFromDynamicBinding does not rely on element order or duplicates in the bindings list.
To confirm, please review the implementation of astService.getPossibleReferencesFromDynamicBinding and ensure that it functions correctly with a list derived from a Set<String>.
528-528: Ensure Consistency with 'bindings' Type Change
After changing the type of bindings to Set<String>, verify that all method calls and internal logic that use bindings are updated accordingly. This includes ensuring that any methods that expect a List<String> receive the correct type.
Please audit the methods that interact with bindings to ensure type consistency and prevent potential runtime issues.
| widgetBindingEntries.getValue(), entityTypes, evalVersion) | ||
| .map(possibleParentsMap -> { | ||
| possibleParentsMap.entrySet().stream().forEach(entry -> { | ||
| if (entry.getValue() == null || entry.getValue().isEmpty()) { |
There was a problem hiding this comment.
Prevent Potential NullPointerException
At line 1226, calling trim() on widgetBindingEntries.getKey() may result in a NullPointerException if the key is null. Ensure that the key is not null before trimming.
Consider adding a null check:
String widgetPath = widgetBindingEntries.getKey();
if (widgetPath != null) {
widgetPath = widgetPath.trim();
}
Failed server tests
|
1 similar comment
Failed server tests
|
…
Description
Tip
Add a TL;DR when the description is longer than 500 words or extremely technical (helps the content, marketing, and DevRel team).
Please also include relevant motivation and context. List any dependencies that are required for this change. Add links to Notion, Figma or any other documents that might be relevant to the PR.
Fixes #
Issue Numberor
Fixes
Issue URLWarning
If no issue exists, please create an issue first, and check with the maintainers if the issue is valid.
Automation
/test all
🔍 Cypress test results
Caution
🔴 🔴 🔴 Some tests have failed.
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/12174449514
Commit: 76a3273
Cypress dashboard.
Tags: @tag.All
Spec:
The following are new failures, please fix them before merging the PR:
- cypress/e2e/Regression/ClientSide/FormLogin/EnableFormLogin_spec.js
- cypress/e2e/Regression/ClientSide/Linting/BasicLint_spec.ts
List of identified flaky tests.Thu, 05 Dec 2024 07:32:08 UTC
Communication
Should the DevRel and Marketing teams inform users about this change?
Summary by CodeRabbit
Bug Fixes
New Features
Documentation