Skip to content

Commit 4817c1a

Browse files
dfa1claude
andcommitted
deprecate(reader): mark VortexHandle.slice as internal escape hatch
The slice(long, long) method is on the public VortexHandle interface only because ScanIterator and VortexInspector live in sibling packages and need cross-package access to the raw backing MemorySegment of a file. It is not part of the stability contract and would not survive a clean module layout. Until that consolidation happens (TODO), mark the method with @APinote spelling out the situation and @deprecated(since="0.4.0", forRemoval=true) so the IDE surfaces it as off-contract for any application code that finds it via autocomplete. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent e493d98 commit 4817c1a

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

reader/src/main/java/io/github/dfa1/vortex/io/VortexHandle.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,19 @@ public interface VortexHandle extends Closeable {
2929

3030
/// Returns a read-only view of bytes `[offset, offset+length)` within the file.
3131
/// Writes through the returned segment throw `UnsupportedOperationException`.
32+
///
33+
/// @param offset the start offset in bytes
34+
/// @param length the number of bytes to expose
35+
/// @return a read-only [MemorySegment] view of the requested range
36+
/// @apiNote <strong>Internal escape hatch.</strong> This method is on the public
37+
/// {@link VortexHandle} interface only because {@link io.github.dfa1.vortex.scan.ScanIterator}
38+
/// and {@link VortexInspector} live in sibling packages and need cross-package access to the
39+
/// raw backing segment. It is not part of the supported stability contract; signatures and
40+
/// semantics may change without a deprecation cycle. Application code should rely on
41+
/// {@link #scan(ScanOptions)} and the typed array accessors instead.
42+
/// @deprecated marked for removal once the reader-internal packages consolidate (see
43+
/// {@code TODO.md}); kept here as an interim escape hatch for vortex-internal callers.
44+
@Deprecated(since = "0.4.0", forRemoval = true)
3245
MemorySegment slice(long offset, long length);
3346

3447
ScanIterator scan(ScanOptions options);

0 commit comments

Comments
 (0)