GeezerVison is showing github.com — Eliminate raw type KeyRange warnings (#7) · lmdbjava/lmdbjava@80f5308
File tree
Expand file treeCollapse file tree
Open diff view settings
src/main/java/org/lmdbjava
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: src/main/java/org/lmdbjava/KeyRange.java +6-4Lines changed: 6 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
34 | 34 | */ |
35 | 35 | public final class KeyRange<T> { |
36 | 36 |
|
37 | | - private static final KeyRange BACK = new KeyRange<>(BACKWARD_ALL, null, null); |
38 | | - private static final KeyRange FORW = new KeyRange<>(FORWARD_ALL, null, null); |
| 37 | + private static final KeyRange<?> BK = new KeyRange<>(BACKWARD_ALL, null, null); |
| 38 | + private static final KeyRange<?> FW = new KeyRange<>(FORWARD_ALL, null, null); |
39 | 39 | private final T start; |
40 | 40 | private final T stop; |
41 | 41 | private final KeyRangeType type; |
@@ -70,8 +70,9 @@ public KeyRange(final KeyRangeType type, final T start, final T stop) { |
70 | 70 | * @param <T> buffer type |
71 | 71 | * @return a key range (never null) |
72 | 72 | */ |
| 73 | + @SuppressWarnings({"checkstyle:SuppressWarnings", "unchecked"}) |
73 | 74 | public static <T> KeyRange<T> all() { |
74 | | - return FORW; |
| 75 | + return (KeyRange<T>) FW; |
75 | 76 | } |
76 | 77 |
|
77 | 78 | /** |
@@ -80,8 +81,9 @@ public static <T> KeyRange<T> all() { |
80 | 81 | * @param <T> buffer type |
81 | 82 | * @return a key range (never null) |
82 | 83 | */ |
| 84 | + @SuppressWarnings({"checkstyle:SuppressWarnings", "unchecked"}) |
83 | 85 | public static <T> KeyRange<T> allBackward() { |
84 | | - return BACK; |
| 86 | + return (KeyRange<T>) BK; |
85 | 87 | } |
86 | 88 |
|
87 | 89 | /** |
|