Lines Matching refs:IF
65 * A criterion to determine if a node matches a path through the AST.
99 if (path == null) {
115 if (path == null) { break; }
120 // If astPath starts with Method.* or Class.*, include the
122 if (path != null && !astPath.isEmpty()) {
124 if (entryKind == Tree.Kind.METHOD
132 if (debug) {
143 if (astPathLen == 0 || actualPathLen == 0) { return false; }
144 // if (actualPathLen != astPathLen + (isOnNewArrayType ? 0 : 1)) {
153 if (!kindsMatch(astNode.getTreeKind(), actualNode.getKind())) {
157 if (debug) {
165 // in "actualPath". If it's not a match, this is not the correct
166 // location. If it is a match, keep going.
168 if (next == null) {
171 if (!(next instanceof JCTree)) {
173 if (actualPathLen == i+1) {
179 if (debug) {
183 // if (++i >= astPathLen || i >= actualPathLen) { break; }
184 if (++i >= astPathLen) { break; }
185 if (i >= actualPathLen) {
188 if (!matchNext(next, actualPath.get(i))) {
189 if (debug) {
196 if (i < actualPathLen && matchNext(next, actualPath.get(i))
202 if (debug) {
211 if (b1 && !b2) {
213 } else if (b2 && !b1) {
275 if (l1.size() == l2.size()) {
279 if (!matchNext(t1, t2)) { return false; }
298 if (astNode.childSelectorIs(ASTPath.ANNOTATION)) {
302 if (arg >= annos.size()) {
312 if (astNode.childSelectorIs(ASTPath.EXPRESSION)) {
324 if (astNode.childSelectorIs(ASTPath.CONDITION)) {
332 if (astNode.childSelectorIs(ASTPath.VARIABLE)) {
342 if (arg >= block.getStatements().size()) {
349 if (astNode.childSelectorIs(ASTPath.EXPRESSION)) {
354 if (arg >= statements.size()) {
362 if (astNode.childSelectorIs(ASTPath.PARAMETER)) {
374 if (astNode.childSelectorIs(ASTPath.TYPE_PARAMETER)) {
376 } else if (astNode.childSelectorIs(ASTPath.INITIALIZER)) {
379 if (member.getKind() == Tree.Kind.BLOCK && arg == i++) {
384 } else if (astNode.childSelectorIs(ASTPath.BOUND)) {
393 if (astNode.childSelectorIs(ASTPath.CONDITION)) {
395 } else if (astNode.childSelectorIs(ASTPath.TRUE_EXPRESSION)) {
403 if (astNode.childSelectorIs(ASTPath.CONDITION)) {
411 if (astNode.childSelectorIs(ASTPath.VARIABLE)) {
413 } else if (astNode.childSelectorIs(ASTPath.EXPRESSION)) {
425 if (astNode.childSelectorIs(ASTPath.INITIALIZER)) {
428 if (arg >= inits.size()) {
432 } else if (astNode.childSelectorIs(ASTPath.CONDITION)) {
434 } else if (astNode.childSelectorIs(ASTPath.UPDATE)) {
437 if (arg >= updates.size()) {
445 case IF: {
447 if (astNode.childSelectorIs(ASTPath.CONDITION)) {
449 } else if (astNode.childSelectorIs(ASTPath.THEN_STATEMENT)) {
457 if (astNode.childSelectorIs(ASTPath.EXPRESSION)) {
469 if (astNode.childSelectorIs(ASTPath.PARAMETER)) {
472 if (arg >= params.size()) {
482 if (astNode.childSelectorIs(ASTPath.QUALIFIER_EXPRESSION)) {
487 if (arg >= typeArgs.size()) {
499 if (astNode.childSelectorIs(ASTPath.TYPE)) {
501 } else if (astNode.childSelectorIs(ASTPath.PARAMETER)) {
507 } else if (astNode.childSelectorIs(ASTPath.TYPE_PARAMETER)) {
516 if (astNode.childSelectorIs(ASTPath.TYPE_ARGUMENT)) {
519 if (arg >= typeArgs.size()) {
523 } else if (astNode.childSelectorIs(ASTPath.METHOD_SELECT)) {
528 if (arg >= args.size()) {
536 if (astNode.childSelectorIs(ASTPath.TYPE)) {
540 if (arg == 0 && astPath.size() == ix+1) {
542 // if (astPath.size() != ix+1) { return null; }
549 if (typeTree.getKind() != Tree.Kind.ARRAY_TYPE) {
555 } else if (astNode.childSelectorIs(ASTPath.DIMENSION)) {
568 if (astNode.childSelectorIs(ASTPath.ENCLOSING_EXPRESSION)) {
570 } else if (astNode.childSelectorIs(ASTPath.TYPE_ARGUMENT)) {
573 if (arg >= typeArgs.size()) {
577 } else if (astNode.childSelectorIs(ASTPath.IDENTIFIER)) {
579 } else if (astNode.childSelectorIs(ASTPath.ARGUMENT)) {
582 if (arg >= args.size()) {
592 if (astNode.childSelectorIs(ASTPath.TYPE)) {
597 if (arg >= typeArgs.size()) {
613 if (astNode.childSelectorIs(ASTPath.EXPRESSION)) {
618 if (arg >= cases.size()) {
626 if (astNode.childSelectorIs(ASTPath.EXPRESSION)) {
638 if (astNode.childSelectorIs(ASTPath.BLOCK)) {
640 } else if (astNode.childSelectorIs(ASTPath.CATCH)) {
643 if (arg >= catches.size()) {
647 } else if (astNode.childSelectorIs(ASTPath.FINALLY_BLOCK)) {
652 if (arg >= resources.size()) {
660 if (astNode.childSelectorIs(ASTPath.TYPE)) {
676 if (arg >= typeAlts.size()) {
686 if (astNode.childSelectorIs(ASTPath.INITIALIZER)) {
688 } else if (astNode.childSelectorIs(ASTPath.TYPE)) {
696 if (astNode.childSelectorIs(ASTPath.CONDITION)) {
703 if (ASTPath.isBinaryOperator(actualNode.getKind())) {
705 if (astNode.childSelectorIs(ASTPath.LEFT_OPERAND)) {
710 } else if (ASTPath.isCompoundAssignment(actualNode.getKind())) {
713 if (astNode.childSelectorIs(ASTPath.VARIABLE)) {
718 } else if (ASTPath.isUnaryOperator(actualNode.getKind())) {
721 } else if (isWildcard(actualNode.getKind())) {
751 if (node.getKind() != Tree.Kind.METHOD) { return false; }
754 if ("<init>".equals(method.getName().toString())) {
755 if (ix == last) { return true; }
765 } else if (entry.childSelectorIs(ASTPath.PARAMETER)
767 if (ix == last) { return true; }
769 if (rcvrParam == null) { // TODO
779 if (node.getKind() != Tree.Kind.NEW_ARRAY) { return false; }
782 if (entry.childSelectorIs(ASTPath.TYPE)) {
783 if (ix == last) { return true; }
809 if (tree.getKind() == Tree.Kind.NEW_ARRAY) {
812 if (type != null) {
827 if (kind == Tree.Kind.NEW_ARRAY
833 } else if (tree.getKind() == Tree.Kind.ANNOTATED_TYPE) {
835 } else if (tree.getKind() == Tree.Kind.ARRAY_TYPE) {
843 if (t == null) { return false; }
850 if (t.getKind() != TypeKind.ARRAY) { return false; }
857 if (entry.childSelectorIs(ASTPath.TYPE_PARAMETER)) {
858 if (!t.isParameterized()) { return false; }
861 if (a >= args.size()) { return false; }
866 if (t.getKind() != TypeKind.WILDCARD) { return false; }
870 if (t.getKind() != TypeKind.WILDCARD) { return false; }
874 if (t.getKind() != TypeKind.WILDCARD) { return false; }
878 if (t.getKind() != TypeKind.WILDCARD) { return false; }
884 if (t == null) { return false; }
891 if (t.getKind() != Tree.Kind.METHOD) { return null; }
893 if ((method.mods.flags & Flags.STATIC) != 0) { return null; }
910 if (kind == Tree.Kind.CLASS
919 if (!skip || isStatic) { return clazz; }
948 if (entry.childSelectorIs(ASTPath.TYPE_ARGUMENT)) {
957 if (isWildcard(kind)) {
969 * Determines if the given kinds match, false otherwise. Two kinds match if
970 * they're exactly the same or if the two kinds are both compound
979 * kind. So if an AST path entry has a PLUS kind, that really means it could
987 * @return {@code true} if the kinds match as described above, {@code false}
1006 * Determines if the given kind is a binary operator.
1010 * @return true if the given kind is a binary operator
1097 * Determines if the given kind is a wildcard.
1101 * @return true if the given kind is a wildcard
1114 if (i <= 0) { return false; }
1116 if (actualNode.getKind() == Tree.Kind.UNBOUNDED_WILDCARD) {
1120 if (ancestor.getKind() == Tree.Kind.INSTANCE_OF) {
1124 } else if (i > 1 && ancestor.getKind() ==
1127 if (ancestor.getKind() == Tree.Kind.ARRAY_TYPE) {