Skip to content

Commit b3b4326

Browse files
committed
Fix generics of ReadBufferDataHandle
Otherwise, you cannot instantiate it in a type-safe way.
1 parent f55a5a8 commit b3b4326

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/main/java/org/scijava/io/handle/ReadBufferDataHandle.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
* Read-only buffered {@link DataHandle}. It buffers the underlying handle into
4545
* a fixed number of pages, swapping them out when necessary.
4646
*/
47-
public class ReadBufferDataHandle extends AbstractHigherOrderHandle<Location> {
47+
public class ReadBufferDataHandle<L extends Location> extends AbstractHigherOrderHandle<L> {
4848

4949
private static final int DEFAULT_PAGE_SIZE = 10_000;
5050
private static final int DEFAULT_NUM_PAGES = 10;
@@ -67,7 +67,7 @@ public class ReadBufferDataHandle extends AbstractHigherOrderHandle<Location> {
6767
* @param handle
6868
* the handle to wrap
6969
*/
70-
public ReadBufferDataHandle(final DataHandle<Location> handle) {
70+
public ReadBufferDataHandle(final DataHandle<L> handle) {
7171
this(handle, DEFAULT_PAGE_SIZE);
7272
}
7373

@@ -80,7 +80,7 @@ public ReadBufferDataHandle(final DataHandle<Location> handle) {
8080
* @param pageSize
8181
* the size of the used pages
8282
*/
83-
public ReadBufferDataHandle(final DataHandle<Location> handle, final int pageSize) {
83+
public ReadBufferDataHandle(final DataHandle<L> handle, final int pageSize) {
8484
this(handle, pageSize, DEFAULT_NUM_PAGES);
8585
}
8686

@@ -94,7 +94,7 @@ public ReadBufferDataHandle(final DataHandle<Location> handle, final int pageSiz
9494
* @param numPages
9595
* the number of pages to use
9696
*/
97-
public ReadBufferDataHandle(final DataHandle<Location> handle, final int pageSize, final int numPages) {
97+
public ReadBufferDataHandle(final DataHandle<L> handle, final int pageSize, final int numPages) {
9898
super(handle);
9999
this.pageSize = pageSize;
100100

0 commit comments

Comments
 (0)