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

deps: update jackson to v2.18.0 #9209

Merged
merged 3 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ freemarker = "2.3.33"
greenmail = "2.0.1"
hikari = "6.0.0"
hoplite = "2.7.5"
jackson = "2.17.2"
jackson = "2.18.0"
jakartaMail = "2.0.1"
jgit = "6.10.0.202406032230-r"
jiraRestClient = "5.2.7"
Expand Down
10 changes: 5 additions & 5 deletions model/src/main/kotlin/DependencyGraph.kt
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,14 @@ data class DependencyGraph(
* list, there can be multiple nodes for a single package. The order of nodes in this list is relevant; the
* edges of the graph reference their nodes by numeric indices.
*/
val nodes: List<DependencyGraphNode>? = null,
val nodes: List<DependencyGraphNode> = emptyList(),

/**
* A set with the edges of this dependency graph. By traversing the edges, the dependencies of packages can be
* determined.
*/
@JsonSerialize(converter = DependencyGraphEdgeSortedSetConverter::class)
val edges: Set<DependencyGraphEdge>? = null
val edges: Set<DependencyGraphEdge> = emptySet()
) {
companion object {
/**
Expand Down Expand Up @@ -187,7 +187,7 @@ data class DependencyGraph(
*/
private fun constructReferenceMapping(): Map<String, PackageReference> {
val refMapping = mutableMapOf<String, PackageReference>()
val allNodes = nodes ?: scopeRoots.map(DependencyReference::toGraphNode)
val allNodes = nodes.takeUnless { it.isEmpty() } ?: scopeRoots.map(DependencyReference::toGraphNode)

allNodes.forEach { constructReferenceTree(it, refMapping) }

Expand Down Expand Up @@ -222,7 +222,7 @@ data class DependencyGraph(
*/
private fun constructNodeDependencies(): NodeDependencies =
when {
nodes != null && edges != null -> constructNodeDependenciesFromGraph(nodes, edges)
nodes.isNotEmpty() -> constructNodeDependenciesFromGraph(nodes, edges)
else -> constructNodeDependenciesFromScopeRoots(scopeRoots)
}

Expand All @@ -247,7 +247,7 @@ data class DependencyGraph(
addIssues(ref)
}

nodes?.forEach { node ->
nodes.forEach { node ->
addIssues(node.pkg, node.issues)
}

Expand Down
20 changes: 5 additions & 15 deletions model/src/test/kotlin/utils/DependencyGraphBuilderTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import io.kotest.matchers.collections.containExactlyInAnyOrder
import io.kotest.matchers.collections.shouldContainExactly
import io.kotest.matchers.collections.shouldContainExactlyInAnyOrder
import io.kotest.matchers.collections.shouldHaveSize
import io.kotest.matchers.nulls.shouldNotBeNull
import io.kotest.matchers.should
import io.kotest.matchers.shouldBe
import io.kotest.matchers.string.shouldContain
Expand Down Expand Up @@ -59,13 +58,8 @@ class DependencyGraphBuilderTest : WordSpec({
.build()

graph.scopeRoots should beEmpty()
graph.nodes shouldNotBeNull {
this shouldHaveSize 3
}

graph.edges shouldNotBeNull {
this should beEmpty()
}
graph.nodes shouldHaveSize 3
graph.edges should beEmpty()

val scopes = graph.createScopes()

Expand Down Expand Up @@ -136,10 +130,8 @@ class DependencyGraphBuilderTest : WordSpec({
.build()
val scopes = graph.createScopes()

graph.nodes shouldNotBeNull {
this shouldHaveSize 5
all { it.fragment == 0 } shouldBe true
}
graph.nodes shouldHaveSize 5
graph.nodes.all { it.fragment == 0 } shouldBe true

scopeDependencies(scopes, scope1) shouldBe setOf(dep1, dep3, dep5)
scopeDependencies(scopes, scope2) shouldBe setOf(dep1, dep2, dep4)
Expand Down Expand Up @@ -217,9 +209,7 @@ class DependencyGraphBuilderTest : WordSpec({

scopeDependencies(scopes, scope) shouldContainExactly listOf(depCyc2)

graph.nodes shouldNotBeNull {
this shouldHaveSize 3
}
graph.nodes shouldHaveSize 3
}

"check for illegal references when building the graph" {
Expand Down
7 changes: 2 additions & 5 deletions model/src/test/kotlin/utils/DependencyGraphConverterTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ class DependencyGraphConverterTest : WordSpec({
graph.dependencies[node]?.forEach(::collectIssues)
}

graph.nodes?.forEach(::collectIssues)
graph.nodes.forEach(::collectIssues)
issues shouldNot beEmpty()
}

Expand All @@ -181,10 +181,7 @@ class DependencyGraphConverterTest : WordSpec({
val convertedResult = DependencyGraphConverter.convert(mixedResult)

convertedResult.dependencyGraphs["Gradle"] shouldNotBeNull {
nodes shouldNotBeNull {
this shouldNot beEmpty()
}

nodes shouldNot beEmpty()
scopes.keys shouldNot beEmpty()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import io.kotest.matchers.collections.haveSize
import io.kotest.matchers.collections.shouldContainExactlyInAnyOrder
import io.kotest.matchers.collections.shouldHaveSize
import io.kotest.matchers.nulls.beNull
import io.kotest.matchers.nulls.shouldNotBeNull
import io.kotest.matchers.should
import io.kotest.matchers.shouldBe
import io.kotest.matchers.string.contain
Expand Down Expand Up @@ -80,9 +79,7 @@ class GradleDependencyHandlerTest : WordSpec({
.addDependency(scope2, dep1)
.build()

graph.nodes shouldNotBeNull {
this shouldHaveSize 3
}
graph.nodes shouldHaveSize 3

val scopes = graph.createScopes()
scopes.map { it.name } should containExactlyInAnyOrder(scope1, scope2)
Expand Down Expand Up @@ -174,10 +171,8 @@ class GradleDependencyHandlerTest : WordSpec({
.build()

graph.scopeRoots should beEmpty()
graph.nodes shouldNotBeNull {
this shouldHaveSize 5
all { it.fragment == 0 } shouldBe true
}
graph.nodes shouldHaveSize 5
graph.nodes.all { it.fragment == 0 } shouldBe true

val scopes = graph.createScopes()
val scopeDependencies1 = scopeDependencies(scopes, scope1)
Expand Down
Loading