inmite / android-validation-komensky

A simple library for validating user input in forms using annotations.
Apache License 2.0
508 stars 78 forks source link

Search fields in superclass #18

Open vaprea opened 9 years ago

vaprea commented 9 years ago

FieldFinder class searches only in the current class, not in superclass.

List fieldList = new ArrayList(); fieldList.addAll(Arrays.asList(target.getClass().getDeclaredFields())); fieldList.addAll(Arrays.asList(target.getClass().getSuperclass().getDeclaredFields())); Field [] fields = new Field[fieldList.size()]; fieldList.toArray(fields);

    if (fields == null || fields.length == 0) {
        return Collections.emptyMap();
    }
tomas-vondracek commented 9 years ago

That was intentional decision to make the validation faster, but I think we will need re-evaluate it.