From 9fd70c15d887d42c9f1c98ba9e9ddd27a3806113 Mon Sep 17 00:00:00 2001 From: ShammiL Date: Mon, 18 Dec 2023 23:46:06 +0530 Subject: [PATCH 1/3] Fix sql time module resolution error --- .../internal/PackageDependencyGraphBuilder.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/compiler/ballerina-lang/src/main/java/io/ballerina/projects/internal/PackageDependencyGraphBuilder.java b/compiler/ballerina-lang/src/main/java/io/ballerina/projects/internal/PackageDependencyGraphBuilder.java index 21cd88849d9e..178c09afb116 100644 --- a/compiler/ballerina-lang/src/main/java/io/ballerina/projects/internal/PackageDependencyGraphBuilder.java +++ b/compiler/ballerina-lang/src/main/java/io/ballerina/projects/internal/PackageDependencyGraphBuilder.java @@ -327,13 +327,15 @@ private NodeStatus addNewVertex(Vertex vertex, DependencyNode newPkgDep, boolean rawGraphBuilder.add(resolvedPkgDep); } // Update the scope of dependencies - for (Vertex depVertex : depGraph.get(vertex)) { - DependencyNode dependencyNode = vertices.get(depVertex); - DependencyNode newDependencyNode = new DependencyNode(dependencyNode.pkgDesc(), resolvedPkgDep.scope(), - dependencyNode.resolutionType()); - vertices.put(depVertex, newDependencyNode); - if (resolutionOptions.dumpRawGraphs()) { - rawGraphBuilder.addDependency(resolvedPkgDep, newDependencyNode); + if (resolvedPkgDep.scope() == PackageDependencyScope.DEFAULT) { + for (Vertex depVertex : depGraph.get(vertex)) { + DependencyNode dependencyNode = vertices.get(depVertex); + DependencyNode newDependencyNode = new DependencyNode(dependencyNode.pkgDesc(), resolvedPkgDep.scope(), + dependencyNode.resolutionType()); + vertices.put(depVertex, newDependencyNode); + if (resolutionOptions.dumpRawGraphs()) { + rawGraphBuilder.addDependency(resolvedPkgDep, newDependencyNode); + } } } } From dd8ee9a5b9ca0fe6f377f2b9ea7fcd0313860825 Mon Sep 17 00:00:00 2001 From: ShammiL Date: Mon, 18 Dec 2023 23:56:05 +0530 Subject: [PATCH 2/3] Update comment for changes --- .../projects/internal/PackageDependencyGraphBuilder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/ballerina-lang/src/main/java/io/ballerina/projects/internal/PackageDependencyGraphBuilder.java b/compiler/ballerina-lang/src/main/java/io/ballerina/projects/internal/PackageDependencyGraphBuilder.java index 178c09afb116..c3c7ade79051 100644 --- a/compiler/ballerina-lang/src/main/java/io/ballerina/projects/internal/PackageDependencyGraphBuilder.java +++ b/compiler/ballerina-lang/src/main/java/io/ballerina/projects/internal/PackageDependencyGraphBuilder.java @@ -326,7 +326,7 @@ private NodeStatus addNewVertex(Vertex vertex, DependencyNode newPkgDep, boolean if (resolutionOptions.dumpRawGraphs()) { rawGraphBuilder.add(resolvedPkgDep); } - // Update the scope of dependencies + // Update the scope of dependencies only if rejected node scope is DEFAULT if (resolvedPkgDep.scope() == PackageDependencyScope.DEFAULT) { for (Vertex depVertex : depGraph.get(vertex)) { DependencyNode dependencyNode = vertices.get(depVertex); From 58cfc847be5452bc9208f149fbd3c61e631aab65 Mon Sep 17 00:00:00 2001 From: ShammiL Date: Tue, 19 Dec 2023 06:05:33 +0530 Subject: [PATCH 3/3] Fix checkstyle errors --- .../projects/internal/PackageDependencyGraphBuilder.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/ballerina-lang/src/main/java/io/ballerina/projects/internal/PackageDependencyGraphBuilder.java b/compiler/ballerina-lang/src/main/java/io/ballerina/projects/internal/PackageDependencyGraphBuilder.java index c3c7ade79051..ca46468fc549 100644 --- a/compiler/ballerina-lang/src/main/java/io/ballerina/projects/internal/PackageDependencyGraphBuilder.java +++ b/compiler/ballerina-lang/src/main/java/io/ballerina/projects/internal/PackageDependencyGraphBuilder.java @@ -330,8 +330,8 @@ private NodeStatus addNewVertex(Vertex vertex, DependencyNode newPkgDep, boolean if (resolvedPkgDep.scope() == PackageDependencyScope.DEFAULT) { for (Vertex depVertex : depGraph.get(vertex)) { DependencyNode dependencyNode = vertices.get(depVertex); - DependencyNode newDependencyNode = new DependencyNode(dependencyNode.pkgDesc(), resolvedPkgDep.scope(), - dependencyNode.resolutionType()); + DependencyNode newDependencyNode = new DependencyNode(dependencyNode.pkgDesc(), + resolvedPkgDep.scope(), dependencyNode.resolutionType()); vertices.put(depVertex, newDependencyNode); if (resolutionOptions.dumpRawGraphs()) { rawGraphBuilder.addDependency(resolvedPkgDep, newDependencyNode);