Adjust project code to new labels syntax

This commit is contained in:
Denis Zharkov
2015-04-28 15:43:08 +03:00
parent 1d8786dabf
commit 02659ca22d
18 changed files with 19 additions and 19 deletions
@@ -85,7 +85,7 @@ class BuilderFactoryForDuplicateSignatureDiagnostics(
}
}
@signatures
signatures@
for ((rawSignature, origins) in groupedBySignature.entrySet()) {
if (origins.size() <= 1) continue
@@ -33,7 +33,7 @@ object PrecedingCommentsBinder : WhitespacesAndCommentsBinder {
// 2. bind plain comments
var result = tokens.size()
@tokens for (idx in tokens.indices.reversed()) {
tokens@ for (idx in tokens.indices.reversed()) {
val tokenType = tokens[idx]
when (tokenType) {
JetTokens.WHITE_SPACE -> if (StringUtil.getLineBreakCount(getter[idx]) > 1) break@tokens
@@ -72,7 +72,7 @@ object TrailingCommentsBinder : WhitespacesAndCommentsBinder {
if (tokens.isEmpty()) return 0
var result = 0
@tokens for (idx in tokens.indices) {
tokens@ for (idx in tokens.indices) {
val tokenType = tokens[idx]
when (tokenType) {
JetTokens.WHITE_SPACE -> if (StringUtil.containsLineBreak(getter[idx])) break@tokens
@@ -71,7 +71,7 @@ object DescriptorEquivalenceForOverrides {
if (!ownersEquivalent(a, b, {x, y -> false})) return false
val overridingUtil = OverridingUtil.createWithEqualityAxioms @eq {
val overridingUtil = OverridingUtil.createWithEqualityAxioms eq@ {
c1, c2 ->
if (c1 == c2) return@eq true
@@ -46,7 +46,7 @@ public class LazyJavaPackageFragmentProvider(
else null
}
private val topLevelClasses = c.storageManager.createMemoizedFunctionWithNullableValues @lambda {
private val topLevelClasses = c.storageManager.createMemoizedFunctionWithNullableValues lambda@ {
jClass: JavaClass ->
val fqName = jClass.getFqName()
if (fqName == null) return@lambda null
@@ -268,7 +268,7 @@ class LazyJavaTypeResolver(
return (descriptor as ClassDescriptor).getMemberScope(getArguments())
}
private val nullable = c.storageManager.createLazyValue @l {
private val nullable = c.storageManager.createLazyValue l@ {
when (attr.flexibility) {
FLEXIBLE_LOWER_BOUND -> return@l false
FLEXIBLE_UPPER_BOUND -> return@l true
@@ -136,7 +136,7 @@ public fun interpreterLoop(
}
try {
@loop while (true) {
loop@ while (true) {
val insnOpcode = currentInsn.getOpcode()
val insnType = currentInsn.getType()
@@ -56,7 +56,7 @@ fun suite(): TestSuite {
Thread {
val eventQueue = vm.eventQueue()
@mainLoop while (true) {
mainLoop@ while (true) {
val eventSet = eventQueue.remove()
for (event in eventSet.eventIterator()) {
when (event) {
@@ -90,7 +90,7 @@ private fun getModuleInfoByVirtualFile(project: Project, virtualFile: VirtualFil
val orderEntries = projectFileIndex.getOrderEntriesForFile(virtualFile)
@entries for (orderEntry in orderEntries) {
entries@ for (orderEntry in orderEntries) {
when (orderEntry) {
is LibraryOrderEntry -> {
val library = orderEntry.getLibrary() ?: continue@entries
@@ -299,7 +299,7 @@ private fun createKeywordWithLabelElement(keyword: String, label: String?): Look
fun breakOrContinueExpressionItems(position: JetElement, breakOrContinue: String): Collection<LookupElement> {
val result = ArrayList<LookupElement>()
@parentsLoop
parentsLoop@
for (parent in position.parents()) {
when (parent) {
is JetLoopExpression -> {
@@ -57,7 +57,7 @@ public class SyntheticKotlinBlock(
var child = subBlocks.first()
var treeNode: ASTNode? = null
@loop
loop@
while (treeNode == null) when (child) {
is AbstractBlock -> {
treeNode = (child as AbstractBlock).getNode()
@@ -505,7 +505,7 @@ class CallableBuilder(val config: CallableBuilderConfiguration) {
var lineBreaksPresent: Int = 0
var neighbor: PsiElement? = null
@siblingsLoop
siblingsLoop@
for (sibling in decl.siblings(forward = after, withItself = false)) {
when (sibling) {
is PsiWhiteSpace -> lineBreaksPresent += (sibling.getText() ?: "").count { it == '\n' }
@@ -91,7 +91,7 @@ public fun processDuplicates(
var showAll = false
@duplicateReplacersLoop
duplicateReplacersLoop@
for ((i, entry) in duplicateReplacers.entrySet().withIndex()) {
val (pattern, replacer) = entry
if (!pattern.isValid()) continue
@@ -159,7 +159,7 @@ fun ExtractableCodeDescriptor.findDuplicates(): List<DuplicateInfo> {
if (valueCount == 1) {
matchValues(controlFlow.outputValues.first(), newControlFlow.outputValues.first())
} else {
@outer
outer@
for (currentValue in controlFlow.outputValues)
for (newValue in newControlFlow.outputValues) {
if ((currentValue is ExpressionValue) != (newValue is ExpressionValue)) continue
@@ -608,7 +608,7 @@ public class JetPsiUnifier(
val delegationInfo2 = getDelegationOrderInfo(decl2)
if (delegationInfo1.orderInsensitive.size() != delegationInfo2.orderInsensitive.size()) return UNMATCHED
@outer
outer@
for (specifier1 in delegationInfo1.orderInsensitive) {
for (specifier2 in delegationInfo2.orderInsensitive) {
if (doUnify(specifier1, specifier2) != UNMATCHED) continue@outer
@@ -34,7 +34,7 @@ object DocCommentConverter {
val html = StringBuilder {
appendJavadocElements(docComment.getDescriptionElements())
@tagsLoop
tagsLoop@
for (tag in docComment.getTags()) {
when (tag.getName()) {
"deprecated" -> continue@tagsLoop
@@ -255,7 +255,7 @@ public class JavaToKotlinConverter(private val project: Project,
private fun processUsages(refs: Collection<ReferenceInfo>) {
for (fileRefs in refs.groupBy { it.file }.values()) { // group by file for faster sorting
@ReferenceLoop
ReferenceLoop@
for ((reference, target, file, processings) in fileRefs.sortBy(ReferenceComparator)) {
val processors = when (reference.getElement().getLanguage()) {
JavaLanguage.INSTANCE -> processings.map { it.javaCodeProcessor }.filterNotNull()
@@ -145,7 +145,7 @@ class OverloadReducer(
.map { it.key }
.sortBy { -it.getParameterList().getParametersCount() } // we will try to drop them starting from ones with more parameters
@DropCandidatesLoop
DropCandidatesLoop@
for (method in dropCandidates) {
val paramCount = method.getParameterList().getParametersCount()
val targetInfo = equivalenceMap[method]!!
@@ -44,7 +44,7 @@ public fun getSimpleName(call: JsInvocation): JsName? {
public fun getSimpleIdent(call: JsInvocation): String? {
var qualifier: JsExpression? = call.getQualifier()
@qualifiers while (qualifier != null) {
qualifiers@ while (qualifier != null) {
when (qualifier) {
is JsInvocation -> {
val callableQualifier = qualifier as JsInvocation