```abstract class MemoryCache<T> { priv...
# detekt
e
Copy code
abstract class MemoryCache<T> {

    private val cachedValue = AtomicReference<T>()

    fun getOrEmpty(): Maybe<T> = Maybe.fromCallable { cachedValue.get() }

    fun set(value: T) {
        this.cachedValue.set(value)
    }

    fun invalidate() {
        cachedValue.set(null)
    }
}
This class has concrete methods
m
In this case, it's referring to the second recommendation.
Abstract classes which do not define any 
abstract
 members should instead be refactored into concrete classes.
👍 1
If you made it abstract because you don't want it instantiated directly, but it is used as a parent class, then add an
@Suppress("UnnecessaryAbstractClass")
to the class, and Detekt will not report that issue.
e
It is exactly abstract because I don’t want to instantiate it
thanks
I probably will disable this rule at all
y
Why not use an interface with default implementations?
👍 1
m
That's also a good suggestion. If you're on JDK8, don't forget to add the @JvmDefault annotation to it, too, so that the compiler will generated the bytecode.
2