Skip to content

Commit

Permalink
fix various warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredsburrows committed Jul 30, 2024
1 parent 2498e05 commit a30c209
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class VersionsPlugin : Plugin<Project> {
requireSupportedSaxParser()

val tasks = project.tasks
if (!tasks.getNames().contains("dependencyUpdates")) {
if (!tasks.names.contains("dependencyUpdates")) {
tasks.register("dependencyUpdates", DependencyUpdatesTask::class.java)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class XmlReporter(
) {
val documentBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder()
val document = documentBuilder.newDocument()
document.setXmlStandalone(true)
document.xmlStandalone = true

val response = document.createElement("response")
document.appendChild(response)
Expand Down Expand Up @@ -79,7 +79,7 @@ class XmlReporter(
val dependencies = document.createElement("dependencies")
outdated.appendChild(dependencies)
for (dependency in result.outdated.dependencies) {
var element = writeDependency(document, dependencies, "outdatedDependency", dependency)
val element = writeDependency(document, dependencies, "outdatedDependency", dependency)
writeVersionAvailable(document, element, dependency.available)
}
}
Expand Down Expand Up @@ -109,7 +109,7 @@ class XmlReporter(
val dependencies = document.createElement("dependencies")
exceeded.appendChild(dependencies)
for (dependency in result.exceeded.dependencies) {
var element = writeDependency(document, dependencies, "exceededDependency", dependency)
val element = writeDependency(document, dependencies, "exceededDependency", dependency)
appendTextChild(document, element, "latest", dependency.latest)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,14 @@ class Coordinate(
groupId: String?,
artifactId: String?,
version: String?,
userReason: String? = null,
val userReason: String? = null,
) : Comparable<Coordinate> {
val groupId: String
val artifactId: String
val version: String
val userReason: String?
val groupId: String = groupId ?: "none"
val artifactId: String = artifactId ?: "none"
val version: String = version ?: "none"
val key: Key
get() = Key(groupId, artifactId)

init {
this.groupId = groupId ?: "none"
this.artifactId = artifactId ?: "none"
this.version = version ?: "none"
this.userReason = userReason
}

override fun toString(): String {
return "$groupId:$artifactId:$version"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ open class DependencyUpdatesTask : DefaultTask() { // tasks can't be final

@Internal
@Nullable
var resolutionStrategy: Closure<*>? = null
var resolutionStrategy: Closure<Any>? = null

@Nullable
private var resolutionStrategyAction: Action<in ResolutionStrategyWithCurrent>? = null
Expand Down

0 comments on commit a30c209

Please sign in to comment.