Skip to content

Commit 5ef3f68

Browse files
committed
AbstractSingletonService: use more specific type
The LazyObjects instance will definitely return a collection of objects of type PT, not just Object. This distinction is important now that the ObjectIndex is more selective about which pending objects it resolves.
1 parent f4dce23 commit 5ef3f68

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/org/scijava/plugin/AbstractSingletonService.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,11 @@ public <P extends PT> P getInstance(final Class<P> pluginClass) {
8585
@Override
8686
public void initialize() {
8787
// add singleton instances to the object index... IN THE FUTURE!
88-
objectService.getIndex().addLater(new LazyObjects<Object>() {
88+
objectService.getIndex().addLater(new LazyObjects<PT>() {
8989

9090
@Override
91-
public ArrayList<Object> get() {
92-
return new ArrayList<Object>(getInstances());
91+
public ArrayList<PT> get() {
92+
return new ArrayList<PT>(getInstances());
9393
}
9494
});
9595
}

0 commit comments

Comments
 (0)