Skip to content

Commit 2c95f28

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 e8e0f34 commit 2c95f28

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
@@ -80,11 +80,11 @@ public <P extends PT> P getInstance(final Class<P> pluginClass) {
8080
@Override
8181
public void initialize() {
8282
// add singleton instances to the object index... IN THE FUTURE!
83-
objectService.getIndex().addLater(new LazyObjects<Object>() {
83+
objectService.getIndex().addLater(new LazyObjects<PT>() {
8484

8585
@Override
86-
public ArrayList<Object> get() {
87-
return new ArrayList<Object>(getInstances());
86+
public ArrayList<PT> get() {
87+
return new ArrayList<PT>(getInstances());
8888
}
8989
});
9090
}

0 commit comments

Comments
 (0)