Skip to content

Commit d06308c

Browse files
viktorklang-oraMartin Buchholz
authored and
Martin Buchholz
committed
8302360: Atomic*.compareAndExchange Javadoc unclear
Reviewed-by: martin, dholmes
1 parent 8b740b4 commit d06308c

File tree

8 files changed

+33
-33
lines changed

8 files changed

+33
-33
lines changed

src/java.base/share/classes/java/lang/invoke/VarHandle.java

+12-12
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,7 @@ public boolean hasInvokeExactBehavior() {
806806
* {@code (CT1 ct1, ..., CTn ctn, T expectedValue, T newValue)}
807807
* , statically represented using varargs.
808808
* @return {@code true} if successful, otherwise {@code false} if the
809-
* witness value was not the same as the {@code expectedValue}.
809+
* <em>witness value</em> was not the same as the {@code expectedValue}.
810810
* @throws UnsupportedOperationException if the access mode is unsupported
811811
* for this VarHandle.
812812
* @throws WrongMethodTypeException if the access mode type does not
@@ -839,7 +839,7 @@ public boolean hasInvokeExactBehavior() {
839839
* @param args the signature-polymorphic parameter list of the form
840840
* {@code (CT1 ct1, ..., CTn ctn, T expectedValue, T newValue)}
841841
* , statically represented using varargs.
842-
* @return the signature-polymorphic result that is the witness value, which
842+
* @return the signature-polymorphic result that is the <em>witness value</em>, which
843843
* will be the same as the {@code expectedValue} if successful
844844
* , statically represented using {@code Object}.
845845
* @throws UnsupportedOperationException if the access mode is unsupported
@@ -874,7 +874,7 @@ public boolean hasInvokeExactBehavior() {
874874
* @param args the signature-polymorphic parameter list of the form
875875
* {@code (CT1 ct1, ..., CTn ctn, T expectedValue, T newValue)}
876876
* , statically represented using varargs.
877-
* @return the signature-polymorphic result that is the witness value, which
877+
* @return the signature-polymorphic result that is the <em>witness value</em>, which
878878
* will be the same as the {@code expectedValue} if successful
879879
* , statically represented using {@code Object}.
880880
* @throws UnsupportedOperationException if the access mode is unsupported
@@ -909,7 +909,7 @@ public boolean hasInvokeExactBehavior() {
909909
* @param args the signature-polymorphic parameter list of the form
910910
* {@code (CT1 ct1, ..., CTn ctn, T expectedValue, T newValue)}
911911
* , statically represented using varargs.
912-
* @return the signature-polymorphic result that is the witness value, which
912+
* @return the signature-polymorphic result that is the <em>witness value</em>, which
913913
* will be the same as the {@code expectedValue} if successful
914914
* , statically represented using {@code Object}.
915915
* @throws UnsupportedOperationException if the access mode is unsupported
@@ -936,7 +936,7 @@ public boolean hasInvokeExactBehavior() {
936936
* {@link #get}.
937937
*
938938
* <p>This operation may fail spuriously (typically, due to memory
939-
* contention) even if the witness value does match the expected value.
939+
* contention) even if the <em>witness value</em> does match the expected value.
940940
*
941941
* <p>The method signature is of the form {@code (CT1 ct1, ..., CTn ctn, T expectedValue, T newValue)boolean}.
942942
*
@@ -949,7 +949,7 @@ public boolean hasInvokeExactBehavior() {
949949
* {@code (CT1 ct1, ..., CTn ctn, T expectedValue, T newValue)}
950950
* , statically represented using varargs.
951951
* @return {@code true} if successful, otherwise {@code false} if the
952-
* witness value was not the same as the {@code expectedValue} or if this
952+
* <em>witness value</em> was not the same as the {@code expectedValue} or if this
953953
* operation spuriously failed.
954954
* @throws UnsupportedOperationException if the access mode is unsupported
955955
* for this VarHandle.
@@ -973,7 +973,7 @@ public boolean hasInvokeExactBehavior() {
973973
* {@link #getVolatile}.
974974
*
975975
* <p>This operation may fail spuriously (typically, due to memory
976-
* contention) even if the witness value does match the expected value.
976+
* contention) even if the <em>witness value</em> does match the expected value.
977977
*
978978
* <p>The method signature is of the form {@code (CT1 ct1, ..., CTn ctn, T expectedValue, T newValue)boolean}.
979979
*
@@ -986,7 +986,7 @@ public boolean hasInvokeExactBehavior() {
986986
* {@code (CT1 ct1, ..., CTn ctn, T expectedValue, T newValue)}
987987
* , statically represented using varargs.
988988
* @return {@code true} if successful, otherwise {@code false} if the
989-
* witness value was not the same as the {@code expectedValue} or if this
989+
* <em>witness value</em> was not the same as the {@code expectedValue} or if this
990990
* operation spuriously failed.
991991
* @throws UnsupportedOperationException if the access mode is unsupported
992992
* for this VarHandle.
@@ -1010,7 +1010,7 @@ public boolean hasInvokeExactBehavior() {
10101010
* {@link #getAcquire}.
10111011
*
10121012
* <p>This operation may fail spuriously (typically, due to memory
1013-
* contention) even if the witness value does match the expected value.
1013+
* contention) even if the <em>witness value</em> does match the expected value.
10141014
*
10151015
* <p>The method signature is of the form {@code (CT1 ct1, ..., CTn ctn, T expectedValue, T newValue)boolean}.
10161016
*
@@ -1024,7 +1024,7 @@ public boolean hasInvokeExactBehavior() {
10241024
* {@code (CT1 ct1, ..., CTn ctn, T expectedValue, T newValue)}
10251025
* , statically represented using varargs.
10261026
* @return {@code true} if successful, otherwise {@code false} if the
1027-
* witness value was not the same as the {@code expectedValue} or if this
1027+
* <em>witness value</em> was not the same as the {@code expectedValue} or if this
10281028
* operation spuriously failed.
10291029
* @throws UnsupportedOperationException if the access mode is unsupported
10301030
* for this VarHandle.
@@ -1048,7 +1048,7 @@ public boolean hasInvokeExactBehavior() {
10481048
* {@link #get}.
10491049
*
10501050
* <p>This operation may fail spuriously (typically, due to memory
1051-
* contention) even if the witness value does match the expected value.
1051+
* contention) even if the <em>witness value</em> does match the expected value.
10521052
*
10531053
* <p>The method signature is of the form {@code (CT1 ct1, ..., CTn ctn, T expectedValue, T newValue)boolean}.
10541054
*
@@ -1062,7 +1062,7 @@ public boolean hasInvokeExactBehavior() {
10621062
* {@code (CT1 ct1, ..., CTn ctn, T expectedValue, T newValue)}
10631063
* , statically represented using varargs.
10641064
* @return {@code true} if successful, otherwise {@code false} if the
1065-
* witness value was not the same as the {@code expectedValue} or if this
1065+
* <em>witness value</em> was not the same as the {@code expectedValue} or if this
10661066
* operation spuriously failed.
10671067
* @throws UnsupportedOperationException if the access mode is unsupported
10681068
* for this VarHandle.

src/java.base/share/classes/java/util/concurrent/atomic/AtomicBoolean.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ public final void setRelease(boolean newValue) {
260260
*
261261
* @param expectedValue the expected value
262262
* @param newValue the new value
263-
* @return the witness value, which will be the same as the
263+
* @return the <em>witness value</em>, which will be the same as the
264264
* expected value if successful
265265
* @since 9
266266
*/
@@ -278,7 +278,7 @@ public final boolean compareAndExchange(boolean expectedValue, boolean newValue)
278278
*
279279
* @param expectedValue the expected value
280280
* @param newValue the new value
281-
* @return the witness value, which will be the same as the
281+
* @return the <em>witness value</em>, which will be the same as the
282282
* expected value if successful
283283
* @since 9
284284
*/
@@ -296,7 +296,7 @@ public final boolean compareAndExchangeAcquire(boolean expectedValue, boolean ne
296296
*
297297
* @param expectedValue the expected value
298298
* @param newValue the new value
299-
* @return the witness value, which will be the same as the
299+
* @return the <em>witness value</em>, which will be the same as the
300300
* expected value if successful
301301
* @since 9
302302
*/

src/java.base/share/classes/java/util/concurrent/atomic/AtomicInteger.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ public final void setRelease(int newValue) {
465465
*
466466
* @param expectedValue the expected value
467467
* @param newValue the new value
468-
* @return the witness value, which will be the same as the
468+
* @return the <em>witness value</em>, which will be the same as the
469469
* expected value if successful
470470
* @since 9
471471
*/
@@ -481,7 +481,7 @@ public final int compareAndExchange(int expectedValue, int newValue) {
481481
*
482482
* @param expectedValue the expected value
483483
* @param newValue the new value
484-
* @return the witness value, which will be the same as the
484+
* @return the <em>witness value</em>, which will be the same as the
485485
* expected value if successful
486486
* @since 9
487487
*/
@@ -497,7 +497,7 @@ public final int compareAndExchangeAcquire(int expectedValue, int newValue) {
497497
*
498498
* @param expectedValue the expected value
499499
* @param newValue the new value
500-
* @return the witness value, which will be the same as the
500+
* @return the <em>witness value</em>, which will be the same as the
501501
* expected value if successful
502502
* @since 9
503503
*/

src/java.base/share/classes/java/util/concurrent/atomic/AtomicIntegerArray.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ public final void setRelease(int i, int newValue) {
470470
* @param i the index
471471
* @param expectedValue the expected value
472472
* @param newValue the new value
473-
* @return the witness value, which will be the same as the
473+
* @return the <em>witness value</em>, which will be the same as the
474474
* expected value if successful
475475
* @since 9
476476
*/
@@ -488,7 +488,7 @@ public final int compareAndExchange(int i, int expectedValue, int newValue) {
488488
* @param i the index
489489
* @param expectedValue the expected value
490490
* @param newValue the new value
491-
* @return the witness value, which will be the same as the
491+
* @return the <em>witness value</em>, which will be the same as the
492492
* expected value if successful
493493
* @since 9
494494
*/
@@ -506,7 +506,7 @@ public final int compareAndExchangeAcquire(int i, int expectedValue, int newValu
506506
* @param i the index
507507
* @param expectedValue the expected value
508508
* @param newValue the new value
509-
* @return the witness value, which will be the same as the
509+
* @return the <em>witness value</em>, which will be the same as the
510510
* expected value if successful
511511
* @since 9
512512
*/

src/java.base/share/classes/java/util/concurrent/atomic/AtomicLong.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ public final void setRelease(long newValue) {
478478
*
479479
* @param expectedValue the expected value
480480
* @param newValue the new value
481-
* @return the witness value, which will be the same as the
481+
* @return the <em>witness value</em>, which will be the same as the
482482
* expected value if successful
483483
* @since 9
484484
*/
@@ -494,7 +494,7 @@ public final long compareAndExchange(long expectedValue, long newValue) {
494494
*
495495
* @param expectedValue the expected value
496496
* @param newValue the new value
497-
* @return the witness value, which will be the same as the
497+
* @return the <em>witness value</em>, which will be the same as the
498498
* expected value if successful
499499
* @since 9
500500
*/
@@ -510,7 +510,7 @@ public final long compareAndExchangeAcquire(long expectedValue, long newValue) {
510510
*
511511
* @param expectedValue the expected value
512512
* @param newValue the new value
513-
* @return the witness value, which will be the same as the
513+
* @return the <em>witness value</em>, which will be the same as the
514514
* expected value if successful
515515
* @since 9
516516
*/

src/java.base/share/classes/java/util/concurrent/atomic/AtomicLongArray.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ public final void setRelease(int i, long newValue) {
470470
* @param i the index
471471
* @param expectedValue the expected value
472472
* @param newValue the new value
473-
* @return the witness value, which will be the same as the
473+
* @return the <em>witness value</em>, which will be the same as the
474474
* expected value if successful
475475
* @since 9
476476
*/
@@ -488,7 +488,7 @@ public final long compareAndExchange(int i, long expectedValue, long newValue) {
488488
* @param i the index
489489
* @param expectedValue the expected value
490490
* @param newValue the new value
491-
* @return the witness value, which will be the same as the
491+
* @return the <em>witness value</em>, which will be the same as the
492492
* expected value if successful
493493
* @since 9
494494
*/
@@ -506,7 +506,7 @@ public final long compareAndExchangeAcquire(int i, long expectedValue, long newV
506506
* @param i the index
507507
* @param expectedValue the expected value
508508
* @param newValue the new value
509-
* @return the witness value, which will be the same as the
509+
* @return the <em>witness value</em>, which will be the same as the
510510
* expected value if successful
511511
* @since 9
512512
*/

src/java.base/share/classes/java/util/concurrent/atomic/AtomicReference.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ public final void setRelease(V newValue) {
353353
*
354354
* @param expectedValue the expected value
355355
* @param newValue the new value
356-
* @return the witness value, which will be the same as the
356+
* @return the <em>witness value</em>, which will be the same as the
357357
* expected value if successful
358358
* @since 9
359359
*/
@@ -369,7 +369,7 @@ public final V compareAndExchange(V expectedValue, V newValue) {
369369
*
370370
* @param expectedValue the expected value
371371
* @param newValue the new value
372-
* @return the witness value, which will be the same as the
372+
* @return the <em>witness value</em>, which will be the same as the
373373
* expected value if successful
374374
* @since 9
375375
*/
@@ -385,7 +385,7 @@ public final V compareAndExchangeAcquire(V expectedValue, V newValue) {
385385
*
386386
* @param expectedValue the expected value
387387
* @param newValue the new value
388-
* @return the witness value, which will be the same as the
388+
* @return the <em>witness value</em>, which will be the same as the
389389
* expected value if successful
390390
* @since 9
391391
*/

src/java.base/share/classes/java/util/concurrent/atomic/AtomicReferenceArray.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ public final void setRelease(int i, E newValue) {
434434
* @param i the index
435435
* @param expectedValue the expected value
436436
* @param newValue the new value
437-
* @return the witness value, which will be the same as the
437+
* @return the <em>witness value</em>, which will be the same as the
438438
* expected value if successful
439439
* @since 9
440440
*/
@@ -452,7 +452,7 @@ public final E compareAndExchange(int i, E expectedValue, E newValue) {
452452
* @param i the index
453453
* @param expectedValue the expected value
454454
* @param newValue the new value
455-
* @return the witness value, which will be the same as the
455+
* @return the <em>witness value</em>, which will be the same as the
456456
* expected value if successful
457457
* @since 9
458458
*/
@@ -470,7 +470,7 @@ public final E compareAndExchangeAcquire(int i, E expectedValue, E newValue) {
470470
* @param i the index
471471
* @param expectedValue the expected value
472472
* @param newValue the new value
473-
* @return the witness value, which will be the same as the
473+
* @return the <em>witness value</em>, which will be the same as the
474474
* expected value if successful
475475
* @since 9
476476
*/

0 commit comments

Comments
 (0)