Minor: reformat

This commit is contained in:
Nikolay Krasko
2015-09-07 00:42:58 +03:00
parent 69038ba6c0
commit e99b0e751f
5 changed files with 19 additions and 17 deletions
@@ -24,15 +24,15 @@ public class LexicalScope(val parentScope: LexicalScope?, val element: JetElemen
private val d = (parentScope?.depth ?: 0) + 1 private val d = (parentScope?.depth ?: 0) + 1
val depth: Int get() = d val depth: Int get() = d
val lexicalScopeForContainingDeclaration: LexicalScope? by lazy { computeLexicalScopeForContainingDeclaration() } val lexicalScopeForContainingDeclaration: LexicalScope? by lazy {
private fun computeLexicalScopeForContainingDeclaration(): LexicalScope? {
var scope: LexicalScope? = this var scope: LexicalScope? = this
while (scope != null) { while (scope != null) {
if (scope.element is JetDeclaration) { if (scope.element is JetDeclaration) {
return scope return@lazy scope
} }
scope = scope.parentScope scope = scope.parentScope
} }
return null
return@lazy null
} }
} }
@@ -27,8 +27,7 @@ import java.util.HashMap;
import java.util.Map; import java.util.Map;
public final class DiagnosticFactoryToRendererMap { public final class DiagnosticFactoryToRendererMap {
private final Map<DiagnosticFactory<?>, DiagnosticRenderer<?>> map = private final Map<DiagnosticFactory<?>, DiagnosticRenderer<?>> map = new HashMap<DiagnosticFactory<?>, DiagnosticRenderer<?>>();
new HashMap<DiagnosticFactory<?>, DiagnosticRenderer<?>>();
private boolean immutable = false; private boolean immutable = false;
private void checkMutability() { private void checkMutability() {
@@ -91,7 +91,11 @@ public open class KotlinLightClassForExplicitDeclaration(
var declaration: PsiElement? = JetPsiUtil.getTopmostParentOfTypes( var declaration: PsiElement? = JetPsiUtil.getTopmostParentOfTypes(
classOrObject, classOrObject,
javaClass<JetNamedFunction>(), javaClass<JetConstructor<*>>(), javaClass<JetProperty>(), javaClass<JetClassInitializer>(), javaClass<JetParameter>()) JetNamedFunction::class.java,
JetConstructor::class.java,
JetProperty::class.java,
JetClassInitializer::class.java,
JetParameter::class.java)
if (declaration is JetParameter) { if (declaration is JetParameter) {
declaration = declaration.getStrictParentOfType<JetNamedDeclaration>() declaration = declaration.getStrictParentOfType<JetNamedDeclaration>()
@@ -362,9 +362,7 @@ public class LightClassUtil {
} }
@NotNull @NotNull
public static PsiTypeParameterList buildLightTypeParameterList( public static PsiTypeParameterList buildLightTypeParameterList(PsiTypeParameterListOwner owner, JetDeclaration declaration) {
PsiTypeParameterListOwner owner,
JetDeclaration declaration) {
LightTypeParameterListBuilder builder = new KotlinLightTypeParameterListBuilder(owner.getManager()); LightTypeParameterListBuilder builder = new KotlinLightTypeParameterListBuilder(owner.getManager());
if (declaration instanceof JetTypeParameterListOwner) { if (declaration instanceof JetTypeParameterListOwner) {
JetTypeParameterListOwner typeParameterListOwner = (JetTypeParameterListOwner) declaration; JetTypeParameterListOwner typeParameterListOwner = (JetTypeParameterListOwner) declaration;
@@ -25,18 +25,19 @@ import org.jetbrains.kotlin.rmi.kotlinr.KotlinCompilerClient
import org.jetbrains.kotlin.test.JetTestUtils import org.jetbrains.kotlin.test.JetTestUtils
import java.io.ByteArrayOutputStream import java.io.ByteArrayOutputStream
import java.io.File import java.io.File
import java.io.IOException
import java.util.*
public class CompilerDaemonTest : KotlinIntegrationTestBase() { public class CompilerDaemonTest : KotlinIntegrationTestBase() {
data class CompilerResults(val resultCode: Int, val out: String) data class CompilerResults(val resultCode: Int, val out: String)
val daemonOptions by lazy { DaemonOptions(runFilesPath = tmpdir.absolutePath) } val daemonOptions by lazy(LazyThreadSafetyMode.NONE) { DaemonOptions(runFilesPath = tmpdir.absolutePath) }
val daemonJVMOptions by lazy { DaemonJVMOptions() } val daemonJVMOptions by lazy(LazyThreadSafetyMode.NONE) { DaemonJVMOptions() }
val compilerId by lazy { CompilerId.makeCompilerId( File(KotlinIntegrationTestBase.getCompilerLib(), "kotlin-compiler.jar"), val compilerId by lazy(LazyThreadSafetyMode.NONE) {
File("dependencies/bootstrap-compiler/Kotlin/kotlinc/lib/kotlin-runtime.jar"), CompilerId.makeCompilerId(
File("dependencies/bootstrap-compiler/Kotlin/kotlinc/lib/kotlin-reflect.jar")) } File(KotlinIntegrationTestBase.getCompilerLib(), "kotlin-compiler.jar"),
File("dependencies/bootstrap-compiler/Kotlin/kotlinc/lib/kotlin-runtime.jar"),
File("dependencies/bootstrap-compiler/Kotlin/kotlinc/lib/kotlin-reflect.jar"))
}
private fun compileOnDaemon(args: Array<out String>): CompilerResults { private fun compileOnDaemon(args: Array<out String>): CompilerResults {
System.setProperty(COMPILE_DAEMON_VERBOSE_REPORT_PROPERTY, "") System.setProperty(COMPILE_DAEMON_VERBOSE_REPORT_PROPERTY, "")