Add missing public modifiers in project code
This commit is contained in:
@@ -20,10 +20,10 @@ import org.jetbrains.jet.utils.DFS
|
||||
import java.util.HashSet
|
||||
|
||||
public trait FunctionHandle {
|
||||
val isDeclaration: Boolean
|
||||
val isAbstract: Boolean
|
||||
public val isDeclaration: Boolean
|
||||
public val isAbstract: Boolean
|
||||
|
||||
fun getOverridden(): Iterable<FunctionHandle>
|
||||
public fun getOverridden(): Iterable<FunctionHandle>
|
||||
}
|
||||
|
||||
public data class Bridge<Signature>(
|
||||
|
||||
+4
-4
@@ -28,7 +28,7 @@ import org.jetbrains.jet.lang.resolve.java.diagnostics.JvmDeclarationOriginKind.
|
||||
|
||||
public enum class MemberKind { FIELD; METHOD }
|
||||
|
||||
public data class RawSignature(val name: String, val desc: String, val kind: MemberKind)
|
||||
public data class RawSignature(public val name: String, public val desc: String, public val kind: MemberKind)
|
||||
|
||||
public enum class JvmDeclarationOriginKind {
|
||||
OTHER
|
||||
@@ -39,9 +39,9 @@ public enum class JvmDeclarationOriginKind {
|
||||
}
|
||||
|
||||
public class JvmDeclarationOrigin(
|
||||
val originKind: JvmDeclarationOriginKind,
|
||||
val element: PsiElement?,
|
||||
val descriptor: DeclarationDescriptor?
|
||||
public val originKind: JvmDeclarationOriginKind,
|
||||
public val element: PsiElement?,
|
||||
public val descriptor: DeclarationDescriptor?
|
||||
) {
|
||||
class object {
|
||||
public val NO_ORIGIN: JvmDeclarationOrigin = JvmDeclarationOrigin(OTHER, null, null)
|
||||
|
||||
+2
-2
@@ -20,6 +20,6 @@ import com.intellij.psi.PsiElement
|
||||
import org.jetbrains.jet.lang.psi.JetDeclaration
|
||||
|
||||
public trait KotlinLightElement<T: JetDeclaration, D: PsiElement> {
|
||||
val origin: T?
|
||||
val delegate: D
|
||||
public val origin: T?
|
||||
public val delegate: D
|
||||
}
|
||||
|
||||
+2
-2
@@ -18,8 +18,8 @@ package org.jetbrains.jet.lang.resolve.java.jvmSignature
|
||||
|
||||
import org.jetbrains.jet.lang.descriptors.FunctionDescriptor
|
||||
|
||||
trait KotlinToJvmSignatureMapper {
|
||||
fun mapToJvmMethodSignature(function: FunctionDescriptor): JvmMethodSignature
|
||||
public trait KotlinToJvmSignatureMapper {
|
||||
public fun mapToJvmMethodSignature(function: FunctionDescriptor): JvmMethodSignature
|
||||
}
|
||||
|
||||
fun erasedSignaturesEqualIgnoringReturnTypes(subFunction: JvmMethodSignature, superFunction: JvmMethodSignature): Boolean {
|
||||
|
||||
@@ -20,24 +20,24 @@ import org.jetbrains.jet.storage.StorageManager
|
||||
import org.jetbrains.jet.storage.ExceptionTracker
|
||||
import org.jetbrains.jet.storage.LockBasedStorageManager
|
||||
|
||||
trait GlobalContext {
|
||||
val storageManager: StorageManager
|
||||
val exceptionTracker: ExceptionTracker
|
||||
public trait GlobalContext {
|
||||
public val storageManager: StorageManager
|
||||
public val exceptionTracker: ExceptionTracker
|
||||
}
|
||||
|
||||
open class SimpleGlobalContext(
|
||||
public open class SimpleGlobalContext(
|
||||
override val storageManager: StorageManager,
|
||||
override val exceptionTracker: ExceptionTracker
|
||||
) : GlobalContext
|
||||
|
||||
open class GlobalContextImpl(
|
||||
public open class GlobalContextImpl(
|
||||
storageManager: LockBasedStorageManager,
|
||||
exceptionTracker: ExceptionTracker
|
||||
) : SimpleGlobalContext(storageManager, exceptionTracker) {
|
||||
override val storageManager: LockBasedStorageManager = super.storageManager as LockBasedStorageManager
|
||||
}
|
||||
|
||||
fun GlobalContext(): GlobalContextImpl {
|
||||
public fun GlobalContext(): GlobalContextImpl {
|
||||
val tracker = ExceptionTracker()
|
||||
return GlobalContextImpl(LockBasedStorageManager.createWithExceptionHandling(tracker), tracker)
|
||||
}
|
||||
@@ -24,7 +24,7 @@ import org.jetbrains.jet.lang.cfg.pseudocode.instructions.special.LocalFunctionD
|
||||
import org.jetbrains.jet.lang.cfg.pseudocode.instructions.Instruction
|
||||
import org.jetbrains.jet.lang.cfg.pseudocode.instructions.special.SubroutineEnterInstruction
|
||||
|
||||
fun Pseudocode.traverse(
|
||||
public fun Pseudocode.traverse(
|
||||
traversalOrder: TraversalOrder,
|
||||
analyzeInstruction: (Instruction) -> Unit
|
||||
) {
|
||||
@@ -37,7 +37,7 @@ fun Pseudocode.traverse(
|
||||
}
|
||||
}
|
||||
|
||||
fun <D> Pseudocode.traverse(
|
||||
public fun <D> Pseudocode.traverse(
|
||||
traversalOrder: TraversalOrder,
|
||||
edgesMap: Map<Instruction, Edges<D>>,
|
||||
analyzeInstruction: (Instruction, D, D) -> Unit
|
||||
@@ -189,7 +189,7 @@ fun traverseFollowingInstructions(
|
||||
return true
|
||||
}
|
||||
|
||||
enum class TraversalOrder {
|
||||
public enum class TraversalOrder {
|
||||
FORWARD
|
||||
BACKWARD
|
||||
}
|
||||
|
||||
@@ -58,14 +58,14 @@ public object AllTypes : TypePredicate {
|
||||
}
|
||||
|
||||
// todo: simplify computed type predicate when possible
|
||||
fun and(predicates: Collection<TypePredicate>): TypePredicate =
|
||||
public fun and(predicates: Collection<TypePredicate>): TypePredicate =
|
||||
when (predicates.size) {
|
||||
0 -> AllTypes
|
||||
1 -> predicates.first()
|
||||
else -> ForAllTypes(predicates.toList())
|
||||
}
|
||||
|
||||
fun or(predicates: Collection<TypePredicate>): TypePredicate? =
|
||||
public fun or(predicates: Collection<TypePredicate>): TypePredicate? =
|
||||
when (predicates.size) {
|
||||
0 -> null
|
||||
1 -> predicates.first()
|
||||
|
||||
@@ -52,7 +52,7 @@ fun getReceiverTypePredicate(resolvedCall: ResolvedCall<*>, receiverValue: Recei
|
||||
return null
|
||||
}
|
||||
|
||||
fun getExpectedTypePredicate(value: PseudoValue, bindingContext: BindingContext): TypePredicate {
|
||||
public fun getExpectedTypePredicate(value: PseudoValue, bindingContext: BindingContext): TypePredicate {
|
||||
val pseudocode = value.createdAt?.owner
|
||||
if (pseudocode == null) return AllTypes
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ public abstract class JetCodeFragment(
|
||||
_myImports.addAll(imports.split(IMPORT_SEPARATOR))
|
||||
}
|
||||
|
||||
fun importsAsImportList(): JetImportList? {
|
||||
public fun importsAsImportList(): JetImportList? {
|
||||
return JetPsiFactory(this).createFile(_myImports.makeString("\n")).getImportList()
|
||||
}
|
||||
|
||||
@@ -118,9 +118,9 @@ public abstract class JetCodeFragment(
|
||||
}
|
||||
|
||||
class object {
|
||||
val IMPORT_SEPARATOR = ","
|
||||
public val IMPORT_SEPARATOR: String = ","
|
||||
|
||||
fun getImportsForElement(elementAtCaret: PsiElement): String {
|
||||
public fun getImportsForElement(elementAtCaret: PsiElement): String {
|
||||
val containingFile = elementAtCaret.getContainingFile()
|
||||
if (containingFile !is JetFile) return ""
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ import com.google.common.collect.ImmutableMap
|
||||
import org.jetbrains.jet.lang.diagnostics.Diagnostic
|
||||
import com.intellij.psi.PsiElement
|
||||
|
||||
class CompositeBindingContext private (
|
||||
public class CompositeBindingContext private (
|
||||
private val delegates: List<BindingContext>
|
||||
) : BindingContext {
|
||||
|
||||
|
||||
@@ -22,13 +22,13 @@ import org.jetbrains.jet.lang.diagnostics.Diagnostic
|
||||
import java.util.Collections
|
||||
|
||||
public trait Diagnostics : Iterable<Diagnostic> {
|
||||
fun all(): Collection<Diagnostic>
|
||||
public fun all(): Collection<Diagnostic>
|
||||
|
||||
fun forElement(psiElement: PsiElement): Collection<Diagnostic>
|
||||
public fun forElement(psiElement: PsiElement): Collection<Diagnostic>
|
||||
|
||||
fun isEmpty(): Boolean
|
||||
public fun isEmpty(): Boolean
|
||||
|
||||
fun noSuppression(): Diagnostics
|
||||
public fun noSuppression(): Diagnostics
|
||||
|
||||
class object {
|
||||
|
||||
|
||||
@@ -18,15 +18,15 @@ package org.jetbrains.jet.lang.resolve.calls.model
|
||||
|
||||
import org.jetbrains.jet.lang.descriptors.ValueParameterDescriptor
|
||||
|
||||
trait ArgumentMapping {
|
||||
fun isError(): Boolean
|
||||
public trait ArgumentMapping {
|
||||
public fun isError(): Boolean
|
||||
}
|
||||
|
||||
object ArgumentUnmapped: ArgumentMapping {
|
||||
public object ArgumentUnmapped: ArgumentMapping {
|
||||
override fun isError(): Boolean = true
|
||||
}
|
||||
|
||||
enum class ArgumentMatchStatus(val isError: Boolean = true) {
|
||||
public enum class ArgumentMatchStatus(val isError: Boolean = true) {
|
||||
SUCCESS : ArgumentMatchStatus(false)
|
||||
TYPE_MISMATCH : ArgumentMatchStatus()
|
||||
ARGUMENT_HAS_NO_TYPE : ArgumentMatchStatus()
|
||||
@@ -36,9 +36,9 @@ enum class ArgumentMatchStatus(val isError: Boolean = true) {
|
||||
MATCH_MODULO_UNINFERRED_TYPES : ArgumentMatchStatus()
|
||||
}
|
||||
|
||||
trait ArgumentMatch : ArgumentMapping {
|
||||
val valueParameter: ValueParameterDescriptor
|
||||
val status: ArgumentMatchStatus
|
||||
public trait ArgumentMatch : ArgumentMapping {
|
||||
public val valueParameter: ValueParameterDescriptor
|
||||
public val status: ArgumentMatchStatus
|
||||
|
||||
override fun isError(): Boolean = status.isError
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ import org.jetbrains.jet.lang.psi.JetCallableDeclaration
|
||||
import org.jetbrains.jet.lang.psi.psiUtil.isExtensionDeclaration
|
||||
import com.intellij.psi.PsiClass
|
||||
|
||||
fun JetClassOrObject.toLightClass(): KotlinLightClass? = LightClassUtil.getPsiClass(this) as KotlinLightClass?
|
||||
public fun JetClassOrObject.toLightClass(): KotlinLightClass? = LightClassUtil.getPsiClass(this) as KotlinLightClass?
|
||||
|
||||
public fun JetDeclaration.toLightElements(): List<PsiNamedElement> =
|
||||
when (this) {
|
||||
|
||||
@@ -33,7 +33,7 @@ import org.jetbrains.jet.lang.evaluate.ConstantExpressionEvaluator
|
||||
import org.jetbrains.jet.lang.resolve.DelegatingBindingTrace
|
||||
import org.jetbrains.jet.lang.types.TypeUtils
|
||||
|
||||
abstract class AbstractEvaluateExpressionTest : AbstractAnnotationDescriptorResolveTest() {
|
||||
public abstract class AbstractEvaluateExpressionTest : AbstractAnnotationDescriptorResolveTest() {
|
||||
|
||||
// Test directives should look like [// val testedPropertyName: expectedValue]
|
||||
fun doConstantTest(path: String) {
|
||||
|
||||
@@ -18,7 +18,7 @@ package org.jetbrains.jet
|
||||
|
||||
import com.google.gson.JsonObject
|
||||
|
||||
fun JsonObject.getString(name: String): String {
|
||||
public fun JsonObject.getString(name: String): String {
|
||||
val member = getNullableString(name)
|
||||
if (member == null) {
|
||||
throw IllegalStateException("Member with name '$name' is expected in '$this'")
|
||||
@@ -27,4 +27,4 @@ fun JsonObject.getString(name: String): String {
|
||||
return member
|
||||
}
|
||||
|
||||
fun JsonObject.getNullableString(name: String): String? = this[name]?.getAsString()
|
||||
public fun JsonObject.getNullableString(name: String): String? = this[name]?.getAsString()
|
||||
@@ -20,7 +20,7 @@ import java.util.HashMap
|
||||
import java.util.Collections
|
||||
|
||||
deprecated("Replace with filterKeys when bootstrapped")
|
||||
fun <K, V> Map<K, V>.filterKeys_tmp(predicate: (K)->Boolean): Map<K, V> {
|
||||
public fun <K, V> Map<K, V>.filterKeys_tmp(predicate: (K)->Boolean): Map<K, V> {
|
||||
val result = HashMap<K, V>()
|
||||
for ((k, v) in this) {
|
||||
if (predicate(k)) {
|
||||
@@ -30,6 +30,6 @@ fun <K, V> Map<K, V>.filterKeys_tmp(predicate: (K)->Boolean): Map<K, V> {
|
||||
return result
|
||||
}
|
||||
|
||||
fun <T: Any> T?.singletonOrEmptyList(): List<T> = if (this != null) Collections.singletonList(this) else Collections.emptyList()
|
||||
public fun <T: Any> T?.singletonOrEmptyList(): List<T> = if (this != null) Collections.singletonList(this) else Collections.emptyList()
|
||||
|
||||
fun <T: Any> T?.singletonOrEmptySet(): Set<T> = if (this != null) Collections.singleton(this) else Collections.emptySet()
|
||||
public fun <T: Any> T?.singletonOrEmptySet(): Set<T> = if (this != null) Collections.singleton(this) else Collections.emptySet()
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ class LazyPackageFragmentForJavaPackage(
|
||||
override fun createMemberScope() = LazyPackageFragmentScopeForJavaPackage(c, jPackage, this)
|
||||
}
|
||||
|
||||
class LazyPackageFragmentForJavaClass(
|
||||
public class LazyPackageFragmentForJavaClass(
|
||||
c: LazyJavaResolverContext,
|
||||
containingDeclaration: ModuleDescriptor,
|
||||
private val jClass: JavaClass
|
||||
|
||||
+2
-2
@@ -23,7 +23,7 @@ public trait PackageFragmentDescriptor : ClassOrPackageFragmentDescriptor {
|
||||
|
||||
override fun getContainingDeclaration(): ModuleDescriptor
|
||||
|
||||
val fqName: FqName
|
||||
public val fqName: FqName
|
||||
|
||||
fun getMemberScope(): JetScope
|
||||
public fun getMemberScope(): JetScope
|
||||
}
|
||||
|
||||
@@ -22,12 +22,12 @@ import java.util.Collections
|
||||
|
||||
public trait Annotations : Iterable<AnnotationDescriptor> {
|
||||
|
||||
fun isEmpty(): Boolean
|
||||
public fun isEmpty(): Boolean
|
||||
|
||||
fun findAnnotation(fqName: FqName): AnnotationDescriptor?
|
||||
public fun findAnnotation(fqName: FqName): AnnotationDescriptor?
|
||||
|
||||
class object {
|
||||
val EMPTY: Annotations = object : Annotations {
|
||||
public val EMPTY: Annotations = object : Annotations {
|
||||
override fun isEmpty() = true
|
||||
|
||||
override fun findAnnotation(fqName: FqName) = null
|
||||
|
||||
+1
-1
@@ -20,5 +20,5 @@ import org.jetbrains.jet.lang.resolve.name.FqName
|
||||
|
||||
// marker for DescriptorRenderer to treat specially in decompiler mode
|
||||
public trait MissingDependencyErrorClass {
|
||||
val fullFqName: FqName
|
||||
public val fullFqName: FqName
|
||||
}
|
||||
@@ -26,13 +26,13 @@ public trait StorageManager {
|
||||
* NOTE: if compute() has side-effects the WEAK reference kind is dangerous: the side-effects will be repeated if
|
||||
* the value gets collected and then re-computed
|
||||
*/
|
||||
fun createMemoizedFunction<K, V: Any>(compute: (K) -> V): MemoizedFunctionToNotNull<K, V>
|
||||
public fun createMemoizedFunction<K, V: Any>(compute: (K) -> V): MemoizedFunctionToNotNull<K, V>
|
||||
|
||||
fun createMemoizedFunctionWithNullableValues<K, V: Any>(compute: (K) -> V?): MemoizedFunctionToNullable<K, V>
|
||||
public fun createMemoizedFunctionWithNullableValues<K, V: Any>(compute: (K) -> V?): MemoizedFunctionToNullable<K, V>
|
||||
|
||||
fun createLazyValue<T: Any>(computable: () -> T): NotNullLazyValue<T>
|
||||
public fun createLazyValue<T: Any>(computable: () -> T): NotNullLazyValue<T>
|
||||
|
||||
fun createRecursionTolerantLazyValue<T: Any>(computable: () -> T, onRecursiveCall: T): NotNullLazyValue<T>
|
||||
public fun createRecursionTolerantLazyValue<T: Any>(computable: () -> T, onRecursiveCall: T): NotNullLazyValue<T>
|
||||
|
||||
/**
|
||||
* @param onRecursiveCall is called if the computation calls itself recursively.
|
||||
@@ -41,17 +41,17 @@ public trait StorageManager {
|
||||
* otherwise it's executed and its result is returned
|
||||
* @param postCompute is called after the value is computed, but before any other thread sees it
|
||||
*/
|
||||
fun createLazyValueWithPostCompute<T: Any>(computable: () -> T, onRecursiveCall: ((Boolean) -> T)?, postCompute: (T) -> Unit): NotNullLazyValue<T>
|
||||
public fun createLazyValueWithPostCompute<T: Any>(computable: () -> T, onRecursiveCall: ((Boolean) -> T)?, postCompute: (T) -> Unit): NotNullLazyValue<T>
|
||||
|
||||
fun createNullableLazyValue<T: Any>(computable: () -> T?): NullableLazyValue<T>
|
||||
public fun createNullableLazyValue<T: Any>(computable: () -> T?): NullableLazyValue<T>
|
||||
|
||||
fun createRecursionTolerantNullableLazyValue<T: Any>(computable: () -> T?, onRecursiveCall: T?): NullableLazyValue<T>
|
||||
public fun createRecursionTolerantNullableLazyValue<T: Any>(computable: () -> T?, onRecursiveCall: T?): NullableLazyValue<T>
|
||||
|
||||
/**
|
||||
* {@code postCompute} is called after the value is computed, but before any other thread sees it (the current thread may
|
||||
* see it in between)
|
||||
*/
|
||||
fun createNullableLazyValueWithPostCompute<T: Any>(computable: () -> T?, postCompute: (T?) -> Unit): NullableLazyValue<T>
|
||||
public fun createNullableLazyValueWithPostCompute<T: Any>(computable: () -> T?, postCompute: (T?) -> Unit): NullableLazyValue<T>
|
||||
|
||||
fun compute<T>(computable: () -> T): T
|
||||
public fun compute<T>(computable: () -> T): T
|
||||
}
|
||||
|
||||
@@ -20,11 +20,11 @@ public trait MemoizedFunctionToNotNull<P, R: Any> : Function1<P, R>
|
||||
public trait MemoizedFunctionToNullable<P, R: Any> : Function1<P, R?>
|
||||
|
||||
public trait NotNullLazyValue<T: Any> : Function0<T> {
|
||||
fun isComputed(): Boolean
|
||||
public fun isComputed(): Boolean
|
||||
}
|
||||
|
||||
public trait NullableLazyValue<T: Any> : Function0<T?> {
|
||||
fun isComputed(): Boolean
|
||||
public fun isComputed(): Boolean
|
||||
}
|
||||
|
||||
fun <T> NotNullLazyValue<T>.get(_this: Any?, p: PropertyMetadata): T = invoke()
|
||||
public fun <T> NotNullLazyValue<T>.get(_this: Any?, p: PropertyMetadata): T = invoke()
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
|
||||
package org.jetbrains.kotlin.util
|
||||
|
||||
fun <T: Any, R> T?.inn(then: (T) -> R, _else: R): R = if (this != null) then(this) else _else
|
||||
public fun <T: Any, R> T?.inn(then: (T) -> R, _else: R): R = if (this != null) then(this) else _else
|
||||
|
||||
fun <T: Any> T?.sure(message: String): T = this ?: throw AssertionError(message)
|
||||
public fun <T: Any> T?.sure(message: String): T = this ?: throw AssertionError(message)
|
||||
|
||||
fun <T> T.printAndReturn(message: String = ""): T {
|
||||
if (!message.isEmpty()) {
|
||||
|
||||
@@ -32,25 +32,25 @@ import org.jetbrains.org.objectweb.asm.tree.IincInsnNode
|
||||
|
||||
class UnsupportedByteCodeException(message: String) : RuntimeException(message)
|
||||
|
||||
trait Eval {
|
||||
fun loadClass(classType: Type): Value
|
||||
fun loadString(str: String): Value
|
||||
fun newInstance(classType: Type): Value
|
||||
fun isInstanceOf(value: Value, targetType: Type): Boolean
|
||||
public trait Eval {
|
||||
public fun loadClass(classType: Type): Value
|
||||
public fun loadString(str: String): Value
|
||||
public fun newInstance(classType: Type): Value
|
||||
public fun isInstanceOf(value: Value, targetType: Type): Boolean
|
||||
|
||||
fun newArray(arrayType: Type, size: Int): Value
|
||||
fun newMultiDimensionalArray(arrayType: Type, dimensionSizes: List<Int>): Value
|
||||
fun getArrayLength(array: Value): Value
|
||||
fun getArrayElement(array: Value, index: Value): Value
|
||||
fun setArrayElement(array: Value, index: Value, newValue: Value)
|
||||
public fun newArray(arrayType: Type, size: Int): Value
|
||||
public fun newMultiDimensionalArray(arrayType: Type, dimensionSizes: List<Int>): Value
|
||||
public fun getArrayLength(array: Value): Value
|
||||
public fun getArrayElement(array: Value, index: Value): Value
|
||||
public fun setArrayElement(array: Value, index: Value, newValue: Value)
|
||||
|
||||
fun getStaticField(fieldDesc: FieldDescription): Value
|
||||
fun setStaticField(fieldDesc: FieldDescription, newValue: Value)
|
||||
fun invokeStaticMethod(methodDesc: MethodDescription, arguments: List<Value>): Value
|
||||
public fun getStaticField(fieldDesc: FieldDescription): Value
|
||||
public fun setStaticField(fieldDesc: FieldDescription, newValue: Value)
|
||||
public fun invokeStaticMethod(methodDesc: MethodDescription, arguments: List<Value>): Value
|
||||
|
||||
fun getField(instance: Value, fieldDesc: FieldDescription): Value
|
||||
fun setField(instance: Value, fieldDesc: FieldDescription, newValue: Value)
|
||||
fun invokeMethod(instance: Value, methodDesc: MethodDescription, arguments: List<Value>, invokespecial: Boolean = false): Value
|
||||
public fun getField(instance: Value, fieldDesc: FieldDescription): Value
|
||||
public fun setField(instance: Value, fieldDesc: FieldDescription, newValue: Value)
|
||||
public fun invokeMethod(instance: Value, methodDesc: MethodDescription, arguments: List<Value>, invokespecial: Boolean = false): Value
|
||||
}
|
||||
|
||||
class SingleInstructionInterpreter(private val eval: Eval) : Interpreter<Value>(ASM5) {
|
||||
|
||||
@@ -28,29 +28,29 @@ import org.jetbrains.org.objectweb.asm.tree.TryCatchBlockNode
|
||||
import java.util.ArrayList
|
||||
import org.jetbrains.eval4j.ExceptionThrown.ExceptionKind
|
||||
|
||||
trait InterpreterResult {
|
||||
public trait InterpreterResult {
|
||||
override fun toString(): String
|
||||
}
|
||||
|
||||
class ExceptionThrown(val exception: Value, val kind: ExceptionKind): InterpreterResult {
|
||||
public class ExceptionThrown(public val exception: Value, public val kind: ExceptionKind): InterpreterResult {
|
||||
override fun toString(): String = "Thrown $exception: $kind"
|
||||
|
||||
enum class ExceptionKind {
|
||||
public enum class ExceptionKind {
|
||||
FROM_EVALUATED_CODE
|
||||
FROM_EVALUATOR
|
||||
BROKEN_CODE
|
||||
}
|
||||
}
|
||||
|
||||
data class ValueReturned(val result: Value): InterpreterResult {
|
||||
public data class ValueReturned(public val result: Value): InterpreterResult {
|
||||
override fun toString(): String = "Returned $result"
|
||||
}
|
||||
|
||||
class AbnormalTermination(val message: String): InterpreterResult {
|
||||
public class AbnormalTermination(public val message: String): InterpreterResult {
|
||||
override fun toString(): String = "Terminated abnormally: $message"
|
||||
}
|
||||
|
||||
trait InterpretationEventHandler {
|
||||
public trait InterpretationEventHandler {
|
||||
|
||||
class object {
|
||||
object NONE : InterpretationEventHandler {
|
||||
@@ -78,7 +78,7 @@ class ThrownFromEvaluatedCodeException(val exception: Value): RuntimeException()
|
||||
override fun toString(): String = "Thrown from evaluated code: $exception"
|
||||
}
|
||||
|
||||
fun interpreterLoop(
|
||||
public fun interpreterLoop(
|
||||
m: MethodNode,
|
||||
initialState: Frame<Value>,
|
||||
eval: Eval,
|
||||
|
||||
@@ -27,7 +27,7 @@ import com.sun.jdi.Method
|
||||
val CLASS = Type.getType(javaClass<Class<*>>())
|
||||
val BOOTSTRAP_CLASS_DESCRIPTORS = setOf("Ljava/lang/String;", "Ljava/lang/ClassLoader;", "Ljava/lang/Class;")
|
||||
|
||||
class JDIEval(
|
||||
public class JDIEval(
|
||||
private val vm: jdi.VirtualMachine,
|
||||
private val classLoader: jdi.ClassLoaderReference,
|
||||
private val thread: jdi.ThreadReference,
|
||||
|
||||
@@ -23,7 +23,7 @@ import org.jetbrains.org.objectweb.asm.Type
|
||||
import org.jetbrains.org.objectweb.asm.Opcodes.*
|
||||
import com.sun.jdi
|
||||
|
||||
fun makeInitialFrame(methodNode: MethodNode, arguments: List<Value>): Frame<Value> {
|
||||
public fun makeInitialFrame(methodNode: MethodNode, arguments: List<Value>): Frame<Value> {
|
||||
val isStatic = (methodNode.access and ACC_STATIC) != 0
|
||||
|
||||
val params = Type.getArgumentTypes(methodNode.desc)
|
||||
@@ -51,7 +51,7 @@ class JDIFailureException(message: String?, cause: Throwable? = null): RuntimeEx
|
||||
|
||||
fun <T: Any> T?.sure(message: String? = null): T = this ?: throw JDIFailureException(message)
|
||||
|
||||
fun jdi.Value?.asValue(): Value {
|
||||
public fun jdi.Value?.asValue(): Value {
|
||||
return when (this) {
|
||||
null -> NULL_VALUE
|
||||
is jdi.VoidValue -> VOID_VALUE
|
||||
@@ -76,7 +76,7 @@ val Value.jdiObj: jdi.ObjectReference?
|
||||
val Value.jdiClass: jdi.ClassObjectReference?
|
||||
get() = this.jdiObj as jdi.ClassObjectReference?
|
||||
|
||||
fun Value.asJdiValue(vm: jdi.VirtualMachine, expectedType: Type): jdi.Value? {
|
||||
public fun Value.asJdiValue(vm: jdi.VirtualMachine, expectedType: Type): jdi.Value? {
|
||||
return when (this) {
|
||||
NULL_VALUE -> null
|
||||
VOID_VALUE -> vm.mirrorOfVoid()
|
||||
|
||||
@@ -53,7 +53,7 @@ val MethodDescription.parameterTypes: List<Type>
|
||||
get() = Type.getArgumentTypes(desc).toList()
|
||||
|
||||
|
||||
class FieldDescription(
|
||||
public class FieldDescription(
|
||||
ownerInternalName: String,
|
||||
name: String,
|
||||
desc: String,
|
||||
|
||||
@@ -19,9 +19,9 @@ package org.jetbrains.eval4j
|
||||
import org.jetbrains.org.objectweb.asm.Type
|
||||
import org.jetbrains.org.objectweb.asm.tree.LabelNode
|
||||
|
||||
trait Value : org.jetbrains.org.objectweb.asm.tree.analysis.Value {
|
||||
val asmType: Type
|
||||
val valid: Boolean
|
||||
public trait Value : org.jetbrains.org.objectweb.asm.tree.analysis.Value {
|
||||
public val asmType: Type
|
||||
public val valid: Boolean
|
||||
override fun getSize(): Int = asmType.getSize()
|
||||
|
||||
override fun toString(): String
|
||||
@@ -57,7 +57,7 @@ abstract class AbstractValueBase<V>(
|
||||
override val asmType: Type
|
||||
) : Value {
|
||||
override val valid = true
|
||||
abstract val value: V
|
||||
public abstract val value: V
|
||||
|
||||
override fun toString() = "$value: $asmType"
|
||||
|
||||
@@ -81,7 +81,7 @@ class IntValue(value: Int, asmType: Type): AbstractValue<Int>(value, asmType)
|
||||
class LongValue(value: Long): AbstractValue<Long>(value, Type.LONG_TYPE)
|
||||
class FloatValue(value: Float): AbstractValue<Float>(value, Type.FLOAT_TYPE)
|
||||
class DoubleValue(value: Double): AbstractValue<Double>(value, Type.DOUBLE_TYPE)
|
||||
class ObjectValue(value: Any?, asmType: Type): AbstractValue<Any?>(value, asmType)
|
||||
public class ObjectValue(value: Any?, asmType: Type): AbstractValue<Any?>(value, asmType)
|
||||
class NewObjectValue(asmType: Type): AbstractValueBase<Any?>(asmType) {
|
||||
override var value: Any? = null
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ import org.jetbrains.jet.plugin.JetLightCodeInsightFixtureTestCase
|
||||
import com.intellij.testFramework.LightProjectDescriptor
|
||||
import com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase
|
||||
|
||||
abstract class AbstractDataFlowValueRenderingTest: JetLightCodeInsightFixtureTestCase() {
|
||||
public abstract class AbstractDataFlowValueRenderingTest: JetLightCodeInsightFixtureTestCase() {
|
||||
override fun getTestDataPath() : String {
|
||||
return PluginTestCaseBase.getTestDataPathBase() + "/dataFlowValueRendering/"
|
||||
}
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ import com.intellij.testFramework.fixtures.JavaCodeInsightTestFixture
|
||||
import kotlin.properties.Delegates
|
||||
import org.jetbrains.jet.InTextDirectivesUtils
|
||||
|
||||
abstract class AbstractSmartCompletionHandlerTest() : CompletionHandlerTestBase() {
|
||||
public abstract class AbstractSmartCompletionHandlerTest() : CompletionHandlerTestBase() {
|
||||
private val INVOCATION_COUNT_PREFIX = "INVOCATION_COUNT:"
|
||||
private val LOOKUP_STRING_PREFIX = "ELEMENT:"
|
||||
private val ELEMENT_TEXT_PREFIX = "ELEMENT_TEXT:"
|
||||
|
||||
@@ -28,7 +28,7 @@ import com.intellij.debugger.engine.BasicStepMethodFilter
|
||||
import com.intellij.openapi.util.Computable
|
||||
import org.jetbrains.jet.plugin.refactoring.runReadAction
|
||||
|
||||
abstract class AbstractKotlinSteppingTest : KotlinDebuggerTestCase() {
|
||||
public abstract class AbstractKotlinSteppingTest : KotlinDebuggerTestCase() {
|
||||
|
||||
protected fun doStepIntoTest(path: String) {
|
||||
createDebugProcess(path)
|
||||
|
||||
@@ -28,7 +28,7 @@ import com.intellij.psi.util.PsiFormatUtilBase
|
||||
import org.jetbrains.jet.plugin.JetLightCodeInsightFixtureTestCase
|
||||
import com.intellij.testFramework.LightProjectDescriptor
|
||||
|
||||
abstract class AbstractSmartStepIntoTest : JetLightCodeInsightFixtureTestCase() {
|
||||
public abstract class AbstractSmartStepIntoTest : JetLightCodeInsightFixtureTestCase() {
|
||||
private val fixture: JavaCodeInsightTestFixture
|
||||
get() = myFixture
|
||||
|
||||
|
||||
+2
-2
@@ -30,7 +30,7 @@ import org.jetbrains.jet.lang.resolve.name.FqName
|
||||
import org.jetbrains.jet.InTextDirectivesUtils
|
||||
import org.jetbrains.jet.lang.psi.JetCodeFragment
|
||||
|
||||
abstract class AbstractCodeFragmentHighlightingTest : AbstractJetPsiCheckerTest() {
|
||||
public abstract class AbstractCodeFragmentHighlightingTest : AbstractJetPsiCheckerTest() {
|
||||
override fun doTest(filePath: String) {
|
||||
myFixture.configureByCodeFragment(filePath)
|
||||
myFixture.checkHighlighting(true, false, false)
|
||||
@@ -50,7 +50,7 @@ abstract class AbstractCodeFragmentHighlightingTest : AbstractJetPsiCheckerTest(
|
||||
}
|
||||
}
|
||||
|
||||
abstract class AbstractCodeFragmentCompletionTest : AbstractJvmBasicCompletionTest() {
|
||||
public abstract class AbstractCodeFragmentCompletionTest : AbstractJvmBasicCompletionTest() {
|
||||
override fun setUpFixture(testPath: String) {
|
||||
myFixture.configureByCodeFragment(testPath)
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ import org.jetbrains.jet.plugin.JetLightCodeInsightFixtureTestCase
|
||||
import com.intellij.codeInsight.CodeInsightSettings
|
||||
import org.jetbrains.jet.InTextDirectivesUtils
|
||||
|
||||
abstract class AbstractShortenRefsTest : JetLightCodeInsightFixtureTestCase() {
|
||||
public abstract class AbstractShortenRefsTest : JetLightCodeInsightFixtureTestCase() {
|
||||
override fun getTestDataPath() = JetTestCaseBuilder.getHomeDirectory()
|
||||
override fun getProjectDescriptor() = JetWithJdkAndRuntimeLightProjectDescriptor.INSTANCE
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ import com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase
|
||||
import com.intellij.testFramework.LightProjectDescriptor
|
||||
import org.jetbrains.jet.plugin.JetWithJdkAndRuntimeLightProjectDescriptor
|
||||
|
||||
abstract class AbstractJavaToKotlinConverterTest() : LightCodeInsightFixtureTestCase() {
|
||||
public abstract class AbstractJavaToKotlinConverterTest() : LightCodeInsightFixtureTestCase() {
|
||||
val testHeaderPattern = Pattern.compile("//(element|expression|statement|method|class|file|comp)\n")
|
||||
|
||||
override fun setUp() {
|
||||
|
||||
Reference in New Issue
Block a user