From 7c8adba041ff0ce12201dac4d266b93585a7f6c5 Mon Sep 17 00:00:00 2001 From: hongdongni <2607159984@qq.com> Date: Fri, 19 Nov 2021 10:48:11 +0800 Subject: [PATCH 1/6] Improve GRADLE build Performance --- build.gradle | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index f5a882f1d2c3..b28a02edd084 100644 --- a/build.gradle +++ b/build.gradle @@ -12,6 +12,10 @@ plugins { apply from: "$rootDir/gradle/repositories.gradle" allprojects { + tasks.withType(JavaCompile).configureEach { + options.fork = true + } + group = project.group version = project.version @@ -127,4 +131,3 @@ task createCodeCoverageReport(type: JacocoReport) { copyBallerinaClassFiles.dependsOn copyExecFilesAndJavaClassFiles createCodeCoverageReport.dependsOn copyBallerinaClassFiles - From 620221f7d6d6804bade0be1a35d5afca65fb0d8c Mon Sep 17 00:00:00 2001 From: Felix Schnabel Date: Fri, 2 Aug 2024 01:26:43 +0200 Subject: [PATCH 2/6] Fixup extra `;` in profiler_output.html --- .../jballerina-tools/resources/profiler/profiler_output.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/distribution/zip/jballerina-tools/resources/profiler/profiler_output.html b/distribution/zip/jballerina-tools/resources/profiler/profiler_output.html index cfb0902cdead..0a36351d2185 100644 --- a/distribution/zip/jballerina-tools/resources/profiler/profiler_output.html +++ b/distribution/zip/jballerina-tools/resources/profiler/profiler_output.html @@ -108,7 +108,7 @@ }.balLogo { padding-left: 50px !important; padding-top: 25px !important; - object-fit: contain; !important; + object-fit: contain !important; width: 500px !important; height: auto !important; } From ef67bb49efe92f7959b6de2eb275bb385ad15b62 Mon Sep 17 00:00:00 2001 From: dilhasha Date: Thu, 22 Aug 2024 21:33:48 +0530 Subject: [PATCH 3/6] Avoid NPE during module name check --- .../src/main/java/io/ballerina/projects/ConfigReader.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/ballerina-lang/src/main/java/io/ballerina/projects/ConfigReader.java b/compiler/ballerina-lang/src/main/java/io/ballerina/projects/ConfigReader.java index 79d94c92c050..3a688369e253 100644 --- a/compiler/ballerina-lang/src/main/java/io/ballerina/projects/ConfigReader.java +++ b/compiler/ballerina-lang/src/main/java/io/ballerina/projects/ConfigReader.java @@ -137,7 +137,7 @@ private static boolean isDirectDependency(Collection moduleDep dependency.descriptor().packageName().value().equals(packageName) && (moduleName == null ? dependency.descriptor().name().moduleNamePart() == null - : dependency.descriptor().name().moduleNamePart().equals(moduleName)) + : moduleName.equals(dependency.descriptor().name().moduleNamePart())) ); } From 24536650b88567ecfa18159bf64d1176c35fe110 Mon Sep 17 00:00:00 2001 From: LakshanWeerasinghe Date: Tue, 27 Aug 2024 13:53:25 +0530 Subject: [PATCH 4/6] Update project version to 2201.11.0 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index e09886d825dd..af482c2f744f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,7 +6,7 @@ org.gradle.vfs.watch=false systemProp.scan.capture-build-logging=false systemProp.scan.capture-test-logging=false -version=2201.10.0-SNAPSHOT +version=2201.11.0-SNAPSHOT group=org.ballerinalang bootstrappedOn=1.1.0-alpha specVersion=2024R1 From bf9f9ca28d9ad2ae373679eadf438f79fbfcd331 Mon Sep 17 00:00:00 2001 From: Amith Mihiranga <39789194+lwpamihiranga@users.noreply.github.com> Date: Tue, 27 Aug 2024 23:19:44 +0530 Subject: [PATCH 5/6] Fix stackoverflow issue in ballerina shell when execute main() (#43058) --- .../ballerina/shell/parser/trials/ExpressionTrial.java | 10 ++++++++++ .../resources/testcases/getResult/errors.parse.json | 9 +++++++++ 2 files changed, 19 insertions(+) diff --git a/ballerina-shell/modules/shell-core/src/main/java/io/ballerina/shell/parser/trials/ExpressionTrial.java b/ballerina-shell/modules/shell-core/src/main/java/io/ballerina/shell/parser/trials/ExpressionTrial.java index 4f19a15fa9e9..2461be5382f7 100644 --- a/ballerina-shell/modules/shell-core/src/main/java/io/ballerina/shell/parser/trials/ExpressionTrial.java +++ b/ballerina-shell/modules/shell-core/src/main/java/io/ballerina/shell/parser/trials/ExpressionTrial.java @@ -22,6 +22,7 @@ import io.ballerina.compiler.syntax.tree.ExpressionNode; import io.ballerina.compiler.syntax.tree.Node; import io.ballerina.compiler.syntax.tree.NodeParser; +import io.ballerina.shell.parser.ParserConstants; import io.ballerina.shell.parser.TrialTreeParser; import java.util.ArrayList; @@ -57,7 +58,16 @@ public Collection parse(String source) throws ParserTrialFailedException { if (expressionNode.hasDiagnostics()) { throw new ParserTrialFailedException("Error occurred during extracting expression from the statement"); } + validateExpression(expressionNode.toSourceCode()); nodes.add(expressionNode); return nodes; } + + private void validateExpression(String expression) { + String functionName = expression.replaceAll("\\s*\\(.*", ""); + if (ParserConstants.isFunctionNameRestricted(functionName)) { + String message = String.format("Function name '%s' not allowed in Ballerina Shell.%n", functionName); + throw new InvalidMethodException(message); + } + } } diff --git a/misc/ls-extensions/modules/bal-shell-service/src/test/resources/testcases/getResult/errors.parse.json b/misc/ls-extensions/modules/bal-shell-service/src/test/resources/testcases/getResult/errors.parse.json index c1dcc5615c47..6f3921be3706 100644 --- a/misc/ls-extensions/modules/bal-shell-service/src/test/resources/testcases/getResult/errors.parse.json +++ b/misc/ls-extensions/modules/bal-shell-service/src/test/resources/testcases/getResult/errors.parse.json @@ -43,5 +43,14 @@ "metaInfo":{"definedVars":[],"moduleDclns":[]}, "consoleOut":"" } + }, + { + "source": "main()", + "result": { + "errors":["Parsing the node from the statement failed."], + "diagnostics":["Function name \u0027main\u0027 not allowed in Ballerina Shell.\n"], + "metaInfo":{"definedVars":[],"moduleDclns":[]}, + "consoleOut":"" + } } ] From d4585c85f3a20dcdb033e069194f55d17071d4a4 Mon Sep 17 00:00:00 2001 From: NipunaMadhushan Date: Mon, 2 Sep 2024 17:42:18 +0530 Subject: [PATCH 6/6] Add observe internal module as first import --- .../ballerinalang/compiler/desugar/ObservabilityDesugar.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/desugar/ObservabilityDesugar.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/desugar/ObservabilityDesugar.java index 06f5c60d1c19..48145dcddd7d 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/desugar/ObservabilityDesugar.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/desugar/ObservabilityDesugar.java @@ -67,7 +67,7 @@ void addObserveInternalModuleImport(BLangPackage pkgNode) { importDcl.alias = ASTBuilderUtil.createIdentifier(pkgNode.pos, "_"); importDcl.version = ASTBuilderUtil.createIdentifier(pkgNode.pos, ""); importDcl.symbol = packageCache.getSymbol(PackageID.OBSERVE_INTERNAL); - pkgNode.imports.add(importDcl); + pkgNode.imports.add(0, importDcl); pkgNode.symbol.imports.add(importDcl.symbol); } }