From bbea0e85851e3465a02a8885d99e7102d190a579 Mon Sep 17 00:00:00 2001 From: zavakid Date: Fri, 22 Mar 2024 11:38:56 +0800 Subject: [PATCH] refactor: code cleanup --- .../auto/pipeline/processor/AutoPipelineDescriptor.kt | 2 +- .../auto/pipeline/processor/generator/AbstractGenerator.kt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/auto-pipeline-processor/src/main/java/com/foldright/auto/pipeline/processor/AutoPipelineDescriptor.kt b/auto-pipeline-processor/src/main/java/com/foldright/auto/pipeline/processor/AutoPipelineDescriptor.kt index b7acdb7..b7299fd 100644 --- a/auto-pipeline-processor/src/main/java/com/foldright/auto/pipeline/processor/AutoPipelineDescriptor.kt +++ b/auto-pipeline-processor/src/main/java/com/foldright/auto/pipeline/processor/AutoPipelineDescriptor.kt @@ -101,7 +101,7 @@ class AutoPipelineClassDescriptor( val entityMethods = elements.getAllMembers(entityElement) .filterNotNull() - .filterIsInstance(ExecutableElement::class.java) + .filterIsInstance() .filter { it.kind == ElementKind.METHOD && it.modifiers.contains(PUBLIC) && it.modifiers.contains(ABSTRACT) } diff --git a/auto-pipeline-processor/src/main/java/com/foldright/auto/pipeline/processor/generator/AbstractGenerator.kt b/auto-pipeline-processor/src/main/java/com/foldright/auto/pipeline/processor/generator/AbstractGenerator.kt index d846f5f..0addda6 100644 --- a/auto-pipeline-processor/src/main/java/com/foldright/auto/pipeline/processor/generator/AbstractGenerator.kt +++ b/auto-pipeline-processor/src/main/java/com/foldright/auto/pipeline/processor/generator/AbstractGenerator.kt @@ -12,13 +12,13 @@ import javax.lang.model.type.TypeVariable abstract class AbstractGenerator(private val desc: AutoPipelineClassDescriptor) { companion object { - private const val indent: String = " " + private const val INDENT: String = " " } protected fun javaFileBuilder(packageName: String, typeSpec: TypeSpec): JavaFile.Builder = JavaFile.builder(packageName, typeSpec) .skipJavaLangImports(true) - .indent(indent) + .indent(INDENT) protected fun genPipelineOverrideMethods(statement: (AutoPipelineOperatorsDescriptor) -> CodeBlock): List =