void (GrFlowInterruptingStatement statement, AnnotationHolder holder) { final PsiElement label = statement.getLabelIdentifier(); if (label != null) { final GrLabeledStatement resolved = statement.resolveLabel(); if (resolved == null) { holder.newAnnotation(HighlightSeverity.ERROR, GroovyBundle.message("undefined.label", statement.getLabelName())).range(label).create(); } } final GrStatement targetStatement = statement.findTargetStatement(); if (targetStatement == null) { if (statement instanceof GrContinueStatement && label == null) { holder.newAnnotation(HighlightSeverity.ERROR, GroovyBundle.message("continue.outside.loop")).create(); } else if (statement instanceof GrBreakStatement && label == null) { holder.newAnnotation(HighlightSeverity.ERROR, GroovyBundle.message("break.outside.loop.or.switch")).create(); } } if (statement instanceof GrBreakStatement && label != null && findFirstLoop(statement) == null) { holder.newAnnotation(HighlightSeverity.ERROR, GroovyBundle.message("break.outside.loop")).create(); } }