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
@@ -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)
}