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

Introduce breaking changes to toString() method #25738

Merged
merged 71 commits into from
Sep 11, 2020

Conversation

mohanvive
Copy link
Contributor

@mohanvive mohanvive commented Sep 11, 2020

Purpose

This PR introduces breaking changes to toString() method.
Please check, ballerina-platform/ballerina-spec#499 for more information.

[Update after #25753 https://github.com//pull/25753]
Please find a few examples below,

    xml argXML1 = xml `<TITLE>Empire Burlesque</TITLE>`;
    xml argXML2 = xml `<TITLE>Hide your heart</TITLE>`;
    any[] varArr = [argXML1, argXML2];

    varArr.toString() // [`<TITLE>Empire Burlesque</TITLE>`,`<TITLE>Hide your heart</TITLE>`]
    Address addr = {no: 24, country: "Sri Lanka", city: "Colombo", street: "Palm Grove"};
    addr.toString() // {"no":24,"country":"Sri Lanka","city":"Colombo","street":"Palm Grove"}
    xml argXML1 = xml `<TITLE>Empire Burlesque</TITLE>`;
    argXML1.toString() // <TITLE>Empire Burlesque</TITLE>
    public type FirstError distinct error;

    // normal error case
    error cause = error("Account not found", accountID = 123, name="Las", oop = ());
    cause.toString() // error("Account not found",accountID=123,name="Las",oop=null)

    // distinct error
    FirstError err = FirstError("Reason1", cause, detail = "Failed to get account balance");
    err.toString() // error FirstError ("Reason1",error("Account not found",accountID=123,name="Las",oop=null), detail="Failed to get account balance")

mohanvive and others added 30 commits September 9, 2020 19:24
Fix tests to sync toString change
Fix types package after toString change
Add toString() for error type
grainier and others added 7 commits September 11, 2020 14:16
Fix interop package after toString change
…ina-lang into master-new

# Conflicts:
#	tests/jballerina-unit-test/src/test/resources/test-src/javainterop/basic/object_test.bal
…a-lang into toString-cycles

# Conflicts:
#	bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/values/ErrorValue.java
@mohanvive mohanvive changed the title [WIP] Introduce breaking chances to toString() method [WIP] Introduce breaking changes to toString() method Sep 11, 2020
@mohanvive mohanvive changed the title [WIP] Introduce breaking changes to toString() method Introduce breaking changes to toString() method Sep 11, 2020
mohanvive and others added 5 commits September 11, 2020 19:06
…a-lang into master-new

# Conflicts:
#	bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/values/ArrayValueImpl.java
#	bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/values/TableValueImpl.java
gimantha
gimantha previously approved these changes Sep 11, 2020
@pcnfernando pcnfernando merged commit 4babdba into ballerina-platform:master Sep 11, 2020
@mohanvive mohanvive mentioned this pull request Sep 24, 2020
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.

5 participants