Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move object method bodies into a separate class when original class is too large #41409

Merged
merged 31 commits into from
Nov 21, 2023

Conversation

Nadeeshan96
Copy link
Contributor

Purpose

Describe the problems, issues, or needs driving this feature/fix and include links to related issues.

$title
Fixes #41279

Approach

Describe how you are implementing the solutions along with the design details.

Samples

Provide high-level details about the samples related to this feature.

Remarks

List any other known issues, related PRs, TODO items, or any other notes related to the PR.

Check List

  • Read the Contributing Guide
  • Updated Change Log
  • Checked Tooling Support (#)
  • Added necessary tests
    • Unit Tests
    • Spec Conformance Tests
    • Integration Tests
    • Ballerina By Example Tests
  • Increased Test Coverage
  • Added necessary documentation
    • API documentation
    • Module documentation in Module.md files
    • Ballerina By Examples

@Nadeeshan96 Nadeeshan96 added the Team/jBallerina All the issues related to BIR, JVM backend code generation and runtime label Sep 19, 2023
@Nadeeshan96
Copy link
Contributor Author

Nadeeshan96 commented Sep 19, 2023

It is not good to always split the Ballerina classes because it will have unnecessary overhead. So we will only split if the jvm class will be too large (if it have more than 100 methods). In the PR, I have temperorily sent a commit to always split the class to find whether all the cases are passing for now. @NipunaRanasinghe Now the debugger tests will fail (https://scans.gradle.com/s/327ej7fmt3srq/tests/overview?outcome=FAILED).
image
We can use some criteria such as the class name to find the split classes and fix the failing tests. Then we can revert the commit and that should not result in test failures if our fix is right, and we can merge the PR.

@Nadeeshan96
Copy link
Contributor Author

Tested the fix with a service have about 400 resource functions, and it worked fine.

@codecov
Copy link

codecov bot commented Oct 18, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (7d548e5) 76.71% compared to head (35bc64f) 76.72%.
Report is 1 commits behind head on master.

Files Patch % Lines
...lang/compiler/bir/codegen/methodgen/MethodGen.java 98.11% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #41409      +/-   ##
============================================
+ Coverage     76.71%   76.72%   +0.01%     
- Complexity    52667    52686      +19     
============================================
  Files          2880     2879       -1     
  Lines        198580   198651      +71     
  Branches      25801    25808       +7     
============================================
+ Hits         152334   152421      +87     
+ Misses        37812    37800      -12     
+ Partials       8434     8430       -4     

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

@Nadeeshan96 Nadeeshan96 marked this pull request as ready for review October 19, 2023 04:08
@Nadeeshan96
Copy link
Contributor Author

Sonarcloud scan is failing due to #41539.

Copy link

This PR has been open for more than 15 days with no activity. This will be closed in 3 days unless the stale label is removed or commented.

@github-actions github-actions bot added the Stale label Nov 14, 2023
Copy link
Contributor

@warunalakshitha warunalakshitha left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 7 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

@warunalakshitha warunalakshitha merged commit 88bb122 into master Nov 21, 2023
@ThisaruGuruge ThisaruGuruge deleted the fix-file-too-large-issue-41279 branch January 18, 2024 05:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team/jBallerina All the issues related to BIR, JVM backend code generation and runtime
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: File too large error when building ballerina project
4 participants