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

Fixs some code smells #463

Merged
merged 1 commit into from
May 5, 2021
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
4 changes: 2 additions & 2 deletions src/main/kotlin/io/quarkus/code/rest/CodeQuarkusResource.kt
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class CodeQuarkusResource {
@Produces(APPLICATION_JSON)
@Operation(summary = "Prepare a Quarkus application project to be downloaded")
fun project(@Valid projectDefinition: ProjectDefinition?): CreatedProject {
val params = ArrayList<NameValuePair>();
val params = ArrayList<NameValuePair>()
if (projectDefinition != null) {
if(projectDefinition.groupId != ProjectDefinition.DEFAULT_GROUPID) {
params.add(BasicNameValuePair("g", projectDefinition.groupId))
Expand All @@ -119,7 +119,7 @@ class CodeQuarkusResource {
if(projectDefinition.noExamples != ProjectDefinition.DEFAULT_NO_EXAMPLES) {
params.add(BasicNameValuePair("ne", projectDefinition.noExamples.toString()))
}
if(!projectDefinition.extensions.isEmpty()) {
if(projectDefinition.extensions.isNotEmpty()) {
projectDefinition.extensions.forEach { params.add(BasicNameValuePair("e", it)) }
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ class QuarkusExtensionCatalogService {
private val LOG = Logger.getLogger(QuarkusExtensionCatalogService::class.java.name)

@JvmStatic
internal val platformGroupId = ConfigProviderResolver.instance().getConfig().getOptionalValue("io.quarkus.code.quarkus-platform.group-id", String::class.java).orElse("io.quarkus")
internal val platformGroupId = ConfigProviderResolver.instance().config.getOptionalValue("io.quarkus.code.quarkus-platform.group-id", String::class.java).orElse("io.quarkus")

@JvmStatic
internal val platformArtifactId = ConfigProviderResolver.instance().getConfig().getOptionalValue("io.quarkus.code.quarkus-platform.artifact-id", String::class.java).orElse("quarkus-universe-bom")
internal val platformArtifactId = ConfigProviderResolver.instance().config.getOptionalValue("io.quarkus.code.quarkus-platform.artifact-id", String::class.java).orElse("quarkus-universe-bom")

@JvmStatic
internal val platformVersion = ConfigProviderResolver.instance().getConfig().getValue("io.quarkus.code.quarkus-platform.version", String::class.java)
internal val platformVersion = ConfigProviderResolver.instance().config.getValue("io.quarkus.code.quarkus-platform.version", String::class.java)

@JvmStatic
internal val bundledQuarkusVersion = ConfigProviderResolver.instance().getConfig().getValue("io.quarkus.code.quarkus-version", String::class.java)
internal val bundledQuarkusVersion = ConfigProviderResolver.instance().config.getValue("io.quarkus.code.quarkus-version", String::class.java)

@JvmStatic
internal val catalog = ToolsUtils.resolvePlatformDescriptorDirectly(platformGroupId, platformArtifactId, platformVersion, QuarkusProjectHelper.artifactResolver(), QuarkusProjectHelper.messageWriter())
Expand All @@ -49,9 +49,6 @@ class QuarkusExtensionCatalogService {
@Inject
lateinit var config: CodeQuarkusConfig

@Inject
lateinit var platformConfig: QuarkusPlatformConfig
ia3andy marked this conversation as resolved.
Show resolved Hide resolved

@Inject
lateinit var extensionProcessorConfig: ExtensionProcessorConfig

Expand All @@ -75,7 +72,7 @@ class QuarkusExtensionCatalogService {
fun checkAndMergeExtensions(extensionsIds: Set<String>?, rawShortExtensions: String?): Set<String> {
val fromId = (extensionsIds ?: setOf())
.stream()
.filter { !it.isBlank() }
.filter { it.isNotBlank() }
.map { findById(it) }
.collect(Collectors.toSet())
val fromShortId = parseShortExtensions(rawShortExtensions).stream()
Expand All @@ -100,7 +97,7 @@ class QuarkusExtensionCatalogService {
return if (shortExtension.isNullOrBlank()) {
setOf()
} else {
shortExtension.split(".").filter { !it.isBlank() }.toSet()
shortExtension.split(".").filter { it.isNotBlank() }.toSet()
}
}

Expand Down