void (@NotNull PsiJavaToken token) { super.visitJavaToken(token); IElementType type = token.getTokenType(); if (!hasErrorResults() && type == JavaTokenType.TEXT_BLOCK_LITERAL) { add(checkFeature(token, HighlightingFeature.TEXT_BLOCKS)); } if (!hasErrorResults() && type == JavaTokenType.RBRACE && token.getParent() instanceof PsiCodeBlock) { PsiElement gParent = token.getParent().getParent(); PsiCodeBlock codeBlock; PsiType returnType; if (gParent instanceof PsiMethod method) { codeBlock = method.getBody(); returnType = method.getReturnType(); } else if (gParent instanceof PsiLambdaExpression) { PsiElement body = ((PsiLambdaExpression)gParent).getBody(); if (!(body instanceof PsiCodeBlock)) return; codeBlock = (PsiCodeBlock)body; returnType = LambdaUtil.getFunctionalInterfaceReturnType((PsiLambdaExpression)gParent); } else { return; } add(HighlightControlFlowUtil.checkMissingReturnStatement(codeBlock, returnType)); } if (!hasErrorResults()) { add(HighlightUtil.checkExtraSemicolonBetweenImportStatements(token, type, myLanguageLevel)); } }