Fixing modality in fake overrides
The modality was nondeterministic before. The main change sits in OverrideResolver: the logic of "fake override" generation is restructured so that all the descriptors a newly created "fake" one overrides are known by the time it is created, so its modality can be determined properly from their modalities. Also, the ReadJavaBinaryClassTestGenerated is now a clear JUnit3 test case
This commit is contained in:
+1
-1
@@ -51,5 +51,5 @@ public interface CallableMemberDescriptor extends CallableDescriptor, MemberDesc
|
||||
Kind getKind();
|
||||
|
||||
@NotNull
|
||||
CallableMemberDescriptor copy(DeclarationDescriptor newOwner, boolean makeNonAbstract, boolean makeInvisible, Kind kind, boolean copyOverrides);
|
||||
CallableMemberDescriptor copy(DeclarationDescriptor newOwner, Modality modality, boolean makeInvisible, Kind kind, boolean copyOverrides);
|
||||
}
|
||||
|
||||
+1
-1
@@ -108,7 +108,7 @@ public class ConstructorDescriptorImpl extends FunctionDescriptorImpl implements
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public ConstructorDescriptor copy(DeclarationDescriptor newOwner, boolean makeNonAbstract, boolean makeInvisible, Kind kind, boolean copyOverrides) {
|
||||
public ConstructorDescriptor copy(DeclarationDescriptor newOwner, Modality modality, boolean makeInvisible, Kind kind, boolean copyOverrides) {
|
||||
throw new UnsupportedOperationException("Constructors should not be copied for overriding");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,5 +42,5 @@ public interface FunctionDescriptor extends CallableMemberDescriptor {
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
FunctionDescriptor copy(DeclarationDescriptor newOwner, boolean makeNonAbstract, boolean makeInvisible, Kind kind, boolean copyOverrides);
|
||||
FunctionDescriptor copy(DeclarationDescriptor newOwner, Modality modality, boolean makeInvisible, Kind kind, boolean copyOverrides);
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ package org.jetbrains.jet.lang.descriptors;
|
||||
* @author abreslav
|
||||
*/
|
||||
public enum Modality {
|
||||
// THE ORDER OF ENTRIES MATTERS HERE
|
||||
FINAL(false),
|
||||
OPEN(true),
|
||||
ABSTRACT(true);
|
||||
@@ -33,7 +34,7 @@ public enum Modality {
|
||||
public boolean isOverridable() {
|
||||
return overridable;
|
||||
}
|
||||
|
||||
|
||||
public static Modality convertFromFlags(boolean _abstract, boolean open) {
|
||||
if (_abstract) return ABSTRACT;
|
||||
if (open) return OPEN;
|
||||
|
||||
+1
-1
@@ -123,7 +123,7 @@ public abstract class PropertyAccessorDescriptor extends DeclarationDescriptorNo
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public PropertyAccessorDescriptor copy(DeclarationDescriptor newOwner, boolean makeNonAbstract, boolean makeInvisible, Kind kind, boolean copyOverrides) {
|
||||
public PropertyAccessorDescriptor copy(DeclarationDescriptor newOwner, Modality modality, boolean makeInvisible, Kind kind, boolean copyOverrides) {
|
||||
throw new UnsupportedOperationException("Accessors must be copied by the corresponding property");
|
||||
}
|
||||
|
||||
|
||||
@@ -306,8 +306,8 @@ public class PropertyDescriptor extends VariableDescriptorImpl implements Callab
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public PropertyDescriptor copy(DeclarationDescriptor newOwner, boolean makeNonAbstract, boolean makeInvisible, Kind kind, boolean copyOverrides) {
|
||||
return doSubstitute(TypeSubstitutor.EMPTY, newOwner, DescriptorUtils.convertModality(modality, makeNonAbstract), makeInvisible ? Visibilities.INVISIBLE_FAKE : visibility, false, copyOverrides, kind);
|
||||
public PropertyDescriptor copy(DeclarationDescriptor newOwner, Modality modality, boolean makeInvisible, Kind kind, boolean copyOverrides) {
|
||||
return doSubstitute(TypeSubstitutor.EMPTY, newOwner, modality, makeInvisible ? Visibilities.INVISIBLE_FAKE : visibility, false, copyOverrides, kind);
|
||||
}
|
||||
|
||||
public static PropertyDescriptor createDummy() {
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
package org.jetbrains.jet.lang.descriptors;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jet.lang.descriptors.annotations.AnnotationDescriptor;
|
||||
import org.jetbrains.jet.lang.resolve.name.Name;
|
||||
import org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverDescriptor;
|
||||
@@ -50,7 +49,7 @@ public class ScriptCodeDescriptor extends FunctionDescriptorImpl {
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public FunctionDescriptor copy(DeclarationDescriptor newOwner, boolean makeNonAbstract, boolean makeInvisible, Kind kind, boolean copyOverrides) {
|
||||
public FunctionDescriptor copy(DeclarationDescriptor newOwner, Modality modality, boolean makeInvisible, Kind kind, boolean copyOverrides) {
|
||||
throw new IllegalStateException("no need to copy script code descriptor");
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ public interface SimpleFunctionDescriptor extends FunctionDescriptor {
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
SimpleFunctionDescriptor copy(DeclarationDescriptor newOwner, boolean makeNonAbstract, boolean makeInvisible, Kind kind, boolean copyOverrides);
|
||||
SimpleFunctionDescriptor copy(DeclarationDescriptor newOwner, Modality modality, boolean makeInvisible, Kind kind, boolean copyOverrides);
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
|
||||
+2
-4
@@ -19,7 +19,6 @@ package org.jetbrains.jet.lang.descriptors;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jet.lang.descriptors.annotations.AnnotationDescriptor;
|
||||
import org.jetbrains.jet.lang.resolve.DescriptorUtils;
|
||||
import org.jetbrains.jet.lang.resolve.name.Name;
|
||||
import org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverDescriptor;
|
||||
import org.jetbrains.jet.lang.types.JetType;
|
||||
@@ -94,9 +93,8 @@ public class SimpleFunctionDescriptorImpl extends FunctionDescriptorImpl impleme
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public SimpleFunctionDescriptor copy(DeclarationDescriptor newOwner, boolean makeNonAbstract, boolean makeInvisible, Kind kind, boolean copyOverrides) {
|
||||
SimpleFunctionDescriptorImpl copy = (SimpleFunctionDescriptorImpl)doSubstitute(TypeSubstitutor.EMPTY, newOwner, DescriptorUtils
|
||||
.convertModality(modality, makeNonAbstract), makeInvisible ? Visibilities.INVISIBLE_FAKE : visibility, false, copyOverrides, kind);
|
||||
public SimpleFunctionDescriptor copy(DeclarationDescriptor newOwner, Modality modality, boolean makeInvisible, Kind kind, boolean copyOverrides) {
|
||||
SimpleFunctionDescriptorImpl copy = (SimpleFunctionDescriptorImpl)doSubstitute(TypeSubstitutor.EMPTY, newOwner, modality, makeInvisible ? Visibilities.INVISIBLE_FAKE : visibility, false, copyOverrides, kind);
|
||||
copy.isInline = isInline;
|
||||
return copy;
|
||||
}
|
||||
|
||||
@@ -71,7 +71,8 @@ public class DelegationResolver {
|
||||
if (declarationDescriptor instanceof PropertyDescriptor) {
|
||||
PropertyDescriptor propertyDescriptor = (PropertyDescriptor) declarationDescriptor;
|
||||
if (propertyDescriptor.getModality().isOverridable()) {
|
||||
PropertyDescriptor copy = propertyDescriptor.copy(classDescriptor, true, false, CallableMemberDescriptor.Kind.DELEGATION, true);
|
||||
Modality modality = DescriptorUtils.convertModality(propertyDescriptor.getModality(), true);
|
||||
PropertyDescriptor copy = propertyDescriptor.copy(classDescriptor, modality, false, CallableMemberDescriptor.Kind.DELEGATION, true);
|
||||
classDescriptor.getBuilder().addPropertyDescriptor(copy);
|
||||
trace.record(DELEGATED, copy);
|
||||
}
|
||||
@@ -79,7 +80,8 @@ public class DelegationResolver {
|
||||
else if (declarationDescriptor instanceof SimpleFunctionDescriptor) {
|
||||
SimpleFunctionDescriptor functionDescriptor = (SimpleFunctionDescriptor) declarationDescriptor;
|
||||
if (functionDescriptor.getModality().isOverridable()) {
|
||||
SimpleFunctionDescriptor copy = functionDescriptor.copy(classDescriptor, true, false, CallableMemberDescriptor.Kind.DELEGATION, true);
|
||||
Modality modality = DescriptorUtils.convertModality(functionDescriptor.getModality(), true);
|
||||
SimpleFunctionDescriptor copy = functionDescriptor.copy(classDescriptor, modality, false, CallableMemberDescriptor.Kind.DELEGATION, true);
|
||||
classDescriptor.getBuilder().addFunctionDescriptor(copy);
|
||||
trace.record(DELEGATED, copy);
|
||||
}
|
||||
|
||||
@@ -177,45 +177,73 @@ public class OverrideResolver {
|
||||
|
||||
public static void generateOverridesInFunctionGroup(
|
||||
@NotNull Name name,
|
||||
@NotNull Collection<? extends CallableMemberDescriptor> functionsFromSupertypes,
|
||||
@NotNull Collection<? extends CallableMemberDescriptor> functionsFromCurrent,
|
||||
@NotNull Collection<? extends CallableMemberDescriptor> membersFromSupertypes,
|
||||
@NotNull Collection<? extends CallableMemberDescriptor> membersFromCurrent,
|
||||
@NotNull ClassDescriptor current,
|
||||
@NotNull DescriptorSink sink) {
|
||||
|
||||
List<CallableMemberDescriptor> fakeOverrideList = Lists.newArrayList();
|
||||
List<CallableMemberDescriptor> notOverridden = Lists.newArrayList(membersFromSupertypes);
|
||||
for (CallableMemberDescriptor fromCurrent : membersFromCurrent) {
|
||||
|
||||
for (CallableMemberDescriptor functionFromSupertype : functionsFromSupertypes) {
|
||||
boolean overrides = false;
|
||||
// Find what this descriptor overrides, bind them and removed from notOverridden
|
||||
for (Iterator<CallableMemberDescriptor> iterator = notOverridden.iterator(); iterator.hasNext(); ) {
|
||||
CallableMemberDescriptor fromSupertype = iterator.next();
|
||||
OverridingUtil.OverrideCompatibilityInfo.Result result =
|
||||
OverridingUtil.isOverridableBy(fromSupertype, fromCurrent).getResult();
|
||||
|
||||
boolean isVisible = Visibilities.isVisible(functionFromSupertype, current);
|
||||
|
||||
for (CallableMemberDescriptor functionFromCurrent : functionsFromCurrent) {
|
||||
OverridingUtil.OverrideCompatibilityInfo.Result result = OverridingUtil.isOverridableBy(functionFromSupertype, functionFromCurrent).getResult();
|
||||
if (result == OVERRIDABLE) {
|
||||
|
||||
if (isVisible) {
|
||||
OverridingUtil.bindOverride(functionFromCurrent, functionFromSupertype);
|
||||
if (Visibilities.isVisible(fromSupertype, current)) {
|
||||
switch (result) {
|
||||
case OVERRIDABLE:
|
||||
OverridingUtil.bindOverride(fromCurrent, fromSupertype);
|
||||
iterator.remove();
|
||||
break;
|
||||
case CONFLICT:
|
||||
sink.conflict(fromSupertype, fromCurrent);
|
||||
break;
|
||||
case INCOMPATIBLE:
|
||||
break;
|
||||
}
|
||||
overrides = true;
|
||||
}
|
||||
else if (result == OverridingUtil.OverrideCompatibilityInfo.Result.CONFLICT) {
|
||||
sink.conflict(functionFromSupertype, functionFromCurrent);
|
||||
}
|
||||
}
|
||||
|
||||
for (CallableMemberDescriptor fakeOverride : fakeOverrideList) {
|
||||
if (OverridingUtil.isOverridableBy(functionFromSupertype, fakeOverride).getResult() == OVERRIDABLE) {
|
||||
OverridingUtil.bindOverride(fakeOverride, functionFromSupertype);
|
||||
overrides = true;
|
||||
}
|
||||
|
||||
Queue<CallableMemberDescriptor> fromSuperQueue = new LinkedList<CallableMemberDescriptor>(notOverridden);
|
||||
while (!fromSuperQueue.isEmpty()) {
|
||||
CallableMemberDescriptor aFromSuper = fromSuperQueue.remove();
|
||||
Collection<CallableMemberDescriptor> overridableByA = Lists.newArrayList();
|
||||
overridableByA.add(aFromSuper);
|
||||
for (Iterator<CallableMemberDescriptor> iterator = fromSuperQueue.iterator(); iterator.hasNext(); ) {
|
||||
CallableMemberDescriptor bFromSuper = iterator.next();
|
||||
OverridingUtil.OverrideCompatibilityInfo.Result result =
|
||||
OverridingUtil.isOverridableBy(bFromSuper, aFromSuper).getResult();
|
||||
switch (result) {
|
||||
case OVERRIDABLE:
|
||||
overridableByA.add(bFromSuper);
|
||||
iterator.remove();
|
||||
break;
|
||||
case CONFLICT:
|
||||
sink.conflict(aFromSuper, bFromSuper);
|
||||
iterator.remove();
|
||||
break;
|
||||
case INCOMPATIBLE:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!overrides) {
|
||||
CallableMemberDescriptor fakeOverride = functionFromSupertype.copy(current, false, !isVisible, CallableMemberDescriptor.Kind.FAKE_OVERRIDE, false);
|
||||
OverridingUtil.bindOverride(fakeOverride, functionFromSupertype);
|
||||
fakeOverrideList.add(fakeOverride);
|
||||
sink.addToScope(fakeOverride);
|
||||
boolean isVisible = true;
|
||||
Modality modality = Modality.ABSTRACT;
|
||||
for (CallableMemberDescriptor descriptor : overridableByA) {
|
||||
isVisible &= Visibilities.isVisible(descriptor, current);
|
||||
if (descriptor.getModality().compareTo(modality) < 0) {
|
||||
modality = descriptor.getModality();
|
||||
}
|
||||
}
|
||||
|
||||
CallableMemberDescriptor fakeOverride =
|
||||
aFromSuper.copy(current, modality, !isVisible, CallableMemberDescriptor.Kind.FAKE_OVERRIDE, false);
|
||||
for (CallableMemberDescriptor descriptor : overridableByA) {
|
||||
OverridingUtil.bindOverride(fakeOverride, descriptor);
|
||||
}
|
||||
sink.addToScope(fakeOverride);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -20,6 +20,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jet.lang.descriptors.DeclarationDescriptor;
|
||||
import org.jetbrains.jet.lang.descriptors.FunctionDescriptor;
|
||||
import org.jetbrains.jet.lang.descriptors.FunctionDescriptorImpl;
|
||||
import org.jetbrains.jet.lang.descriptors.Modality;
|
||||
import org.jetbrains.jet.lang.descriptors.annotations.AnnotationDescriptor;
|
||||
import org.jetbrains.jet.lang.resolve.name.Name;
|
||||
|
||||
@@ -40,7 +41,7 @@ public class ExpressionAsFunctionDescriptor extends FunctionDescriptorImpl {
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public FunctionDescriptor copy(DeclarationDescriptor newOwner, boolean makeNonAbstract, boolean makeInvisible, Kind kind, boolean copyOverrides) {
|
||||
public FunctionDescriptor copy(DeclarationDescriptor newOwner, Modality modality, boolean makeInvisible, Kind kind, boolean copyOverrides) {
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -45,7 +45,7 @@ public class ErrorSimpleFunctionDescriptorImpl extends SimpleFunctionDescriptorI
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public SimpleFunctionDescriptor copy(DeclarationDescriptor newOwner, boolean makeNonAbstract, boolean makeInvisible, Kind kind, boolean copyOverrides) {
|
||||
public SimpleFunctionDescriptor copy(DeclarationDescriptor newOwner, Modality modality, boolean makeInvisible, Kind kind, boolean copyOverrides) {
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
open class A {
|
||||
private fun foo() : Int = 1
|
||||
}
|
||||
|
||||
class B : A() {
|
||||
fun foo() : String = ""
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package test;
|
||||
|
||||
import java.util.AbstractList;
|
||||
|
||||
public class ModalityOfFakeOverrides extends AbstractList<String> {
|
||||
@Override
|
||||
public String get(int index) {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int size() {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package test
|
||||
|
||||
import java.util.AbstractList
|
||||
|
||||
public open class ModalityOfFakeOverrides : AbstractList<String>() {
|
||||
override fun get(p0: Int): String? {
|
||||
return ""
|
||||
}
|
||||
|
||||
override fun size(): Int = 0
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
namespace test
|
||||
|
||||
public open class test.ModalityOfFakeOverrides : java.util.AbstractList<jet.String> {
|
||||
public final /*constructor*/ fun <init>(): test.ModalityOfFakeOverrides
|
||||
public open override /*1*/ fun add(/*0*/ p0: jet.Int, /*1*/ p1: jet.String?): jet.Tuple0
|
||||
public open override /*1*/ fun add(/*0*/ p0: jet.String?): jet.Boolean
|
||||
public open override /*1*/ fun addAll(/*0*/ p0: java.util.Collection<out jet.String>?): jet.Boolean
|
||||
public open override /*1*/ fun addAll(/*0*/ p0: jet.Int, /*1*/ p1: java.util.Collection<out jet.String>?): jet.Boolean
|
||||
public open override /*1*/ fun clear(): jet.Tuple0
|
||||
public open override /*1*/ fun contains(/*0*/ p0: jet.Any?): jet.Boolean
|
||||
public open override /*1*/ fun containsAll(/*0*/ p0: java.util.Collection<out jet.Any?>?): jet.Boolean
|
||||
public open override /*1*/ fun get(/*0*/ p0: jet.Int): jet.String?
|
||||
public open override /*1*/ fun indexOf(/*0*/ p0: jet.Any?): jet.Int
|
||||
public open override /*1*/ fun isEmpty(): jet.Boolean
|
||||
public open override /*1*/ fun iterator(): java.util.Iterator<jet.String>?
|
||||
public open override /*1*/ fun lastIndexOf(/*0*/ p0: jet.Any?): jet.Int
|
||||
public open override /*1*/ fun listIterator(): java.util.ListIterator<jet.String>?
|
||||
public open override /*1*/ fun listIterator(/*0*/ p0: jet.Int): java.util.ListIterator<jet.String>?
|
||||
protected final override /*1*/ var modCount: jet.Int
|
||||
public open override /*1*/ fun remove(/*0*/ p0: jet.Any?): jet.Boolean
|
||||
public open override /*1*/ fun remove(/*0*/ p0: jet.Int): jet.String?
|
||||
public open override /*1*/ fun removeAll(/*0*/ p0: java.util.Collection<out jet.Any?>?): jet.Boolean
|
||||
protected open override /*1*/ fun removeRange(/*0*/ p0: jet.Int, /*1*/ p1: jet.Int): jet.Tuple0
|
||||
public open override /*1*/ fun retainAll(/*0*/ p0: java.util.Collection<out jet.Any?>?): jet.Boolean
|
||||
public open override /*1*/ fun set(/*0*/ p0: jet.Int, /*1*/ p1: jet.String?): jet.String?
|
||||
public open override /*1*/ fun size(): jet.Int
|
||||
public open override /*1*/ fun subList(/*0*/ p0: jet.Int, /*1*/ p1: jet.Int): java.util.List<jet.String>?
|
||||
public open override /*1*/ fun toArray(): jet.Array<jet.Any?>?
|
||||
public open override /*1*/ fun </*0*/ T : jet.Any?>toArray(/*0*/ p0: jet.Array<T?>?): jet.Array<T?>?
|
||||
}
|
||||
+14
-74
@@ -15,10 +15,9 @@
|
||||
*/
|
||||
package org.jetbrains.jet.jvm.compiler;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.Suite;
|
||||
import junit.framework.Assert;
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestSuite;
|
||||
|
||||
import java.io.File;
|
||||
import java.lang.reflect.Method;
|
||||
@@ -26,328 +25,264 @@ import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
/* This class is generated by org.jetbrains.jet.jvm.compiler.ReadJavaBinaryClassTestGenerator. DO NOT MODIFY MANUALLY */
|
||||
@RunWith(Suite.class)
|
||||
@Suite.SuiteClasses({
|
||||
ReadJavaBinaryClassTestGenerated.ReadJavaBinaryClass.class
|
||||
})
|
||||
public class ReadJavaBinaryClassTestGenerated {
|
||||
public static class ReadJavaBinaryClass extends AbstractReadJavaBinaryClassTest {
|
||||
@Test
|
||||
public void allTestsPresentInReadJavaBinaryClass() throws Exception {
|
||||
public void testAllFilesPresentInReadJavaBinaryClass() throws Exception {
|
||||
allTestsPresent(ReadJavaBinaryClass.class, new File("compiler/testData/readJavaBinaryClass"), true);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAnnotatedAnnotation() throws Exception {
|
||||
doTest("compiler/testData/readJavaBinaryClass/annotation/AnnotatedAnnotation.java");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAnnotatedMethod() throws Exception {
|
||||
doTest("compiler/testData/readJavaBinaryClass/annotation/AnnotatedMethod.java");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSimpleAnnotation() throws Exception {
|
||||
doTest("compiler/testData/readJavaBinaryClass/annotation/SimpleAnnotation.java");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testClassDoesNotOverrideMethod() throws Exception {
|
||||
doTest("compiler/testData/readJavaBinaryClass/ClassDoesNotOverrideMethod.java");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testClassWithTypeP() throws Exception {
|
||||
doTest("compiler/testData/readJavaBinaryClass/ClassWithTypeP.java");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testClassWithTypePExtendsIterableP() throws Exception {
|
||||
doTest("compiler/testData/readJavaBinaryClass/ClassWithTypePExtendsIterableP.java");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testClassWithTypePP() throws Exception {
|
||||
doTest("compiler/testData/readJavaBinaryClass/ClassWithTypePP.java");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testClassWithTypePRefNext() throws Exception {
|
||||
doTest("compiler/testData/readJavaBinaryClass/ClassWithTypePRefNext.java");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testClassWithTypePRefSelf() throws Exception {
|
||||
doTest("compiler/testData/readJavaBinaryClass/ClassWithTypePRefSelf.java");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testConstructorGenericDeep() throws Exception {
|
||||
doTest("compiler/testData/readJavaBinaryClass/constructor/ConstructorGenericDeep.java");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testConstructorGenericSimple() throws Exception {
|
||||
doTest("compiler/testData/readJavaBinaryClass/constructor/ConstructorGenericSimple.java");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testConstructorGenericUpperBound() throws Exception {
|
||||
doTest("compiler/testData/readJavaBinaryClass/constructor/ConstructorGenericUpperBound.java");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFieldAsVar() throws Exception {
|
||||
doTest("compiler/testData/readJavaBinaryClass/FieldAsVar.java");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFieldOfArrayType() throws Exception {
|
||||
doTest("compiler/testData/readJavaBinaryClass/FieldOfArrayType.java");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFinalFieldAsVal() throws Exception {
|
||||
doTest("compiler/testData/readJavaBinaryClass/FinalFieldAsVal.java");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInnerClass() throws Exception {
|
||||
doTest("compiler/testData/readJavaBinaryClass/InnerClass.java");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInnerClassesInGeneric() throws Exception {
|
||||
doTest("compiler/testData/readJavaBinaryClass/InnerClassesInGeneric.java");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInnerClassReferencesOuterTP() throws Exception {
|
||||
doTest("compiler/testData/readJavaBinaryClass/InnerClassReferencesOuterTP.java");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDifferentGetterAndSetter() throws Exception {
|
||||
doTest("compiler/testData/readJavaBinaryClass/javaBean/DifferentGetterAndSetter.java");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testJavaBeanAbstractGetter() throws Exception {
|
||||
doTest("compiler/testData/readJavaBinaryClass/javaBean/JavaBeanAbstractGetter.java");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testJavaBeanVal() throws Exception {
|
||||
doTest("compiler/testData/readJavaBinaryClass/javaBean/JavaBeanVal.java");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testJavaBeanVar() throws Exception {
|
||||
doTest("compiler/testData/readJavaBinaryClass/javaBean/JavaBeanVar.java");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testJavaBeanVarOfGenericType() throws Exception {
|
||||
doTest("compiler/testData/readJavaBinaryClass/javaBean/JavaBeanVarOfGenericType.java");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testTwoSetters() throws Exception {
|
||||
doTest("compiler/testData/readJavaBinaryClass/javaBean/TwoSetters.java");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAddingNullability() throws Exception {
|
||||
doTest("compiler/testData/readJavaBinaryClass/kotlinSignature/error/AddingNullability.java");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testExtraUpperBound() throws Exception {
|
||||
doTest("compiler/testData/readJavaBinaryClass/kotlinSignature/error/ExtraUpperBound.java");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMissingUpperBound() throws Exception {
|
||||
doTest("compiler/testData/readJavaBinaryClass/kotlinSignature/error/MissingUpperBound.java");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNotVarargReplacedWithVararg() throws Exception {
|
||||
doTest("compiler/testData/readJavaBinaryClass/kotlinSignature/error/NotVarargReplacedWithVararg.java");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testReturnTypeMissing() throws Exception {
|
||||
doTest("compiler/testData/readJavaBinaryClass/kotlinSignature/error/ReturnTypeMissing.java");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSyntaxError() throws Exception {
|
||||
doTest("compiler/testData/readJavaBinaryClass/kotlinSignature/error/SyntaxError.java");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testVarargReplacedWithNotVararg() throws Exception {
|
||||
doTest("compiler/testData/readJavaBinaryClass/kotlinSignature/error/VarargReplacedWithNotVararg.java");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testWrongMethodName() throws Exception {
|
||||
doTest("compiler/testData/readJavaBinaryClass/kotlinSignature/error/WrongMethodName.java");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testWrongReturnTypeStructure() throws Exception {
|
||||
doTest("compiler/testData/readJavaBinaryClass/kotlinSignature/error/WrongReturnTypeStructure.java");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testWrongTypeName1() throws Exception {
|
||||
doTest("compiler/testData/readJavaBinaryClass/kotlinSignature/error/WrongTypeName1.java");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testWrongTypeName2() throws Exception {
|
||||
doTest("compiler/testData/readJavaBinaryClass/kotlinSignature/error/WrongTypeName2.java");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testWrongTypeName3() throws Exception {
|
||||
doTest("compiler/testData/readJavaBinaryClass/kotlinSignature/error/WrongTypeName3.java");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testWrongTypeParameterBoundStructure1() throws Exception {
|
||||
doTest("compiler/testData/readJavaBinaryClass/kotlinSignature/error/WrongTypeParameterBoundStructure1.java");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testWrongTypeParameterBoundStructure2() throws Exception {
|
||||
doTest("compiler/testData/readJavaBinaryClass/kotlinSignature/error/WrongTypeParameterBoundStructure2.java");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testWrongTypeParametersCount() throws Exception {
|
||||
doTest("compiler/testData/readJavaBinaryClass/kotlinSignature/error/WrongTypeParametersCount.java");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testWrongTypeVariance() throws Exception {
|
||||
doTest("compiler/testData/readJavaBinaryClass/kotlinSignature/error/WrongTypeVariance.java");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testWrongValueParametersCount() throws Exception {
|
||||
doTest("compiler/testData/readJavaBinaryClass/kotlinSignature/error/WrongValueParametersCount.java");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testWrongValueParameterStructure1() throws Exception {
|
||||
doTest("compiler/testData/readJavaBinaryClass/kotlinSignature/error/WrongValueParameterStructure1.java");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testWrongValueParameterStructure2() throws Exception {
|
||||
doTest("compiler/testData/readJavaBinaryClass/kotlinSignature/error/WrongValueParameterStructure2.java");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMethodWithFunctionTypes() throws Exception {
|
||||
doTest("compiler/testData/readJavaBinaryClass/kotlinSignature/MethodWithFunctionTypes.java");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMethodWithGenerics() throws Exception {
|
||||
doTest("compiler/testData/readJavaBinaryClass/kotlinSignature/MethodWithGenerics.java");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMethodWithTupleType() throws Exception {
|
||||
doTest("compiler/testData/readJavaBinaryClass/kotlinSignature/MethodWithTupleType.java");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMethodWithTypeParameters() throws Exception {
|
||||
doTest("compiler/testData/readJavaBinaryClass/kotlinSignature/MethodWithTypeParameters.java");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMethodWithVararg() throws Exception {
|
||||
doTest("compiler/testData/readJavaBinaryClass/kotlinSignature/MethodWithVararg.java");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMethodReferencesOuterClassTP() throws Exception {
|
||||
doTest("compiler/testData/readJavaBinaryClass/MethodReferencesOuterClassTP.java");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMethodTypePOneUpperBound() throws Exception {
|
||||
doTest("compiler/testData/readJavaBinaryClass/MethodTypePOneUpperBound.java");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMethodTypePTwoUpperBounds() throws Exception {
|
||||
doTest("compiler/testData/readJavaBinaryClass/MethodTypePTwoUpperBounds.java");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMethodWithTypeP() throws Exception {
|
||||
doTest("compiler/testData/readJavaBinaryClass/MethodWithTypeP.java");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMethodWithTypePP() throws Exception {
|
||||
doTest("compiler/testData/readJavaBinaryClass/MethodWithTypePP.java");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMethodWithTypePRefClassP() throws Exception {
|
||||
doTest("compiler/testData/readJavaBinaryClass/MethodWithTypePRefClassP.java");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMethosWithPRefTP() throws Exception {
|
||||
doTest("compiler/testData/readJavaBinaryClass/MethosWithPRefTP.java");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testModalityOfFakeOverrides() throws Exception {
|
||||
doTest("compiler/testData/readJavaBinaryClass/modality/ModalityOfFakeOverrides.java");
|
||||
}
|
||||
|
||||
public void testMyException() throws Exception {
|
||||
doTest("compiler/testData/readJavaBinaryClass/MyException.java");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNotNullField() throws Exception {
|
||||
doTest("compiler/testData/readJavaBinaryClass/notNull/NotNullField.java");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNotNullMethod() throws Exception {
|
||||
doTest("compiler/testData/readJavaBinaryClass/notNull/NotNullMethod.java");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNotNullParameter() throws Exception {
|
||||
doTest("compiler/testData/readJavaBinaryClass/notNull/NotNullParameter.java");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSimple() throws Exception {
|
||||
doTest("compiler/testData/readJavaBinaryClass/Simple.java");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testTwoFields() throws Exception {
|
||||
doTest("compiler/testData/readJavaBinaryClass/TwoFields.java");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testVarargInt() throws Exception {
|
||||
doTest("compiler/testData/readJavaBinaryClass/vararg/VarargInt.java");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testVarargString() throws Exception {
|
||||
doTest("compiler/testData/readJavaBinaryClass/vararg/VarargString.java");
|
||||
}
|
||||
@@ -355,7 +290,7 @@ public class ReadJavaBinaryClassTestGenerated {
|
||||
public static void allTestsPresent(Class<?> clazz, File testDataDir, boolean recursive) {
|
||||
Set<String> methodNames = new HashSet<String>();
|
||||
for (Method method : clazz.getDeclaredMethods()) {
|
||||
if (method.isAnnotationPresent(Test.class)) {
|
||||
if (method.getName().startsWith("test")) {
|
||||
methodNames.add(method.getName().toLowerCase() + ".java");
|
||||
}
|
||||
}
|
||||
@@ -375,4 +310,9 @@ public class ReadJavaBinaryClassTestGenerated {
|
||||
}
|
||||
}
|
||||
|
||||
public static Test suite() {
|
||||
TestSuite suite = new TestSuite();
|
||||
suite.addTestSuite(ReadJavaBinaryClass.class);
|
||||
return suite;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user