File tree Expand file tree Collapse file tree 1 file changed +16
-4
lines changed
src/main/java/org/scijava Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -122,10 +122,8 @@ public Context(final boolean empty) {
122
122
* @throws ClassCastException If any of the given arguments do not implement
123
123
* the {@link Service} interface.
124
124
*/
125
- @ SuppressWarnings ({ "rawtypes" , "unchecked" })
126
- public Context (final Class ... serviceClasses ) {
127
- this (serviceClasses != null ? (Collection ) Arrays .asList (serviceClasses )
128
- : Arrays .asList (Service .class ));
125
+ public Context (@ SuppressWarnings ("rawtypes" ) final Class ... serviceClasses ) {
126
+ this (serviceClassList (serviceClasses ));
129
127
}
130
128
131
129
/**
@@ -379,6 +377,20 @@ public void dispose() {
379
377
}
380
378
}
381
379
380
+ // -- Utility methods --
381
+
382
+ /**
383
+ * Utility method for converting a varargs list of service classes to a
384
+ * {@link List} of those classes.
385
+ */
386
+ @ SuppressWarnings ({ "rawtypes" , "unchecked" })
387
+ public static List <Class <? extends Service >> serviceClassList (
388
+ final Class ... serviceClasses )
389
+ {
390
+ return serviceClasses != null ? (List ) Arrays .asList (serviceClasses )
391
+ : Arrays .asList (Service .class );
392
+ }
393
+
382
394
// -- Helper methods --
383
395
384
396
private String createMissingServiceMessage (
You can’t perform that action at this time.
0 commit comments