@@ -63,16 +63,16 @@ public class FieldsFromJoinsWithoutIsNullDiagnostic extends AbstractSDBLVisitorD
63
63
// далее идет поиск вверх по родительским узлам для проверки вхождения в разных вариациях ЕСТЬNULL или ЕСТЬ NULL
64
64
// для оптимизации ищем вверх не до начального узла всего дерева, а до узла, в котором искать уже нет смысла
65
65
66
- private static final Integer SELECT_ROOT = SDBLParser .RULE_selectedField ;
67
- private static final Collection <Integer > SELECT_STATEMENTS = Set .of (SELECT_ROOT , SDBLParser .RULE_builtInFunctions ,
66
+ private static final Integer EXCLUDED_TOP_RULE_FOR_SELECT = SDBLParser .RULE_selectedField ;
67
+ private static final Collection <Integer > SELECT_STATEMENTS = Set .of (EXCLUDED_TOP_RULE_FOR_SELECT , SDBLParser .RULE_builtInFunctions ,
68
68
SDBLParser .RULE_isNullPredicate );
69
69
70
- private static final Integer WHERE_ROOT = SDBLParser .RULE_query ;
71
- private static final Collection <Integer > WHERE_STATEMENTS = Set .of (WHERE_ROOT , SDBLParser .RULE_builtInFunctions ,
70
+ private static final Integer EXCLUDED_TOP_RULE_FOR_WHERE = SDBLParser .RULE_query ;
71
+ private static final Collection <Integer > WHERE_STATEMENTS = Set .of (EXCLUDED_TOP_RULE_FOR_WHERE , SDBLParser .RULE_builtInFunctions ,
72
72
SDBLParser .RULE_isNullPredicate );
73
73
74
- private static final Integer JOIN_ROOT = SDBLParser .RULE_joinPart ;
75
- private static final Collection <Integer > JOIN_STATEMENTS = Set .of (JOIN_ROOT , SDBLParser .RULE_builtInFunctions );
74
+ private static final Integer EXCLUDED_TOP_RULE_FOR_JOIN = SDBLParser .RULE_joinPart ;
75
+ private static final Collection <Integer > JOIN_STATEMENTS = Set .of (EXCLUDED_TOP_RULE_FOR_JOIN , SDBLParser .RULE_builtInFunctions );
76
76
77
77
public static final Collection <Integer > RULES_OF_PARENT_FOR_SEARCH_CONDITION = Set .of (SDBLParser .RULE_predicate ,
78
78
SDBLParser .RULE_query );
@@ -167,7 +167,7 @@ private static boolean haveExprNotWithParens(SDBLParser.PredicateContext ctx) {
167
167
}
168
168
169
169
private void checkSelect (String tableName , SDBLParser .SelectedFieldsContext columns ) {
170
- checkStatements (tableName , columns , SELECT_STATEMENTS , SELECT_ROOT , true );
170
+ checkStatements (tableName , columns , SELECT_STATEMENTS , EXCLUDED_TOP_RULE_FOR_SELECT , true );
171
171
}
172
172
173
173
private void checkStatements (String tableName , BSLParserRuleContext expression , Collection <Integer > statements ,
@@ -225,7 +225,7 @@ private void checkWhere(String tableName, @Nullable SDBLParser.LogicalExpression
225
225
Optional .ofNullable (where )
226
226
.stream ().flatMap (searchConditionsContext -> searchConditionsContext .condidions .stream ())
227
227
.forEach (searchConditionContext -> checkStatements (tableName , searchConditionContext ,
228
- WHERE_STATEMENTS , WHERE_ROOT , true ));
228
+ WHERE_STATEMENTS , EXCLUDED_TOP_RULE_FOR_WHERE , true ));
229
229
}
230
230
231
231
private void checkAllJoins (String tableName , SDBLParser .JoinPartContext currentJoinPart ) {
@@ -235,7 +235,7 @@ private void checkAllJoins(String tableName, SDBLParser.JoinPartContext currentJ
235
235
.filter (joinPartContext -> joinPartContext != currentJoinPart )
236
236
.map (SDBLParser .JoinPartContext ::logicalExpression )
237
237
.forEach (searchConditionsContext -> checkStatements (tableName , searchConditionsContext ,
238
- JOIN_STATEMENTS , JOIN_ROOT , false ));
238
+ JOIN_STATEMENTS , EXCLUDED_TOP_RULE_FOR_JOIN , false ));
239
239
}
240
240
241
241
private List <DiagnosticRelatedInformation > getRelatedInformation (SDBLParser .JoinPartContext self ) {
0 commit comments