mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
StreamApiMigrationInspection: BufferedReaderLines: support parentheses around readLine in while scenario
This commit is contained in:
+2
-1
@@ -984,7 +984,8 @@ public class StreamApiMigrationInspection extends AbstractBaseJavaLocalInspectio
|
||||
if (operand == null) return null;
|
||||
PsiAssignmentExpression assignment = ExpressionUtils.getAssignment(PsiUtil.skipParenthesizedExprDown(operand));
|
||||
if (assignment == null) return null;
|
||||
PsiMethodCallExpression readerCall = tryCast(assignment.getRExpression(), PsiMethodCallExpression.class);
|
||||
PsiMethodCallExpression readerCall =
|
||||
tryCast(PsiUtil.skipParenthesizedExprDown(assignment.getRExpression()), PsiMethodCallExpression.class);
|
||||
if (!BUFFERED_READER_READ_LINE.test(readerCall)) return null;
|
||||
PsiExpression reader = readerCall.getMethodExpression().getQualifierExpression();
|
||||
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ public class Main {
|
||||
List<String> test(BufferedReader br) throws IOException {
|
||||
List<String> result = new ArrayList<>();
|
||||
String line = /*comment*/"";
|
||||
wh<caret>ile(null != (line = br.readLine())) {
|
||||
wh<caret>ile(null != (line = (br.readLine()))) {
|
||||
result.add(line.trim());
|
||||
}
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user