Fix inspections in kotlin.jvm.internal runtime classes

This commit is contained in:
Alexander Udalov
2020-02-13 17:21:20 +01:00
parent aaff1d1670
commit 8588f96ec8
19 changed files with 21 additions and 7 deletions
@@ -21,7 +21,7 @@ import java.util.Map;
* All methods from KCallable should be implemented here and should delegate to the actual implementation, loaded dynamically * All methods from KCallable should be implemented here and should delegate to the actual implementation, loaded dynamically
* and stored in the {@link CallableReference#reflected} field. * and stored in the {@link CallableReference#reflected} field.
*/ */
@SuppressWarnings({"unchecked", "NullableProblems"}) @SuppressWarnings({"unchecked", "NullableProblems", "rawtypes"})
public abstract class CallableReference implements KCallable, Serializable { public abstract class CallableReference implements KCallable, Serializable {
// This field is not volatile intentionally: // This field is not volatile intentionally:
// 1) It's fine if the value is computed multiple times in different threads; // 1) It's fine if the value is computed multiple times in different threads;
@@ -11,7 +11,7 @@ import kotlin.jvm.functions.*;
import java.io.Serializable; import java.io.Serializable;
@SuppressWarnings("unused") @SuppressWarnings({"unused", "rawtypes"})
@Deprecated @Deprecated
@kotlin.Deprecated(message = "This class is no longer supported, do not use it.", level = DeprecationLevel.ERROR) @kotlin.Deprecated(message = "This class is no longer supported, do not use it.", level = DeprecationLevel.ERROR)
public abstract class FunctionImpl public abstract class FunctionImpl
@@ -9,6 +9,7 @@ import kotlin.SinceKotlin;
import kotlin.reflect.KCallable; import kotlin.reflect.KCallable;
import kotlin.reflect.KFunction; import kotlin.reflect.KFunction;
@SuppressWarnings("rawtypes")
public class FunctionReference extends CallableReference implements FunctionBase, KFunction { public class FunctionReference extends CallableReference implements FunctionBase, KFunction {
private final int arity; private final int arity;
@@ -7,6 +7,7 @@ package kotlin.jvm.internal;
import kotlin.reflect.KDeclarationContainer; import kotlin.reflect.KDeclarationContainer;
@SuppressWarnings({"unused", "NullableProblems"})
public class FunctionReferenceImpl extends FunctionReference { public class FunctionReferenceImpl extends FunctionReference {
private final KDeclarationContainer owner; private final KDeclarationContainer owner;
private final String name; private final String name;
@@ -8,6 +8,7 @@ package kotlin.jvm.internal;
import kotlin.SinceKotlin; import kotlin.SinceKotlin;
import kotlin.reflect.KMutableProperty; import kotlin.reflect.KMutableProperty;
@SuppressWarnings("rawtypes")
public abstract class MutablePropertyReference extends PropertyReference implements KMutableProperty { public abstract class MutablePropertyReference extends PropertyReference implements KMutableProperty {
public MutablePropertyReference() { public MutablePropertyReference() {
} }
@@ -10,6 +10,7 @@ import kotlin.reflect.KCallable;
import kotlin.reflect.KMutableProperty0; import kotlin.reflect.KMutableProperty0;
import kotlin.reflect.KProperty0; import kotlin.reflect.KProperty0;
@SuppressWarnings({"rawtypes", "unused", "NullableProblems"})
public abstract class MutablePropertyReference0 extends MutablePropertyReference implements KMutableProperty0 { public abstract class MutablePropertyReference0 extends MutablePropertyReference implements KMutableProperty0 {
public MutablePropertyReference0() { public MutablePropertyReference0() {
} }
@@ -7,6 +7,7 @@ package kotlin.jvm.internal;
import kotlin.reflect.KDeclarationContainer; import kotlin.reflect.KDeclarationContainer;
@SuppressWarnings({"unused", "NullableProblems"})
public class MutablePropertyReference0Impl extends MutablePropertyReference0 { public class MutablePropertyReference0Impl extends MutablePropertyReference0 {
private final KDeclarationContainer owner; private final KDeclarationContainer owner;
private final String name; private final String name;
@@ -10,7 +10,7 @@ import kotlin.reflect.KCallable;
import kotlin.reflect.KMutableProperty1; import kotlin.reflect.KMutableProperty1;
import kotlin.reflect.KProperty1; import kotlin.reflect.KProperty1;
@SuppressWarnings("unchecked") @SuppressWarnings({"unchecked", "rawtypes", "unused", "NullableProblems"})
public abstract class MutablePropertyReference1 extends MutablePropertyReference implements KMutableProperty1 { public abstract class MutablePropertyReference1 extends MutablePropertyReference implements KMutableProperty1 {
public MutablePropertyReference1() { public MutablePropertyReference1() {
} }
@@ -7,6 +7,7 @@ package kotlin.jvm.internal;
import kotlin.reflect.KDeclarationContainer; import kotlin.reflect.KDeclarationContainer;
@SuppressWarnings({"unused", "NullableProblems"})
public class MutablePropertyReference1Impl extends MutablePropertyReference1 { public class MutablePropertyReference1Impl extends MutablePropertyReference1 {
private final KDeclarationContainer owner; private final KDeclarationContainer owner;
private final String name; private final String name;
@@ -10,7 +10,7 @@ import kotlin.reflect.KCallable;
import kotlin.reflect.KMutableProperty2; import kotlin.reflect.KMutableProperty2;
import kotlin.reflect.KProperty2; import kotlin.reflect.KProperty2;
@SuppressWarnings("unchecked") @SuppressWarnings({"unchecked", "rawtypes", "NullableProblems"})
public abstract class MutablePropertyReference2 extends MutablePropertyReference implements KMutableProperty2 { public abstract class MutablePropertyReference2 extends MutablePropertyReference implements KMutableProperty2 {
@Override @Override
protected KCallable computeReflected() { protected KCallable computeReflected() {
@@ -7,6 +7,7 @@ package kotlin.jvm.internal;
import kotlin.reflect.KDeclarationContainer; import kotlin.reflect.KDeclarationContainer;
@SuppressWarnings({"unused", "NullableProblems"})
public class MutablePropertyReference2Impl extends MutablePropertyReference2 { public class MutablePropertyReference2Impl extends MutablePropertyReference2 {
private final KDeclarationContainer owner; private final KDeclarationContainer owner;
private final String name; private final String name;
@@ -9,6 +9,7 @@ import kotlin.SinceKotlin;
import kotlin.reflect.KCallable; import kotlin.reflect.KCallable;
import kotlin.reflect.KProperty; import kotlin.reflect.KProperty;
@SuppressWarnings("rawtypes")
public abstract class PropertyReference extends CallableReference implements KProperty { public abstract class PropertyReference extends CallableReference implements KProperty {
public PropertyReference() { public PropertyReference() {
super(); super();
@@ -9,6 +9,7 @@ import kotlin.SinceKotlin;
import kotlin.reflect.KCallable; import kotlin.reflect.KCallable;
import kotlin.reflect.KProperty0; import kotlin.reflect.KProperty0;
@SuppressWarnings({"rawtypes", "NullableProblems", "unused"})
public abstract class PropertyReference0 extends PropertyReference implements KProperty0 { public abstract class PropertyReference0 extends PropertyReference implements KProperty0 {
public PropertyReference0() { public PropertyReference0() {
super(); super();
@@ -7,6 +7,7 @@ package kotlin.jvm.internal;
import kotlin.reflect.KDeclarationContainer; import kotlin.reflect.KDeclarationContainer;
@SuppressWarnings({"unused", "NullableProblems"})
public class PropertyReference0Impl extends PropertyReference0 { public class PropertyReference0Impl extends PropertyReference0 {
private final KDeclarationContainer owner; private final KDeclarationContainer owner;
private final String name; private final String name;
@@ -9,7 +9,7 @@ import kotlin.SinceKotlin;
import kotlin.reflect.KCallable; import kotlin.reflect.KCallable;
import kotlin.reflect.KProperty1; import kotlin.reflect.KProperty1;
@SuppressWarnings("unchecked") @SuppressWarnings({"unchecked", "rawtypes", "unused", "NullableProblems"})
public abstract class PropertyReference1 extends PropertyReference implements KProperty1 { public abstract class PropertyReference1 extends PropertyReference implements KProperty1 {
public PropertyReference1() { public PropertyReference1() {
} }
@@ -7,6 +7,7 @@ package kotlin.jvm.internal;
import kotlin.reflect.KDeclarationContainer; import kotlin.reflect.KDeclarationContainer;
@SuppressWarnings("NullableProblems")
public class PropertyReference1Impl extends PropertyReference1 { public class PropertyReference1Impl extends PropertyReference1 {
private final KDeclarationContainer owner; private final KDeclarationContainer owner;
private final String name; private final String name;
@@ -9,7 +9,7 @@ import kotlin.SinceKotlin;
import kotlin.reflect.KCallable; import kotlin.reflect.KCallable;
import kotlin.reflect.KProperty2; import kotlin.reflect.KProperty2;
@SuppressWarnings("unchecked") @SuppressWarnings({"unchecked", "rawtypes", "NullableProblems"})
public abstract class PropertyReference2 extends PropertyReference implements KProperty2 { public abstract class PropertyReference2 extends PropertyReference implements KProperty2 {
@Override @Override
protected KCallable computeReflected() { protected KCallable computeReflected() {
@@ -7,6 +7,7 @@ package kotlin.jvm.internal;
import kotlin.reflect.KDeclarationContainer; import kotlin.reflect.KDeclarationContainer;
@SuppressWarnings({"unused", "NullableProblems"})
public class PropertyReference2Impl extends PropertyReference2 { public class PropertyReference2Impl extends PropertyReference2 {
private final KDeclarationContainer owner; private final KDeclarationContainer owner;
private final String name; private final String name;
@@ -3,6 +3,8 @@
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/ */
@file:Suppress("unused")
package kotlin.jvm.internal package kotlin.jvm.internal
import kotlin.reflect.KDeclarationContainer import kotlin.reflect.KDeclarationContainer
@@ -26,4 +28,4 @@ open class MutableLocalVariableReference : MutablePropertyReference0() {
override fun get(): Any? = notSupportedError() override fun get(): Any? = notSupportedError()
override fun set(value: Any?): Unit = notSupportedError() override fun set(value: Any?): Unit = notSupportedError()
} }