-
Notifications
You must be signed in to change notification settings - Fork 228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
switch plugins to use AutoService #603
Conversation
new LinkedHashSet<>( | ||
Lists.newArrayList(ServiceLoader.load(Plugin.class, _currentClassLoader))); | ||
for (Plugin plugin : plugins) { | ||
plugin.initialize(this); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd probably wrap this in a try/catch and report an error loading any of these but continue loading others?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm I don't know. I don't think it really makes sense to keep running when a plugin has failed. How about catch, wrap, and throw?
EDIT: Or alternatively, record, load remaining, and throw CompositeBatfishException
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed via catching of ServiceConfigurationError
, throwing CompositeBatfishException
after all are done loading.
4f4ab76
to
1931d89
Compare
Rebased and resolved conflict with OutliersQuestionPlugin.java (added AutoService annotation, imports on top of master version) |
Reviewed 70 of 71 files at r1, 3 of 3 files at r2. projects/batfish/batfish, line 5 at r2 (raw file):
What's the process you use to decide to include projects/batfish-common-protocol/src/main/java/org/batfish/common/plugin/Plugin.java, line 8 at r2 (raw file):
Should this really be Comments from Reviewable |
Review status: all files reviewed at latest revision, 2 unresolved discussions. projects/batfish/batfish, line 5 at r2 (raw file): Previously, dhalperi (Dan Halperin) wrote…
Really it is only necessary when there is a separator character (e.g. "-") in the name. But I like to use it all the time. Sometimes I am weak and forget. projects/batfish-common-protocol/src/main/java/org/batfish/common/plugin/Plugin.java, line 8 at r2 (raw file): Previously, dhalperi (Dan Halperin) wrote…
The hope is no. Can you provide a plausible counterexample? Comments from Reviewable |
Review status: all files reviewed at latest revision, 1 unresolved discussion. projects/batfish-common-protocol/src/main/java/org/batfish/common/plugin/Plugin.java, line 8 at r2 (raw file): Previously, arifogel (Ari Fogel) wrote…
Perhaps a better question would be why these need to be comparable at all; what's this actually used for? If it's for putting them in some sorted order, probably makes more sense to have a delegate comparator of the names than to actually make Comments from Reviewable |
Review status: all files reviewed at latest revision, 1 unresolved discussion. projects/batfish-common-protocol/src/main/java/org/batfish/common/plugin/Plugin.java, line 8 at r2 (raw file): Previously, dhalperi (Dan Halperin) wrote…
Yes it is just for sorting. From my perspective, if it is ok for Comments from Reviewable |
This change is