From 79739b7090c4647d54b203b47a4c85a7e9f3b33f Mon Sep 17 00:00:00 2001 From: Zalim Bashorov Date: Mon, 6 Apr 2015 17:29:58 +0300 Subject: [PATCH] Fix build. --- .../org/jetbrains/kotlin/idea/completion/CompletionUtils.kt | 4 +++- .../jetbrains/kotlin/idea/formatter/SynteticKotlinBlock.kt | 4 +++- .../createFromUsage/callableBuilder/CallableBuilder.kt | 4 +++- .../refactoring/introduce/extractionEngine/duplicateUtil.kt | 4 +++- j2k/src/org/jetbrains/kotlin/j2k/DocCommentConverter.kt | 3 ++- 5 files changed, 14 insertions(+), 5 deletions(-) diff --git a/idea/idea-completion/src/org/jetbrains/kotlin/idea/completion/CompletionUtils.kt b/idea/idea-completion/src/org/jetbrains/kotlin/idea/completion/CompletionUtils.kt index 8ca154425f8..743fd3c3b58 100644 --- a/idea/idea-completion/src/org/jetbrains/kotlin/idea/completion/CompletionUtils.kt +++ b/idea/idea-completion/src/org/jetbrains/kotlin/idea/completion/CompletionUtils.kt @@ -300,6 +300,8 @@ private fun createKeywordWithLabelElement(keyword: String, label: String?): Look fun breakOrContinueExpressionItems(position: JetElement, breakOrContinue: String): Collection { val result = ArrayList() + + @parentsLoop for (parent in position.parents()) { when (parent) { is JetLoopExpression -> { @@ -313,7 +315,7 @@ fun breakOrContinueExpressionItems(position: JetElement, breakOrContinue: String } } - is JetDeclarationWithBody -> break //TODO: support non-local break's&continue's when they are supported by compiler + is JetDeclarationWithBody -> break@parentsLoop //TODO: support non-local break's&continue's when they are supported by compiler } } return result diff --git a/idea/src/org/jetbrains/kotlin/idea/formatter/SynteticKotlinBlock.kt b/idea/src/org/jetbrains/kotlin/idea/formatter/SynteticKotlinBlock.kt index 9ebef4360f9..b8f3222c9fb 100644 --- a/idea/src/org/jetbrains/kotlin/idea/formatter/SynteticKotlinBlock.kt +++ b/idea/src/org/jetbrains/kotlin/idea/formatter/SynteticKotlinBlock.kt @@ -56,6 +56,8 @@ public class SyntheticKotlinBlock( override fun toString(): String { var child = subBlocks.first() var treeNode: ASTNode? = null + + @loop while (treeNode == null) when (child) { is AbstractBlock -> { treeNode = (child as AbstractBlock).getNode() @@ -63,7 +65,7 @@ public class SyntheticKotlinBlock( is SyntheticKotlinBlock -> { child = (child as SyntheticKotlinBlock).getSubBlocks().first() } - else -> break + else -> break@loop } val textRange = getTextRange() diff --git a/idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/callableBuilder/CallableBuilder.kt b/idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/callableBuilder/CallableBuilder.kt index a6e3ecc5ee2..f9a68d0746c 100644 --- a/idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/callableBuilder/CallableBuilder.kt +++ b/idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/callableBuilder/CallableBuilder.kt @@ -506,12 +506,14 @@ class CallableBuilder(val config: CallableBuilderConfiguration) { fun calcNecessaryEmptyLines(decl: JetDeclaration, after: Boolean): Int { var lineBreaksPresent: Int = 0 var neighbor: PsiElement? = null + + @siblingsLoop for (sibling in decl.siblings(forward = after, withItself = false)) { when (sibling) { is PsiWhiteSpace -> lineBreaksPresent += (sibling.getText() ?: "").count { it == '\n' } else -> { neighbor = sibling - break + break@siblingsLoop } } } diff --git a/idea/src/org/jetbrains/kotlin/idea/refactoring/introduce/extractionEngine/duplicateUtil.kt b/idea/src/org/jetbrains/kotlin/idea/refactoring/introduce/extractionEngine/duplicateUtil.kt index b1f7a180acf..7d80b5e3861 100644 --- a/idea/src/org/jetbrains/kotlin/idea/refactoring/introduce/extractionEngine/duplicateUtil.kt +++ b/idea/src/org/jetbrains/kotlin/idea/refactoring/introduce/extractionEngine/duplicateUtil.kt @@ -90,6 +90,8 @@ public fun processDuplicates( if (answer != Messages.YES) return var showAll = false + + @duplicateReplacersLoop for ((i, entry) in duplicateReplacers.entrySet().withIndex()) { val (pattern, replacer) = entry if (!pattern.isValid()) continue @@ -101,7 +103,7 @@ public fun processDuplicates( promptDialog.show() when(promptDialog.getExitCode()) { FindManager.PromptResult.ALL -> showAll = true - FindManager.PromptResult.SKIP -> continue + FindManager.PromptResult.SKIP -> continue@duplicateReplacersLoop FindManager.PromptResult.CANCEL -> return } } diff --git a/j2k/src/org/jetbrains/kotlin/j2k/DocCommentConverter.kt b/j2k/src/org/jetbrains/kotlin/j2k/DocCommentConverter.kt index 0374e2df1db..a0fb108f650 100644 --- a/j2k/src/org/jetbrains/kotlin/j2k/DocCommentConverter.kt +++ b/j2k/src/org/jetbrains/kotlin/j2k/DocCommentConverter.kt @@ -34,9 +34,10 @@ object DocCommentConverter { val html = StringBuilder { appendJavadocElements(docComment.getDescriptionElements()) + @tagsLoop for (tag in docComment.getTags()) { when (tag.getName()) { - "deprecated" -> continue + "deprecated" -> continue@tagsLoop "see" -> append("@see ${convertJavadocLink(tag.content())}\n") else -> appendJavadocElements(tag.getChildren()).append("\n") }