/** * Gets the ID of the given scope. * * @param scp scope * @return id if existing, {@code null} otherwise */ private int id(final Scope scp) { if (ids != null) { final Integer id = ids.get(scp); return id == null ? -1 : id; } final int ss = scopes.size(); for (int s = 0; s < ss; s++) if (scopes.get(s) == scp) return s; return -1; }