Skip to content

Commit bd5da87

Browse files
author
crypticminds
committed
"[Bug fix] : Fixed a bug due to which the generated file was incorrect"
1 parent 736d164 commit bd5da87

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

coldstoragecompiler/src/main/java/com/arcane/coldstorage_compiler/AnnotationProcessor.kt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import com.arcane.coldstorageannotation.Refrigerate
44
import com.google.auto.service.AutoService
55
import com.squareup.kotlinpoet.*
66
import com.squareup.kotlinpoet.ParameterizedTypeName.Companion.parameterizedBy
7-
87
import java.io.File
98
import java.util.stream.Collectors
109
import javax.annotation.processing.*
@@ -24,6 +23,15 @@ import kotlin.reflect.jvm.internal.impl.name.FqName
2423
@SupportedOptions(FileGenerator.KAPT_KOTLIN_GENERATED_OPTION_NAME)
2524
class FileGenerator : AbstractProcessor() {
2625

26+
private lateinit var processingEnvironment: ProcessingEnvironment
27+
28+
private val methods: MutableList<FunSpec> = arrayListOf()
29+
30+
override fun init(pe: ProcessingEnvironment?) {
31+
super.init(pe)
32+
processingEnvironment = pe!!
33+
}
34+
2735
/**
2836
* Set the supported annotation types.
2937
*/
@@ -56,7 +64,6 @@ class FileGenerator : AbstractProcessor() {
5664
Refrigerate::class.java
5765
)
5866

59-
val methods: MutableList<FunSpec> = arrayListOf()
6067
annotatedElements?.forEach { element ->
6168
methods.add(
6269
generateWrapperMethod(

0 commit comments

Comments
 (0)