Do not check for annotation during DynamicItem registration

Since e3d23d64eb ("Don't bind
non-annotated types into DynamicSet, DynamicMap", 2012-05-17), gerrit
has filtered out unannotated types that could belong to a DynamicSet
or DynamicMap to make it possible to write e.g. a
UniversalGroupBackend that makes use of the GroupBackends in its
DynamicSet.

DynamicItem inherited the same filter, but it isn't needed there.
Moreover, DynamicItem registration does not add a UniqueAnnotation
(since we do not want to allow multiple registrations).  Drop the
check in the DynamicItem case so implementations from plugins can
actually be loaded.

Tested using the websession-flatfile plugin.

Change-Id: Iff814bd18cad3bd5c840294591b6bffa2cd91206
This commit is contained in:
Jonathan Nieder
2014-03-26 15:47:54 -07:00
parent f5ad5f610b
commit 2dfac17753

View File

@@ -95,9 +95,7 @@ public class PrivateInternals_DynamicTypes {
DynamicItem<Object> item = (DynamicItem<Object>) e.getValue();
for (Binding<Object> b : bindings(src, type)) {
if (b.getKey().getAnnotation() != null) {
handles.add(item.set(b.getKey(), b.getProvider(), pluginName));
}
handles.add(item.set(b.getKey(), b.getProvider(), pluginName));
}
}
} catch (RuntimeException e) {