|
31 | 31 |
|
32 | 32 | package org.scijava; |
33 | 33 |
|
34 | | -import java.lang.annotation.Annotation; |
35 | | -import java.lang.reflect.AccessibleObject; |
36 | 34 | import java.lang.reflect.Field; |
37 | 35 | import java.lang.reflect.Method; |
38 | 36 | import java.net.URL; |
39 | 37 | import java.net.URLClassLoader; |
40 | 38 | import java.util.Arrays; |
41 | 39 | import java.util.Collection; |
42 | 40 | import java.util.Collections; |
43 | | -import java.util.HashMap; |
44 | 41 | import java.util.List; |
45 | | -import java.util.Map; |
46 | 42 |
|
47 | 43 | import org.scijava.event.ContextDisposingEvent; |
48 | 44 | import org.scijava.event.EventHandler; |
|
54 | 50 | import org.scijava.service.ServiceHelper; |
55 | 51 | import org.scijava.service.ServiceIndex; |
56 | 52 | import org.scijava.util.ClassUtils; |
| 53 | +import org.scijava.util.Query; |
57 | 54 |
|
58 | 55 | /** |
59 | 56 | * Top-level SciJava application context, which initializes and maintains a list |
@@ -364,8 +361,7 @@ public Service getService(final String className) { |
364 | 361 | public void inject(final Object o) { |
365 | 362 | // Ensure parameter fields and event handler methods are cached for this |
366 | 363 | // object. |
367 | | - Map<Class<? extends Annotation>, Class<? extends AccessibleObject>> query = |
368 | | - new HashMap<Class<? extends Annotation>, Class<? extends AccessibleObject>>(); |
| 364 | + Query query = new Query(); |
369 | 365 | query.put(Parameter.class, Field.class); |
370 | 366 | query.put(EventHandler.class, Method.class); |
371 | 367 | ClassUtils.cacheAnnotatedObjects(o.getClass(), query); |
|
0 commit comments