Skip to content

Commit a5a11f1

Browse files
committedJan 26, 2022
Merge
2 parents b8365aa + ef08e2c commit a5a11f1

12 files changed

+49
-91
lines changed
 

‎src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/Addressable.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@
4040
public sealed interface Addressable permits MemorySegment, MemoryAddress, NativeSymbol, VaList {
4141

4242
/**
43-
* Returns the memory address associated with this addressable.
44-
* @return The memory address associated with this addressable.
43+
* {@return the {@linkplain MemoryAddress memory address} associated with this addressable}
4544
*/
4645
MemoryAddress address();
4746
}

‎src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/FunctionDescriptor.java

+4-8
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,14 @@ private FunctionDescriptor(MemoryLayout resLayout, List<MemoryLayout> argLayouts
5454
}
5555

5656
/**
57-
* Returns the return layout associated with this function.
58-
* @return the return layout.
57+
* {@return the return layout (if any) associated with this function descriptor}
5958
*/
6059
public Optional<MemoryLayout> returnLayout() {
6160
return Optional.ofNullable(resLayout);
6261
}
6362

6463
/**
65-
* Returns the argument layouts associated with this function.
66-
* @return the argument layouts.
64+
* {@return the argument layouts associated with this function descriptor}.
6765
*/
6866
public List<MemoryLayout> argumentLayouts() {
6967
return argLayouts;
@@ -166,8 +164,7 @@ public FunctionDescriptor dropReturnLayout() {
166164
}
167165

168166
/**
169-
* Returns a string representation of this function descriptor.
170-
* @return a string representation of this function descriptor.
167+
* {@return the string representation of this function descriptor}
171168
*/
172169
@Override
173170
public String toString() {
@@ -201,8 +198,7 @@ public boolean equals(Object other) {
201198
}
202199

203200
/**
204-
* Returns the hash code value for this function descriptor.
205-
* @return the hash code value for this function descriptor.
201+
* {@return the hash code value for this function descriptor}
206202
*/
207203
@Override
208204
public int hashCode() {

‎src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/GroupLayout.java

+2-6
Original file line numberDiff line numberDiff line change
@@ -133,18 +133,14 @@ public String toString() {
133133
}
134134

135135
/**
136-
* Is this group layout a <em>struct</em>?
137-
*
138-
* @return true, if this group layout is a <em>struct</em>.
136+
* {@return {@code true}, if this group layout is a <em>struct</em>}
139137
*/
140138
public boolean isStruct() {
141139
return kind == Kind.STRUCT;
142140
}
143141

144142
/**
145-
* Is this group layout a <em>union</em>?
146-
*
147-
* @return true, if this group layout is a <em>union</em>.
143+
* {@return {@code true}, if this group layout is a <em>union</em>}
148144
*/
149145
public boolean isUnion() {
150146
return kind == Kind.UNION;

‎src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MemoryAddress.java

+2-4
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,7 @@
7878
public sealed interface MemoryAddress extends Addressable permits MemoryAddressImpl {
7979

8080
/**
81-
* Returns the raw long value associated with this memory address.
82-
* @return The raw long value associated with this memory address.
81+
* {@return the raw long value associated with this memory address}
8382
*/
8483
long toRawLongValue();
8584

@@ -141,8 +140,7 @@ public sealed interface MemoryAddress extends Addressable permits MemoryAddressI
141140
boolean equals(Object that);
142141

143142
/**
144-
* Returns the hash code value for this address.
145-
* @return the hash code value for this address.
143+
* {@return the hash code value for this address}
146144
*/
147145
@Override
148146
int hashCode();

‎src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MemoryLayout.java

+9-23
Original file line numberDiff line numberDiff line change
@@ -195,18 +195,15 @@
195195
public sealed interface MemoryLayout extends Constable permits AbstractLayout, SequenceLayout, GroupLayout, PaddingLayout, ValueLayout {
196196

197197
/**
198-
* Returns an {@link Optional} containing the nominal descriptor for this
198+
* {@return an {@link Optional} containing the nominal descriptor for this
199199
* layout, if one can be constructed, or an empty {@link Optional}
200-
* if one cannot be constructed.
201-
*
202-
* @return An {@link Optional} containing the resulting nominal descriptor,
203-
* or an empty {@link Optional} if one cannot be constructed.
200+
* if one cannot be constructed}
204201
*/
205202
@Override
206203
Optional<? extends DynamicConstantDesc<? extends MemoryLayout>> describeConstable();
207204

208205
/**
209-
* Does this layout have a specified size? A layout does not have a specified size if it is (or contains) a sequence layout whose
206+
* Returns {@code true} if this layout has a specified size. A layout does not have a specified size if it is (or contains) a sequence layout whose
210207
* size is unspecified (see {@link SequenceLayout#elementCount()}).
211208
*
212209
* Value layouts (see {@link ValueLayout}) and padding layouts (see {@link MemoryLayout#paddingLayout(long)})
@@ -217,26 +214,20 @@ public sealed interface MemoryLayout extends Constable permits AbstractLayout, S
217214
boolean hasSize();
218215

219216
/**
220-
* Computes the layout size, in bits.
221-
*
222-
* @return the layout size, in bits.
217+
* {@return the layout size, in bits}
223218
* @throws UnsupportedOperationException if the layout is, or contains, a sequence layout with unspecified size (see {@link SequenceLayout}).
224219
*/
225220
long bitSize();
226221

227222
/**
228-
* Computes the layout size, in bytes.
229-
*
230-
* @return the layout size, in bytes.
223+
* {@return the layout size, in bytes}
231224
* @throws UnsupportedOperationException if the layout is, or contains, a sequence layout with unspecified size (see {@link SequenceLayout}),
232225
* or if {@code bitSize()} is not a multiple of 8.
233226
*/
234227
long byteSize();
235228

236229
/**
237-
* Return the <em>name</em> (if any) associated with this layout.
238-
*
239-
* @return the layout <em>name</em> (if any).
230+
* {@return the <em>name</em> (if any) associated with this layout}
240231
* @see MemoryLayout#withName(String)
241232
*/
242233
Optional<String> name();
@@ -534,8 +525,7 @@ private static <Z> Z computePathOp(LayoutPath path, Function<LayoutPath, Z> fina
534525
}
535526

536527
/**
537-
* Is this a {@linkplain #paddingLayout(long) padding layout} ?
538-
* @return true, if this layout is a padding layout.
528+
* {@return true, if this layout is a padding layout}
539529
*/
540530
boolean isPadding();
541531

@@ -651,16 +641,12 @@ static PathElement sequenceElement() {
651641
boolean equals(Object that);
652642

653643
/**
654-
* Returns the hash code value for this layout.
655-
*
656-
* @return the hash code value for this layout.
644+
* {@return the hash code value for this layout}
657645
*/
658646
int hashCode();
659647

660648
/**
661-
* Returns a string representation of this layout.
662-
*
663-
* @return a string representation of this layout.
649+
* {@return the string representation of this layout}
664650
*/
665651
@Override
666652
String toString();

‎src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MemorySegment.java

+7-11
Original file line numberDiff line numberDiff line change
@@ -250,11 +250,10 @@ boolean isAligned(MemorySegment segment, long offset, MemoryLayout layout) {
250250
public sealed interface MemorySegment extends Addressable permits AbstractMemorySegmentImpl {
251251

252252
/**
253-
* The base memory address associated with this native memory segment.
253+
* {@return the base memory address associated with this native memory segment}
254254
* @throws UnsupportedOperationException if this segment is not a {@linkplain #isNative() native} segment.
255255
* @throws IllegalStateException if the scope associated with this segment has been closed, or if access occurs from
256256
* a thread other than the thread owning that scope.
257-
* @return The base memory address.
258257
*/
259258
@Override
260259
MemoryAddress address();
@@ -299,14 +298,12 @@ public sealed interface MemorySegment extends Addressable permits AbstractMemory
299298
Stream<MemorySegment> elements(MemoryLayout elementLayout);
300299

301300
/**
302-
* Returns the resource scope associated with this memory segment.
303-
* @return the resource scope associated with this memory segment.
301+
* {@return the resource scope associated with this memory segment}
304302
*/
305303
ResourceScope scope();
306304

307305
/**
308-
* The size (in bytes) of this memory segment.
309-
* @return The size (in bytes) of this memory segment.
306+
* {@return the size (in bytes) of this memory segment}
310307
*/
311308
long byteSize();
312309

@@ -343,8 +340,7 @@ default MemorySegment asSlice(long offset) {
343340
}
344341

345342
/**
346-
* Is this segment read-only?
347-
* @return {@code true}, if this segment is read-only.
343+
* {@return {@code true}, if this segment is read-only}
348344
* @see #asReadOnly()
349345
*/
350346
boolean isReadOnly();
@@ -358,7 +354,7 @@ default MemorySegment asSlice(long offset) {
358354
MemorySegment asReadOnly();
359355

360356
/**
361-
* Is this a native segment? Returns true if this segment is a native memory segment,
357+
* Returns {@code true} if this segment is a native segment. A native memory segment is
362358
* created using the {@link #allocateNative(long, ResourceScope)} (and related) factory, or a buffer segment
363359
* derived from a direct {@link java.nio.ByteBuffer} using the {@link #ofByteBuffer(ByteBuffer)} factory,
364360
* or if this is a {@linkplain #isMapped() mapped} segment.
@@ -367,7 +363,7 @@ default MemorySegment asSlice(long offset) {
367363
boolean isNative();
368364

369365
/**
370-
* Is this a mapped segment? Returns true if this segment is a mapped memory segment,
366+
* Returns {@code true} if this segment is a mapped segment. A mapped memory segment is
371367
* created using the {@link #mapFile(Path, long, long, FileChannel.MapMode, ResourceScope)} factory, or a buffer segment
372368
* derived from a {@link java.nio.MappedByteBuffer} using the {@link #ofByteBuffer(ByteBuffer)} factory.
373369
* @return {@code true} if this segment is a mapped segment.
@@ -484,7 +480,7 @@ default MemorySegment copyFrom(MemorySegment src) {
484480
long mismatch(MemorySegment other);
485481

486482
/**
487-
* Tells whether the contents of this mapped segment is resident in physical
483+
* Determines whether the contents of this mapped segment is resident in physical
488484
* memory.
489485
*
490486
* <p> A return value of {@code true} implies that it is highly likely

‎src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/NativeSymbol.java

+3-6
Original file line numberDiff line numberDiff line change
@@ -43,22 +43,19 @@
4343
sealed public interface NativeSymbol extends Addressable permits NativeSymbolImpl {
4444

4545
/**
46-
* Returns the name of this symbol.
47-
* @return the name of this symbol.
46+
* {@return the name of this symbol}
4847
*/
4948
String name();
5049

5150
/**
52-
* Returns the resource scope associated with this symbol.
53-
* @return the resource scope associated with this symbol.
51+
* {@return the resource scope associated with this symbol}
5452
*/
5553
ResourceScope scope();
5654

5755
/**
58-
* Returns the memory address associated with this symbol.
56+
* {@return the memory address associated with this symbol}
5957
* @throws IllegalStateException if the scope associated with this symbol has been closed, or if access occurs from
6058
* a thread other than the thread owning that scope.
61-
* @return The memory address associated with this symbol.
6259
*/
6360
@Override
6461
MemoryAddress address();

‎src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/ResourceScope.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,7 @@
147147
*/
148148
public sealed interface ResourceScope extends AutoCloseable permits ResourceScopeImpl {
149149
/**
150-
* Is this resource scope alive?
151-
* @return true, if this resource scope is alive.
150+
* {@return {@code true}, if this resource scope is alive}
152151
* @see ResourceScope#close()
153152
*/
154153
boolean isAlive();

‎src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/SequenceLayout.java

+2-6
Original file line numberDiff line numberDiff line change
@@ -82,18 +82,14 @@ public final class SequenceLayout extends AbstractLayout implements MemoryLayout
8282
}
8383

8484
/**
85-
* Returns the element layout associated with this sequence layout.
86-
*
87-
* @return The element layout associated with this sequence layout.
85+
* {@return the element layout associated with this sequence layout}
8886
*/
8987
public MemoryLayout elementLayout() {
9088
return elementLayout;
9189
}
9290

9391
/**
94-
* Returns the element count of this sequence layout (if any).
95-
*
96-
* @return the element count of this sequence layout (if any).
92+
* {@return the element count of this sequence layout (if any)}
9793
*/
9894
public OptionalLong elementCount() {
9995
return elemCount;

‎src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/VaList.java

+2-4
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,7 @@ sealed public interface VaList extends Addressable permits WinVaList, SysVVaList
132132
void skip(MemoryLayout... layouts);
133133

134134
/**
135-
* Returns the resource scope associated with this variable argument list.
136-
* @return the resource scope associated with this variable argument list.
135+
* {@return the resource scope associated with this variable argument list}
137136
*/
138137
ResourceScope scope();
139138

@@ -153,10 +152,9 @@ sealed public interface VaList extends Addressable permits WinVaList, SysVVaList
153152
VaList copy();
154153

155154
/**
156-
* Returns the memory address associated with this variable argument list.
155+
* {@return the {@linkplain MemoryAddress memory address} associated with this variable argument list}
157156
* @throws IllegalStateException if the scope associated with this variable argument list has been closed, or if access occurs from
158157
* a thread other than the thread owning that scope.
159-
* @return The memory address associated with this variable argument list.
160158
*/
161159
@Override
162160
MemoryAddress address();

0 commit comments

Comments
 (0)
Please sign in to comment.