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

Allow ambiguous target types with cloneWithType and fromJsonWithType #37622

Conversation

Nadeeshan96
Copy link
Contributor

Purpose

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

$title
Same behaviour is also applied for convertJSON method which is used in io.ballerina.runtime.api.utils.JsonUtils
Fixes #36986

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.

Also fixed float to decimal conversion. Java API suggests to use valueOf method to create a java BigDecimal using java Double.

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 5, 2022
@codecov
Copy link

codecov bot commented Sep 5, 2022

Codecov Report

Merging #37622 (77cd2f5) into master (9926506) will decrease coverage by 2.69%.
The diff coverage is 96.55%.

@@             Coverage Diff              @@
##             master   #37622      +/-   ##
============================================
- Coverage     74.78%   72.08%   -2.70%     
+ Complexity    50638    48948    -1690     
============================================
  Files          3346     3346              
  Lines        194612   194566      -46     
  Branches      25545    25533      -12     
============================================
- Hits         145537   140255    -5282     
- Misses        40684    46388    +5704     
+ Partials       8391     7923     -468     
Impacted Files Coverage Δ
...ava/io/ballerina/runtime/internal/TypeChecker.java 77.70% <ø> (-0.07%) ⬇️
.../ballerina/runtime/internal/JsonInternalUtils.java 35.64% <85.71%> (+8.80%) ⬆️
...onfigurable/providers/toml/ConfigValueCreator.java 98.17% <85.71%> (-0.60%) ⬇️
...a/io/ballerina/runtime/internal/TypeConverter.java 63.19% <98.30%> (-3.80%) ⬇️
...rnal/configurable/providers/toml/TomlProvider.java 92.37% <100.00%> (+0.02%) ⬆️
...allerina/runtime/internal/values/DecimalValue.java 59.55% <100.00%> (ø)
...org/ballerinalang/langlib/value/CloneWithType.java 91.45% <100.00%> (+0.46%) ⬆️
.../ballerinalang/langlib/value/FromJsonWithType.java 88.49% <100.00%> (ø)
...rg/ballerinalang/debugadapter/DebugSourceType.java 0.00% <0.00%> (-100.00%) ⬇️
...g/ballerinalang/debugadapter/DebugInstruction.java 0.00% <0.00%> (-100.00%) ⬇️
... and 220 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

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

@warunalakshitha warunalakshitha merged commit dee9e5b into ballerina-platform:master Sep 21, 2022
@Nadeeshan96 Nadeeshan96 deleted the master-36968-any-first-match branch October 19, 2022 07:24
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.

Handle ambiguities with fromJsonWithType
3 participants