Annotations used instead of List<AnnotationDescriptor>

This commit is contained in:
Andrey Breslav
2014-01-17 19:24:25 +04:00
parent 314b1e371b
commit 6ce0b9b919
91 changed files with 433 additions and 376 deletions
@@ -20,6 +20,7 @@ import com.google.common.collect.Lists;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.descriptors.FunctionDescriptor;
import org.jetbrains.jet.lang.descriptors.annotations.AnnotationDescriptor;
import org.jetbrains.jet.lang.descriptors.annotations.Annotations;
import org.jetbrains.jet.lang.psi.JetClass;
import org.jetbrains.jet.lang.psi.JetDeclaration;
import org.jetbrains.jet.lang.psi.JetFile;
@@ -45,15 +46,13 @@ public class JetTestFunctionDetector {
if (functionDescriptor == null) {
return false;
}
List<AnnotationDescriptor> annotations = functionDescriptor.getAnnotations();
if (annotations != null) {
for (AnnotationDescriptor annotation : annotations) {
// TODO ideally we should find the fully qualified name here...
JetType type = annotation.getType();
String name = type.toString();
if (name.equals("Test")) {
return true;
}
Annotations annotations = functionDescriptor.getAnnotations();
for (AnnotationDescriptor annotation : annotations) {
// TODO ideally we should find the fully qualified name here...
JetType type = annotation.getType();
String name = type.toString();
if (name.equals("Test")) {
return true;
}
}