/** * Check whether the frame contains a given name. * @param nameToFind IDENT ast of the name we're looking for. * @param lookForMethod whether we are looking for a method name. * @return whether it was found. */ protected AbstractFrame getIfContains(DetailAST nameToFind, boolean lookForMethod) { final AbstractFrame frame; if (!lookForMethod && containsFieldOrVariable(nameToFind)) { frame = this; } else { frame = parent.getIfContains(nameToFind, lookForMethod); } return frame; }
@Override protected AbstractFrame getIfContains(DetailAST nameToFind, boolean lookForMethod) { AbstractFrame frame = null; if (lookForMethod && containsMethod(nameToFind) || containsFieldOrVariable(nameToFind)) { frame = this; } else if (getParent() != null) { frame = getParent().getIfContains(nameToFind, lookForMethod); } return frame; }
/** * Find frame containing declaration. * @param frame The parent frame to searching in. * @param name IDENT ast of the declaration to find. * @param lookForMethod whether we are looking for a method name. * @return AbstractFrame containing declaration or null. */ private static AbstractFrame findFrame(AbstractFrame frame, DetailAST name, boolean lookForMethod) { return frame.getIfContains(name, lookForMethod); }
/** * Check whether the frame contains a given name. * @param nameToFind IDENT ast of the name we're looking for. * @param lookForMethod whether we are looking for a method name. * @return whether it was found. */ protected AbstractFrame getIfContains(DetailAST nameToFind, boolean lookForMethod) { final AbstractFrame frame; if (!lookForMethod && containsFieldOrVariable(nameToFind)) { frame = this; } else { frame = parent.getIfContains(nameToFind, lookForMethod); } return frame; }
@Override protected AbstractFrame getIfContains(DetailAST nameToFind, boolean lookForMethod) { AbstractFrame frame = null; if (lookForMethod && containsMethod(nameToFind) || containsFieldOrVariable(nameToFind)) { frame = this; } else if (getParent() != null) { frame = getParent().getIfContains(nameToFind, lookForMethod); } return frame; }
/** * Find frame containing declaration. * @param frame The parent frame to searching in. * @param name IDENT ast of the declaration to find. * @param lookForMethod whether we are looking for a method name. * @return AbstractFrame containing declaration or null. */ private static AbstractFrame findFrame(AbstractFrame frame, DetailAST name, boolean lookForMethod) { return frame.getIfContains(name, lookForMethod); }