Annotations have now retention of "RUNTIME" by default. Java retention is generated as given by kotlin annotation. Annotation rendering changed.

Annotation arguments with default values are rendered as ... if renderDefaultAnnotationArguments is true.
Tests: java retention does not taken into account by Descriptor comparator.
Java retentinon changed to kotlin retention in some tests + one new test with java retention added.
More accurate tests for intentions in byte code (visibility controlled).
This commit is contained in:
Mikhail Glukhikh
2015-07-03 12:11:08 +03:00
parent 4a27b4d614
commit 609d696202
68 changed files with 214 additions and 242 deletions
@@ -40,20 +40,26 @@ import org.jetbrains.kotlin.utils.Printer;
import org.junit.Assert;
import java.io.File;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.lang.annotation.Retention;
import java.util.*;
import static org.jetbrains.kotlin.resolve.DescriptorUtils.isEnumEntry;
import static org.jetbrains.kotlin.test.util.DescriptorValidator.ValidationVisitor.errorTypesForbidden;
public class RecursiveDescriptorComparator {
private static final Set<FqName> excludedAnnotations = new HashSet<FqName>();
static {
excludedAnnotations.add(new FqName(ExpectedLoadErrorsUtil.ANNOTATION_CLASS_NAME));
excludedAnnotations.add(new FqName(Retention.class.getName()));
}
private static final DescriptorRenderer DEFAULT_RENDERER = DescriptorRenderer.Companion.withOptions(
new Function1<DescriptorRendererOptions, Unit>() {
@Override
public Unit invoke(DescriptorRendererOptions options) {
options.setWithDefinedIn(false);
options.setExcludedAnnotationClasses(Collections.singleton(new FqName(ExpectedLoadErrorsUtil.ANNOTATION_CLASS_NAME)));
options.setExcludedAnnotationClasses(excludedAnnotations);
options.setOverrideRenderingPolicy(OverrideRenderingPolicy.RENDER_OPEN_OVERRIDE);
options.setIncludePropertyConstant(true);
options.setNameShortness(NameShortness.FULLY_QUALIFIED);