Skip to content

Commit

Permalink
Merge pull request #22923 from mohanvive/new-table-impl-2
Browse files Browse the repository at this point in the history
Sync master with new-table-impl branch
  • Loading branch information
mohanvive authored Apr 28, 2020
2 parents 7b244f9 + a31921e commit 485595c
Show file tree
Hide file tree
Showing 991 changed files with 80,316 additions and 8,080 deletions.
1 change: 0 additions & 1 deletion bvm/ballerina-config/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
apply from: "$rootDir/gradle/javaProject.gradle"

dependencies {
implementation project(':toml-parser')
implementation 'com.moandjiezana.toml:toml4j'
implementation 'org.wso2.orbit.org.antlr:antlr4-runtime'
implementation 'org.slf4j:slf4j-api'
Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion bvm/ballerina-rt/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ dependencies {
dist project(':ballerina-core')
dist project(':ballerina-config')
dist project(':ballerina-logging')
dist project(':toml-parser')

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,14 @@ public class BallerinaErrors {
public static final String GENERATE_PKG_START = "___start_";
public static final String GENERATE_PKG_STOP = "___stop_";
public static final String GENERATE_OBJECT_CLASS_PREFIX = ".$value$";
public static final String IS_STRING_VALUE_PROP = "ballerina.bstring";
public static final boolean USE_BSTRING = System.getProperty(IS_STRING_VALUE_PROP) != null;

@Deprecated
public static ErrorValue createError(String reason) {
if (USE_BSTRING) {
return createError(StringUtils.fromString(reason));
}
return new ErrorValue(reason, new MapValueImpl<>(BTypes.typeErrorDetail));
}

Expand All @@ -72,6 +77,9 @@ public static ErrorValue createError(BString reason) {

@Deprecated
public static ErrorValue createError(String reason, String detail) {
if (USE_BSTRING) {
return createError(StringUtils.fromString(reason), StringUtils.fromString(detail));
}
MapValueImpl<String, Object> detailMap = new MapValueImpl<>(BTypes.typeErrorDetail);
if (detail != null) {
detailMap.put(ERROR_MESSAGE_FIELD, detail);
Expand All @@ -89,14 +97,17 @@ public static ErrorValue createError(BString reason, BString detail) {

@Deprecated
public static ErrorValue createError(BType type, String reason, String detail) {
if (USE_BSTRING) {
createError(type, StringUtils.fromString(reason), StringUtils.fromString(detail));
}
MapValueImpl<String, Object> detailMap = new MapValueImpl<>(BTypes.typeErrorDetail);
if (detail != null) {
detailMap.put(ERROR_MESSAGE_FIELD, detail);
}
return new ErrorValue(type, reason, detailMap);
}

public static ErrorValue createError(BType type, BString reason, String detail) {
public static ErrorValue createError(BType type, BString reason, BString detail) {
MapValueImpl<String, Object> detailMap = new MapValueImpl<>(BTypes.typeErrorDetail);
if (detail != null) {
detailMap.put(ERROR_MESSAGE_FIELD, detail);
Expand Down
Loading

0 comments on commit 485595c

Please sign in to comment.