Run "Add 'init' keyword in whole project" quickfix

This commit is contained in:
Denis Zharkov
2015-03-31 12:22:34 +03:00
parent 99f1ab333e
commit a4018d9eae
65 changed files with 85 additions and 82 deletions
@@ -115,7 +115,7 @@ public abstract class CoveringTryCatchNodeProcessor<T: IntervalWithHandler>() {
public class DefaultProcessor(val node: MethodNode) : CoveringTryCatchNodeProcessor<TryCatchBlockNodeWrapper>() {
{
init {
node.tryCatchBlocks.forEach { addNode(it) }
}
@@ -194,8 +194,9 @@ public open class DefaultSourceMapper(val sourceInfo: SourceInfo, override val p
var fileMappings: LinkedHashMap<String, RawFileMapping> = linkedMapOf()
protected var origin: RawFileMapping by Delegates.notNull();
{
protected var origin: RawFileMapping by Delegates.notNull()
init {
visitSource(sourceInfo.source, sourceInfo.pathOrCleanFQN)
//map interval
(1..maxUsedValue).forEach {origin.mapLine(it, it - 1, true) }
@@ -52,7 +52,7 @@ public class IncrementalPackageFragmentProvider(
val fqNameToPackageFragment = HashMap<FqName, PackageFragmentDescriptor>()
val fqNamesToLoad: Set<FqName>
;{
init {
fun createPackageFragment(fqName: FqName) {
if (fqNameToPackageFragment.containsKey(fqName)) {
return
@@ -29,7 +29,7 @@ public class VariableDeclarationInstruction(
element: JetDeclaration,
lexicalScope: LexicalScope
) : InstructionWithNext(element, lexicalScope) {
{
init {
assert(element is JetVariableDeclaration || element is JetParameter) { "Invalid element: ${render(element)}}" }
}
@@ -41,9 +41,9 @@ public abstract class JetCodeFragment(
): JetFile((PsiManager.getInstance(_project) as PsiManagerEx).getFileManager().createFileViewProvider(LightVirtualFile(name, JetFileType.INSTANCE, text), true), false), JavaCodeFragment {
private var viewProvider = super<JetFile>.getViewProvider() as SingleRootFileViewProvider
private var myImports = LinkedHashSet<String>();
private var myImports = LinkedHashSet<String>()
{
init {
getViewProvider().forceCachedPsi(this)
init(TokenType.CODE_FRAGMENT, elementType)
if (context != null) {
@@ -490,7 +490,7 @@ public class JetPsiFactory(private val project: Project) {
return createExpression(sb.toString()) as JetWhenExpression
}
{
init {
if (subjectText != null) {
sb.append("(").append(subjectText).append(") ")
}
@@ -35,7 +35,7 @@ public class KotlinFunctionStubImpl(
private val hasTypeParameterListBeforeFunctionName: Boolean,
private val isProbablyNothingType: Boolean
) : KotlinStubBaseImpl<JetNamedFunction>(parent, JetStubElementTypes.FUNCTION), KotlinFunctionStub {
{
init {
if (isTopLevel && fqName == null) {
throw IllegalArgumentException("fqName shouldn't be null for top level functions")
}
@@ -38,7 +38,7 @@ public class KotlinPropertyStubImpl(
private val fqName: FqName?
) : KotlinStubBaseImpl<JetProperty>(parent, JetStubElementTypes.PROPERTY), KotlinPropertyStub {
{
init {
if (isTopLevel && fqName == null) {
throw IllegalArgumentException("fqName shouldn't be null for top level properties")
}
@@ -23,7 +23,7 @@ import org.jetbrains.kotlin.lexer.JetModifierKeywordToken
import kotlin.platform.platformStatic
public object ModifierMaskUtils {
{
init {
assert(MODIFIER_KEYWORDS_ARRAY.size() <= 32, "Current implementation depends on the ability to represent modifier list as bit mask")
}
@@ -31,7 +31,7 @@ public class MutablePackageFragmentProvider(public val module: ModuleDescriptor)
private val fqNameToPackage = HashMap<FqName, MutablePackageFragmentDescriptor>()
private val subPackages = MultiMap.create<FqName, FqName>()
;{
init {
fqNameToPackage.put(FqName.ROOT, MutablePackageFragmentDescriptor(module, FqName.ROOT))
}
@@ -33,7 +33,7 @@ public class FakeCallableDescriptorForObject(
public val classDescriptor: ClassDescriptor
) : DeclarationDescriptorWithVisibility by classDescriptor.getClassObjectReferenceTarget(), VariableDescriptor {
{
init {
assert(classDescriptor.getClassObjectType() != null) {
"FakeCallableDescriptorForObject can be created only for objects, classes with companion object or enum entries: $classDescriptor"
}
@@ -90,7 +90,7 @@ public class LazyAnnotationDescriptor(
val annotationEntry: JetAnnotationEntry
) : AnnotationDescriptor, LazyEntity {
{
init {
c.trace.record(BindingContext.ANNOTATION, annotationEntry, this)
}
@@ -56,7 +56,7 @@ public class LazyScriptDescriptor(
ScriptDescriptor.NAME,
jetScript.toSourceElement()
) {
{
init {
resolveSession.getTrace().record(BindingContext.SCRIPT, jetScript, this)
}
@@ -72,7 +72,7 @@ public class KotlinLightClassForPackage private(
}
}
{
init {
assert(!files.isEmpty()) { "No files for package " + packageFqName }
}
@@ -178,7 +178,7 @@ public abstract class AbstractJvmRuntimeDescriptorLoaderTest : TestCaseWithTmpdi
private class SyntheticPackageViewForTest(private val module: ModuleDescriptor) : PackageViewDescriptor {
private val scope = WritableScopeImpl(JetScope.Empty, this, RedeclarationHandler.THROW_EXCEPTION, "runtime descriptor loader test")
;{
init {
scope.changeLockLevel(WritableScope.LockLevel.BOTH)
}
@@ -34,7 +34,7 @@ private val INCOMPLETE_PATTERN = Pattern.compile("\\.\\.\\.( *)(.*)$")
private val INCOMPLETE_LINE_MESSAGE = "incomplete line"
public abstract class AbstractReplInterpreterTest : UsefulTestCase() {
{
init {
System.setProperty("java.awt.headless", "true")
}
@@ -132,7 +132,7 @@ class MutableDiagnosticsTest : KotlinTestWithEnvironment() {
private inner class DummyDiagnostic : Diagnostic {
val dummyElement = JetPsiFactory(getEnvironment().project).createType("Int")
;{
init {
dummyElement.getContainingJetFile().doNotAnalyze = null
}
@@ -37,7 +37,7 @@ public class ConstraintSystemTestData(
private val functionFoo: FunctionDescriptor
private val scopeToResolveTypeParameters: JetScope
{
init {
val functions = context.getSliceContents(BindingContext.FUNCTION)
functionFoo = findFunctionByName(functions.values(), "foo")
val function = DescriptorToSourceUtils.descriptorToDeclaration(functionFoo) as JetFunction
@@ -37,9 +37,9 @@ public object LibraryUtils {
private val METAINF = "META-INF/"
private val MANIFEST_PATH = "${METAINF}MANIFEST.MF"
private val METAINF_RESOURCES = "${METAINF}resources/"
private val KOTLIN_JS_MODULE_ATTRIBUTE_NAME = Attributes.Name(KOTLIN_JS_MODULE_NAME);
private val KOTLIN_JS_MODULE_ATTRIBUTE_NAME = Attributes.Name(KOTLIN_JS_MODULE_NAME)
{
init {
var jsStdLib = ""
var jsLib = ""