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

[Refactoring] Fix usage of rawtypes #42889

Merged
merged 5 commits into from
Sep 20, 2024

Conversation

Shadow-Devil
Copy link
Contributor

Purpose

To ensure type-safety, generics should always be filled out (= no more raw types).

Some issues I encountered:

  • Some casts could not easily be made, like converting a List<Object> to a List<String>. For this I used the approach from this Stackoverflow post to cast List<Object> -> List<?> -> List<String>.
  • Some generics can't be filled out since they are returned by a library or because of ServiceLoader.load(Service.class) which does not work with generics.
  • In TableValueImpl.entrySet() there was a type error which I could only fix with a semantic change. But I think this was a bug.

Approach

Samples

Remarks

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

Copy link

codecov bot commented Jun 9, 2024

Codecov Report

Attention: Patch coverage is 84.28571% with 33 lines in your changes missing coverage. Please review.

Please upload report for BASE (master@8100e00). Learn more about missing BASE report.
Report is 133 commits behind head on master.

Files with missing lines Patch % Lines
.../ballerina/runtime/internal/TableOmDataSource.java 0.00% 5 Missing ⚠️
...llerinalang/compiler/semantics/analyzer/Types.java 61.53% 5 Missing ⚠️
...o/ballerina/runtime/api/creators/ValueCreator.java 25.00% 3 Missing ⚠️
...ntime/transactions/TransactionResourceManager.java 0.00% 2 Missing ⚠️
...in/java/org/wso2/ballerinalang/util/RepoUtils.java 0.00% 2 Missing ⚠️
...inalang/datamapper/AIDataMapperCodeActionUtil.java 83.33% 2 Missing ⚠️
...o/ballerina/runtime/api/creators/ErrorCreator.java 50.00% 1 Missing ⚠️
.../java/io/ballerina/runtime/api/utils/XmlUtils.java 0.00% 1 Missing ⚠️
...ava/io/ballerina/runtime/internal/TypeChecker.java 50.00% 1 Missing ⚠️
...ina/runtime/internal/scheduling/SchedulerItem.java 50.00% 1 Missing ⚠️
... and 10 more
Additional details and impacted files
@@            Coverage Diff            @@
##             master   #42889   +/-   ##
=========================================
  Coverage          ?   77.51%           
  Complexity        ?    58585           
=========================================
  Files             ?     3438           
  Lines             ?   219219           
  Branches          ?    28921           
=========================================
  Hits              ?   169921           
  Misses            ?    39884           
  Partials          ?     9414           

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

@SasinduDilshara
Copy link
Contributor

@Shadow-Devil seemslike there few conflicts in the PR branch, Can you look into that?

@SasinduDilshara
Copy link
Contributor

@Shadow-Devil can you please resolve the conflicts in the PR?

@Shadow-Devil
Copy link
Contributor Author

Shadow-Devil commented Jun 13, 2024

@SasinduDilshara conflicts are resolved

@Shadow-Devil Shadow-Devil reopened this Jun 16, 2024
@Shadow-Devil Shadow-Devil reopened this Jun 17, 2024
@Shadow-Devil Shadow-Devil marked this pull request as draft June 18, 2024 22:43
@Shadow-Devil Shadow-Devil marked this pull request as ready for review June 24, 2024 11:26
@Shadow-Devil
Copy link
Contributor Author

@SasinduDilshara will you be able to review this now that all checks have passed and no more conflicts are present?
Thank you in advance

SasinduDilshara
SasinduDilshara previously approved these changes Jul 3, 2024
@Shadow-Devil Shadow-Devil changed the title Fix usage of rawtypes [Refactoring] Fix usage of rawtypes Jul 3, 2024
@Shadow-Devil
Copy link
Contributor Author

There were some merge conflicts which I have resolved

@Shadow-Devil
Copy link
Contributor Author

Could someone merge this please, since it was already approved for quite some time? Thank you in advance 😄

@Shadow-Devil
Copy link
Contributor Author

Fixed merge conflicts via rebase

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 Stale and removed Stale labels Aug 16, 2024
@Shadow-Devil Shadow-Devil force-pushed the fix-rawtypes branch 2 times, most recently from 8dbcdf9 to 9cde175 Compare August 22, 2024 13:16
Copy link

github-actions bot commented Sep 6, 2024

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 Stale and removed Stale labels Sep 6, 2024
@Shadow-Devil Shadow-Devil force-pushed the fix-rawtypes branch 4 times, most recently from 5c4fe9d to d410682 Compare September 14, 2024 10:33
@gimantha
Copy link
Contributor

@Shadow-Devil Still the windows build pipeline is failing

@Shadow-Devil
Copy link
Contributor Author

With a very strange error:

The :jballerina-debugger-integration-test:jacocoMergeExec task failed.
Unable to read execution data file D:\a\ballerina-lang\ballerina-lang\tests\jballerina-debugger-integration-test\build\jacoco\debugger-runtime-test.exec
> (No message provided)

@gimantha Could you only restart the windows pipeline please?

Copy link
Contributor

@NipunaRanasinghe NipunaRanasinghe left a comment

Choose a reason for hiding this comment

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

Bindgen tool, debugger and json-to-record converter related changes LGTM

@gimantha gimantha merged commit 383e482 into ballerina-platform:master Sep 20, 2024
18 checks passed
@Shadow-Devil Shadow-Devil deleted the fix-rawtypes branch September 20, 2024 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants