* when we have an abstract method)
*/
protected void endScope(SimpleNode node) {
onBeforeEndScope(node);
ScopeItems m = scope.endScope(); //clear the last scope
for (Iterator<Found> it = probablyNotDefined.iterator(); it.hasNext();) {
Found n = it.next();
final GenAndTok probablyNotDefinedFirst = n.getSingle();
IToken tok = probablyNotDefinedFirst.tok;
String rep = tok.getRepresentation();
//we also get a last pass to the unused to see if they might have been defined later on the higher scope
List<Found> foundItems = find(m, rep);
boolean setUsed = false;
for (Found found : foundItems) {
//the scope where it is defined must be an outer scope so that we can say it was defined later...
final GenAndTok foundItemFirst = found.getSingle();
//if something was not defined in a method, if we are in the class definition, it won't be found.
if ((probablyNotDefinedFirst.scopeFound.getScopeType() & Scope.ACCEPTED_METHOD_AND_LAMBDA) != 0
&& m.getScopeType() != Scope.SCOPE_TYPE_CLASS) {
if (foundItemFirst.scopeId < probablyNotDefinedFirst.scopeId) {
found.setUsed(true);
setUsed = true;
}
}