Skip to content
Permalink
Browse files
TCK: pick up constraints on 'inherited' fields
  • Loading branch information
mbenson committed Oct 16, 2018
1 parent 1b4db6d commit d34b59b1a5b38447bca7941d5bfe1555cc2b0ae2
Showing 1 changed file with 16 additions and 1 deletion.
@@ -95,7 +95,19 @@ public MetadataBuilder.ForClass<T> getClass(Meta<Class<T>> meta) {

@Override
public Map<String, MetadataBuilder.ForContainer<Field>> getFields(Meta<Class<T>> meta) {
return delegate.getFields(hierarchyElement);
final Map<String, MetadataBuilder.ForContainer<Field>> fields = delegate.getFields(hierarchyElement);

if (fields.isEmpty()) {
return fields;
}
final Map<String, MetadataBuilder.ForContainer<Field>> result = new LinkedHashMap<>();

fields.forEach((k, v) -> {
final Field fld = Reflection.getDeclaredField(hierarchyElement.getHost(), k);
Exceptions.raiseIf(fld == null, IllegalStateException::new, "delegate builder specified unknown field");
result.put(k, new ContainerDelegate<Field>(v, new Meta.ForField(fld)));
});
return result;
}

@Override
@@ -113,6 +125,9 @@ public Map<Signature, MetadataBuilder.ForExecutable<Constructor<? extends T>>> g
@Override
public Map<String, MetadataBuilder.ForContainer<Method>> getGetters(Meta<Class<T>> meta) {
final Map<String, MetadataBuilder.ForContainer<Method>> getters = delegate.getGetters(hierarchyElement);
if (getters.isEmpty()) {
return getters;
}
final Map<String, MetadataBuilder.ForContainer<Method>> result = new LinkedHashMap<>();

getters.forEach((k, v) -> {

0 comments on commit d34b59b

Please sign in to comment.