@Override public void visitWhileStatement(PsiWhileStatement statement) { super.visitWhileStatement(statement); final PsiExpression condition = statement.getCondition(); final PsiStatement body = statement.getBody(); checkCondition(condition, body); }
private static boolean whileStatementsAreEquivalent( @NotNull PsiWhileStatement statement1, @NotNull PsiWhileStatement statement2) { final PsiExpression condition1 = statement1.getCondition(); final PsiExpression condition2 = statement2.getCondition(); final PsiStatement body1 = statement1.getBody(); final PsiStatement body2 = statement2.getBody(); return expressionsAreEquivalent(condition1, condition2) && statementsAreEquivalent(body1, body2); }