Add ExtensionList#lookupFirst convenience method (#3021)

* Add ExtensionList#lookupFirst convenience method

* Fix Javadoc

* Convert to lookupSingleton, which throws unless there's only 1

* Address review comments
This commit is contained in:
Daniel Beck authored and Oleg Nenashev committed 2017-10-28 12:58:48 +02:00
1 parent 65d14179bf
commit 671a0ad4d0
7 files changed
+29 -33

No files matched your search

+2 -2
View File
@@ -1995,8 +1995,8 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas
* Convenience method to ease access to this monitor, this allows other plugins to register required updates.
* @return this monitor.
*/
public static final PluginUpdateMonitor getInstance() {
return ExtensionList.lookup(PluginUpdateMonitor.class).get(0);
public static PluginUpdateMonitor getInstance() {
return ExtensionList.lookupSingleton(PluginUpdateMonitor.class);
}
/**