BufferedReaderLines (PsiLoopStatement loopStatement) { PsiWhileStatement whileLoop = tryCast(loopStatement, PsiWhileStatement.class); if (whileLoop == null) return null; BufferedReaderLines reader = extractReaderFromCondition(whileLoop.getCondition(), loopStatement); if (reader == null) return null; reader.myDeleteVariable = true; return reader; }