Skip to content

Commit f4fa35e

Browse files
nizarbenallaliach
authored andcommitted
8330954: since-checker - Fix remaining @ since tags in java.base
Reviewed-by: liach, naoto
1 parent 3050ba0 commit f4fa35e

File tree

12 files changed

+69
-4
lines changed

12 files changed

+69
-4
lines changed

src/java.base/share/classes/java/io/FileInputStream.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,9 @@ public byte[] readAllBytes() throws IOException {
371371
return (capacity == nread) ? buf : Arrays.copyOf(buf, nread);
372372
}
373373

374+
/**
375+
* @since 11
376+
*/
374377
@Override
375378
public byte[] readNBytes(int len) throws IOException {
376379
if (len < 0)

src/java.base/share/classes/java/lang/classfile/ClassSignature.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@ public sealed interface ClassSignature
4141
/** {@return the type parameters of this class} */
4242
List<Signature.TypeParam> typeParameters();
4343

44-
/** {@return the instantiation of the superclass in this signature} */
44+
/**
45+
* {@return the instantiation of the superclass in this signature}
46+
*
47+
* @since 23
48+
*/
4549
Signature.ClassTypeSig superclassSignature();
4650

4751
/** {@return the instantiation of the interfaces in this signature} */

src/java.base/share/classes/java/lang/constant/ClassDesc.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,9 @@ else if (isArray()) {
374374
*/
375375
String descriptorString();
376376

377+
/**
378+
* @since 21
379+
*/
377380
@Override
378381
Class<?> resolveConstantDesc(MethodHandles.Lookup lookup) throws ReflectiveOperationException;
379382

src/java.base/share/classes/java/lang/constant/MethodHandleDesc.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,9 @@ default MethodHandleDesc asType(MethodTypeDesc type) {
207207
*/
208208
MethodTypeDesc invocationType();
209209

210+
/**
211+
* @since 21
212+
*/
210213
@Override
211214
MethodHandle resolveConstantDesc(MethodHandles.Lookup lookup) throws ReflectiveOperationException;
212215

src/java.base/share/classes/java/lang/constant/MethodTypeDesc.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,8 @@ default String displayDescriptor() {
222222
* @apiNote {@linkplain MethodTypeDesc} can represent method type descriptors
223223
* that are not representable by {@linkplain MethodType}, such as methods with
224224
* more than 255 parameter slots, so attempts to resolve these may result in errors.
225+
*
226+
* @since 21
225227
*/
226228
@Override
227229
MethodType resolveConstantDesc(MethodHandles.Lookup lookup) throws ReflectiveOperationException;

src/java.base/share/classes/java/lang/foreign/MemorySegment.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,8 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
618618
* // Take action (e.g. throw an Exception)
619619
* }
620620
* }
621+
*
622+
* @since 23
621623
*/
622624
long maxByteAlignment();
623625

src/java.base/share/classes/java/lang/ref/Reference.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -521,8 +521,6 @@ public boolean enqueue() {
521521
*
522522
* @return never returns normally
523523
* @throws CloneNotSupportedException always
524-
*
525-
* @since 11
526524
*/
527525
@Override
528526
protected Object clone() throws CloneNotSupportedException {

src/java.base/share/classes/java/text/ChoiceFormat.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -586,12 +586,18 @@ public Number parse(String text, ParsePosition status) {
586586
return Double.valueOf(bestNumber);
587587
}
588588

589+
/**
590+
* @since 23
591+
*/
589592
@Override
590593
public boolean isStrict() {
591594
throw new UnsupportedOperationException(
592595
"ChoiceFormat does not utilize leniency when parsing");
593596
}
594597

598+
/**
599+
* @since 23
600+
*/
595601
@Override
596602
public void setStrict(boolean strict) {
597603
throw new UnsupportedOperationException(

src/java.base/share/classes/java/util/concurrent/CompletableFuture.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2178,6 +2178,9 @@ public T getNow(T valueIfAbsent) {
21782178
return ((r = result) == null) ? valueIfAbsent : (T) reportJoin(r, "getNow");
21792179
}
21802180

2181+
/**
2182+
* @since 19
2183+
*/
21812184
@Override
21822185
public T resultNow() {
21832186
Object r = result;
@@ -2193,6 +2196,9 @@ public T resultNow() {
21932196
throw new IllegalStateException();
21942197
}
21952198

2199+
/**
2200+
* @since 19
2201+
*/
21962202
@Override
21972203
public Throwable exceptionNow() {
21982204
Object r = result;
@@ -2440,26 +2446,41 @@ public CompletableFuture<T> exceptionally(
24402446
return uniExceptionallyStage(null, fn);
24412447
}
24422448

2449+
/**
2450+
* @since 12
2451+
*/
24432452
public CompletableFuture<T> exceptionallyAsync(
24442453
Function<Throwable, ? extends T> fn) {
24452454
return uniExceptionallyStage(defaultExecutor(), fn);
24462455
}
24472456

2457+
/**
2458+
* @since 12
2459+
*/
24482460
public CompletableFuture<T> exceptionallyAsync(
24492461
Function<Throwable, ? extends T> fn, Executor executor) {
24502462
return uniExceptionallyStage(screenExecutor(executor), fn);
24512463
}
24522464

2465+
/**
2466+
* @since 12
2467+
*/
24532468
public CompletableFuture<T> exceptionallyCompose(
24542469
Function<Throwable, ? extends CompletionStage<T>> fn) {
24552470
return uniComposeExceptionallyStage(null, fn);
24562471
}
24572472

2473+
/**
2474+
* @since 12
2475+
*/
24582476
public CompletableFuture<T> exceptionallyComposeAsync(
24592477
Function<Throwable, ? extends CompletionStage<T>> fn) {
24602478
return uniComposeExceptionallyStage(defaultExecutor(), fn);
24612479
}
24622480

2481+
/**
2482+
* @since 12
2483+
*/
24632484
public CompletableFuture<T> exceptionallyComposeAsync(
24642485
Function<Throwable, ? extends CompletionStage<T>> fn,
24652486
Executor executor) {
@@ -2585,6 +2606,9 @@ public boolean isCompletedExceptionally() {
25852606
return ((r = result) instanceof AltResult) && r != NIL;
25862607
}
25872608

2609+
/**
2610+
* @since 19
2611+
*/
25882612
@Override
25892613
public State state() {
25902614
Object r = result;

src/java.base/share/classes/java/util/concurrent/DelayQueue.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,8 @@ public E poll(long timeout, TimeUnit unit) throws InterruptedException {
327327
* @return the <em>expired head</em> of this queue
328328
* @throws NoSuchElementException if this queue has no elements with an
329329
* expired delay
330+
*
331+
* @since 21
330332
*/
331333
public E remove() {
332334
return super.remove();

src/java.base/share/classes/java/util/concurrent/ForkJoinTask.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -887,6 +887,9 @@ public final boolean isCompletedNormally() {
887887
return (status & (DONE | ABNORMAL)) == DONE;
888888
}
889889

890+
/**
891+
* @since 19
892+
*/
890893
@Override
891894
public State state() {
892895
int s = status;
@@ -896,6 +899,9 @@ public State state() {
896899
State.CANCELLED;
897900
}
898901

902+
/**
903+
* @since 19
904+
*/
899905
@Override
900906
public V resultNow() {
901907
int s = status;
@@ -910,6 +916,9 @@ public V resultNow() {
910916
return getRawResult();
911917
}
912918

919+
/**
920+
* @since 19
921+
*/
913922
@Override
914923
public Throwable exceptionNow() {
915924
Throwable ex;

src/java.base/share/classes/java/util/concurrent/FutureTask.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,9 @@ public V get(long timeout, TimeUnit unit)
205205
return report(s);
206206
}
207207

208+
/**
209+
* @since 19
210+
*/
208211
@Override
209212
public V resultNow() {
210213
switch (state()) { // Future.State
@@ -221,6 +224,9 @@ public V resultNow() {
221224
}
222225
}
223226

227+
/**
228+
* @since 19
229+
*/
224230
@Override
225231
public Throwable exceptionNow() {
226232
switch (state()) { // Future.State
@@ -236,6 +242,9 @@ public Throwable exceptionNow() {
236242
}
237243
}
238244

245+
/**
246+
* @since 19
247+
*/
239248
@Override
240249
public State state() {
241250
int s = state;

0 commit comments

Comments
 (0)