Skip to content

Commit ea69d8c

Browse files
dfa1claude
andcommitted
refactor(core): make Array sealed now that JPMS module is declared
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 7df04e2 commit ea69d8c

2 files changed

Lines changed: 4 additions & 13 deletions

File tree

TODO.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,3 @@
5353
## Encodings
5454

5555
- [ ] the classes are very long of complex, most likely we should group the impl detail in private static inner classes Encoder/Decoder
56-
57-
- [ ] fix this comment in Array
58-
/// Not declared `sealed` because the project does not declare a JPMS module —
59-
/// JLS only allows cross-package `permits` inside the same named module. The
60-
/// effective hierarchy is still closed: only types in this package should implement
61-
/// this interface.
62-
public interface Array {

core/src/main/java/io/github/dfa1/vortex/core/array/Array.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,10 @@
1414
///
1515
/// Buffers are `MemorySegment` slices backed by the memory-mapped file; lifetime
1616
/// is tied to the `VortexFile`'s Arena.
17-
///
18-
/// Not declared `sealed` because the project does not declare a JPMS module —
19-
/// JLS only allows cross-package `permits` inside the same named module. The
20-
/// effective hierarchy is still closed: only types in this package should implement
21-
/// this interface.
22-
public interface Array {
17+
public sealed interface Array
18+
permits BoolArray, ByteArray, DoubleArray, EmptyArray, Float16Array, FloatArray,
19+
GenericArray, IntArray, LongArray, NullArray, ShortArray, StructArray,
20+
VarBinArray {
2321

2422
long length();
2523

0 commit comments

Comments
 (0)