Infinite loop in Annotation Processor?
See original GitHub issueHi,
I use the Carousel feature in Epoxy in one of my RecyclerView. Since I wanted to extend it with multiple features, I decided to extend the Carousel class.
@ModelView(autoLayout = ModelView.Size.MATCH_WIDTH_WRAP_HEIGHT)
class NonSnappingCarousel(context: Context) : Carousel(context) {
// Some ModelProp properties
}
This example works fine. However, since I began having more features in that extended Carousel class, I decided to write myself a BaseCarousel class, containing many of features that other carousel subclasses could need.
I therefore decided to rewrite the exact same code as such, only moving @ModelProp
properties from one file to the other:
@ModelView(autoLayout = ModelView.Size.MATCH_WIDTH_WRAP_HEIGHT)
open class BaseCarousel(context: Context) : Carousel(context) {
// Some moved ModelProp properties
}
class NonSnappingCarousel(context: Context) : BaseCarousel(context) {
// Some non-moved ModelProp properties
}
However, the above code fails to compile without any build error. Gradle gets stuck at 7% at kaptAlphaDebugKotlin. And what is even weirder is that once I try to build that code, even if I revert my changes, Gradle would get stuck at this exact same place. To fix this, I need to kill the gradle java process running in background. After that, I’m able to build my project again, except when I bring back the specific changes mentioned above.
I tried and encountered this issue with Gradle 4.4 up to 4.8 (released this morning).
Edit:
Here is a basic example that reproduce the issue in a brand new Android project:
package com.example.test.myapplication
import android.content.Context
import android.util.AttributeSet
import com.airbnb.epoxy.Carousel
import com.airbnb.epoxy.ModelView
import com.airbnb.epoxy.TextProp
@ModelView(autoLayout = ModelView.Size.MATCH_WIDTH_WRAP_HEIGHT)
open class BaseCarousel : Carousel {
var propertyOne: CharSequence? = null
@TextProp set
constructor(context: Context?) : super(context)
constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs)
constructor(context: Context?, attrs: AttributeSet?, defStyle: Int) : super(context, attrs, defStyle)
}
// If you remove this class declaration, everything compiles correctly
@ModelView(autoLayout = ModelView.Size.MATCH_WIDTH_WRAP_HEIGHT)
class NonSnappingCarousel : BaseCarousel {
var propertyTwo: CharSequence? = null
@TextProp set
constructor(context: Context?) : super(context)
constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs)
constructor(context: Context?, attrs: AttributeSet?, defStyle: Int) : super(context, attrs, defStyle)
}
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (4 by maintainers)
Thanks a lot! I’m still traveling for the next week, but I’ll fix it after that
Fixed with https://github.com/airbnb/epoxy/pull/447