Refactor: process mentions of class object

Rename usages that refer to "default object" concept now
Test data file names are left as is
This commit is contained in:
Pavel V. Talanov
2015-03-03 17:28:24 +03:00
parent 27f5d71e4f
commit 48fbce9582
137 changed files with 471 additions and 479 deletions
@@ -81,7 +81,7 @@ public abstract class FileBasedKotlinClass implements KotlinJvmBinaryClass {
@NotNull
protected abstract byte[] getFileContents();
// TODO public to be accessible in class object of subclass, workaround for KT-3974
// TODO public to be accessible in default object of subclass, workaround for KT-3974
@Nullable
public static <T extends FileBasedKotlinClass> T create(
@NotNull byte[] fileContents,
@@ -102,9 +102,9 @@ public class PlatformStaticAnnotationChecker : AnnotationChecker {
diagnosticHolder: DiagnosticSink
) {
val insideObject = containerKindIs(descriptor, ClassKind.OBJECT)
val insideClassObject = containerKindIs(descriptor, ClassKind.CLASS_OBJECT)
val insideDefaultObject = containerKindIs(descriptor, ClassKind.CLASS_OBJECT)
if (!insideObject && !(insideClassObject && containerKindIs(descriptor.getContainingDeclaration()!!, ClassKind.CLASS))) {
if (!insideObject && !(insideDefaultObject && containerKindIs(descriptor.getContainingDeclaration()!!, ClassKind.CLASS))) {
diagnosticHolder.report(ErrorsJvm.PLATFORM_STATIC_NOT_IN_OBJECT.on(declaration));
}
@@ -42,7 +42,7 @@ public class NeedSyntheticChecker implements CallChecker {
//Necessary synthetic accessors in outer classes generated via old logic: CodegenContext.getAccessor
//Generation of accessors in nested classes (to invoke from outer,
// e.g.: from class to classobject) controlled via NEED_SYNTHETIC_ACCESSOR slice
// e.g.: from class to default object) controlled via NEED_SYNTHETIC_ACCESSOR slice
private boolean needSyntheticAccessor(JetScope invokationScope, CallableDescriptor targetDescriptor) {
return targetDescriptor instanceof CallableMemberDescriptor &&
Visibilities.isPrivate(targetDescriptor.getVisibility()) &&
@@ -45,7 +45,7 @@ public class DefaultErrorMessagesJvm implements DefaultErrorMessages.Extension {
static {
MAP.put(ErrorsJvm.CONFLICTING_JVM_DECLARATIONS, "Platform declaration clash: {0}", CONFLICTING_JVM_DECLARATIONS_DATA);
MAP.put(ErrorsJvm.ACCIDENTAL_OVERRIDE, "Accidental override: {0}", CONFLICTING_JVM_DECLARATIONS_DATA);
MAP.put(ErrorsJvm.PLATFORM_STATIC_NOT_IN_OBJECT, "Only functions in named objects and class objects of classes can be annotated with 'platformStatic'");
MAP.put(ErrorsJvm.PLATFORM_STATIC_NOT_IN_OBJECT, "Only functions in named objects and default objects of classes can be annotated with 'platformStatic'");
MAP.put(ErrorsJvm.OVERRIDE_CANNOT_BE_STATIC, "Override cannot be 'platformStatic' in object");
MAP.put(ErrorsJvm.PLATFORM_STATIC_ILLEGAL_USAGE, "This declaration does not support ''platformStatic''", DescriptorRenderer.SHORT_NAMES_IN_TYPES);
MAP.put(ErrorsJvm.NATIVE_DECLARATION_CANNOT_BE_ABSTRACT, "Native declaration can not be abstract");