Minor: make variables initialized in defineClass lateinit instead of nullable.

This commit is contained in:
Ilya Gorbunov
2016-03-15 03:08:24 +03:00
parent d9329456b5
commit 1ae0040ca3
5 changed files with 16 additions and 18 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2015 JetBrains s.r.o.
* Copyright 2010-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -101,9 +101,9 @@ abstract class AnnotationCollectorExtensionBase(val supportInheritedAnnotations:
}
}
private var currentClassSimpleName: String? = null
private lateinit var currentClassSimpleName: String
private var currentPackageName: String? = null
private lateinit var currentPackageName: String
override fun getVisitor() = classVisitor
@@ -184,13 +184,13 @@ abstract class AnnotationCollectorExtensionBase(val supportInheritedAnnotations:
try {
val annotationId = shortenedAnnotationCache.save(annotationFqName, writer)
val packageName = this.currentPackageName!!
val packageName = this.currentPackageName
val packageNameId = if (!packageName.isEmpty())
shortenedPackageNameCache.save(packageName, writer)
else null
val className = this.currentClassSimpleName!!
val className = this.currentClassSimpleName
val outputClassName = getOutputClassName(packageNameId, className)
val elementName = if (name != null) " $name" else ""