AbstractStringBuilder, StringBuilder and java.io.File annotated with nullable/notnull

This commit is contained in:
Andrey Breslav
2012-09-20 15:07:02 +04:00
parent dadc97d29f
commit 2abe2e581d
8 changed files with 460 additions and 12 deletions
+1 -1
View File
@@ -207,6 +207,6 @@ fun File.readLines(charset : String = "UTF-8") : List<String> {
*/
fun File.listFiles(filter : (file : File) -> Boolean) : Array<File>? = listFiles(
object : FileFilter {
override fun accept(file: File?) = filter(file!!)
override fun accept(file: File) = filter(file)
}
) as Array<File>?
@@ -35,7 +35,7 @@ class Html2CompilerPlugin(private val compilerArguments: KDocArguments) : Doclet
private val sourceDirPaths: List<String> = sourceDirs.map { d -> d.getPath()!! }
private fun fileToWrite(psiFile: PsiFile): String {
val file = File((psiFile.getVirtualFile() as CoreLocalVirtualFile).getPath()).getCanonicalFile()!!
val file = File((psiFile.getVirtualFile() as CoreLocalVirtualFile).getPath()!!).getCanonicalFile()!!
val filePath = file.getPath()!!
for (sourceDirPath in sourceDirPaths) {
if (filePath.startsWith(sourceDirPath) && filePath.length() > sourceDirPath.length()) {
@@ -212,7 +212,7 @@ class KModel(val context: BindingContext, val config: KDocConfig, val sourceDirs
sourceDirs.map { file -> file.getCanonicalPath()!! }
fun relativePath(psiFile: PsiFile): String {
val file = File((psiFile.getVirtualFile() as CoreLocalVirtualFile).getPath()).getCanonicalFile()!!
val file = File((psiFile.getVirtualFile() as CoreLocalVirtualFile).getPath()!!).getCanonicalFile()!!
val filePath = file.getPath()!!
for (sourceDirPath in normalizedSourceDirs) {
if (filePath.startsWith(sourceDirPath) && filePath.length() > sourceDirPath.length()) {