Error (int i) { if (myErrors != null && myAffected.get(i)) { for (ErrorWithIndex error : myErrors) { if (error.index == i) return error.error; } } if (myBase != null && myDeriveIndex > i) { return myBase.getError(i); } return null; }