UTBotJava
UTBotJava copied to clipboard
Refactor addAnnotation method for AnnotationTarget=Field
Description
Currently the discussed method looks as follows:
private fun addAnnotation(annotation: CgAnnotation) {
when (annotation.target) {
AnnotationTarget.Method -> collectedMethodAnnotations.add(annotation)
AnnotationTarget.Class -> currentTestClassContext.collectedTestClassAnnotations.add(annotation)
// TODO: possibly introduce some scope cache like in methods and constructions processing.
// It may allow to avoid return type in CgAnnotation method.
AnnotationTarget.Field -> { }
}
importIfNeeded(annotation.classId)
}
The mentioned TODO need to be fixed.
After that, it will be possible to make addAnnotation method return void that is better from the point of view of design.