Skip to content

Commit 91c249d

Browse files
cpovirkronshapiro
authored andcommitted
Remove @beta from APIs:
collect - most Collectors (aside from BloomFilter and ImmutableRange*, as those whole classes are @beta (though I did remove the redundant @beta annotation from the Collector-returning methods for clarity)) - Maps: asConverter, immutableEnumMap - MultimapBuilder - Streams: stream(Iterable), concat io - ByteStreams: copy, toByteArray - CharStreams: copy, toString - Files: as(Char|Byte)(Source|Sink) util.concurrent - Futures: addCallback, getDone, getUnchecked, immediateCancelledFuture, immediateFailedFuture, immediateFuture - ListeningScheduledExecutorService - Uninterruptibles other - HtmlEscapers - Splitter.splitToList - Ticker Fixes #3287 Fixes #3251 (aside from ImmutableRange*, but those whole classes are @beta, anyway) Addresses the main concerns of #3285 but doesn't cover the broader request Fixes #3340 Partially addresses #3239 RELNOTES=Removed `@Beta` from a number of frequently used APIs. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=232681253
1 parent 0451f49 commit 91c249d

39 files changed

+154
-62
lines changed

android/guava/src/com/google/common/base/Splitter.java

-1
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,6 @@ private Iterator<String> splittingIterator(CharSequence sequence) {
408408
* @return an immutable list of the segments split from the parameter
409409
* @since 15.0
410410
*/
411-
@Beta
412411
public List<String> splitToList(CharSequence sequence) {
413412
checkNotNull(sequence);
414413

android/guava/src/com/google/common/base/Ticker.java

-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
package com.google.common.base;
1616

17-
import com.google.common.annotations.Beta;
1817
import com.google.common.annotations.GwtCompatible;
1918

2019
/**
@@ -28,7 +27,6 @@
2827
* @since 10.0 (<a href="https://github.com/google/guava/wiki/Compatibility">mostly
2928
* source-compatible</a> since 9.0)
3029
*/
31-
@Beta
3230
@GwtCompatible
3331
public abstract class Ticker {
3432
/** Constructor for use by subclasses. */

android/guava/src/com/google/common/collect/Maps.java

-2
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ V transform(Entry<K, V> entry) {
139139
* @since 14.0
140140
*/
141141
@GwtCompatible(serializable = true)
142-
@Beta
143142
public static <K extends Enum<K>, V> ImmutableMap<K, V> immutableEnumMap(
144143
Map<K, ? extends V> map) {
145144
if (map instanceof ImmutableEnumMap) {
@@ -1363,7 +1362,6 @@ public int hashCode() {
13631362
*
13641363
* @since 16.0
13651364
*/
1366-
@Beta
13671365
public static <A, B> Converter<A, B> asConverter(final BiMap<A, B> bimap) {
13681366
return new BiMapConverter<>(bimap);
13691367
}

android/guava/src/com/google/common/collect/MultimapBuilder.java

-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import static com.google.common.base.Preconditions.checkNotNull;
2020
import static com.google.common.collect.CollectPreconditions.checkNonnegative;
2121

22-
import com.google.common.annotations.Beta;
2322
import com.google.common.annotations.GwtCompatible;
2423
import com.google.common.base.Supplier;
2524
import java.io.Serializable;
@@ -61,7 +60,6 @@
6160
* @param <V0> An upper bound on the value type of the generated multimap.
6261
* @since 16.0
6362
*/
64-
@Beta
6563
@GwtCompatible
6664
public abstract class MultimapBuilder<K0, V0> {
6765
/*

android/guava/src/com/google/common/html/HtmlEscapers.java

-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
package com.google.common.html;
1616

17-
import com.google.common.annotations.Beta;
1817
import com.google.common.annotations.GwtCompatible;
1918
import com.google.common.escape.Escaper;
2019
import com.google.common.escape.Escapers;
@@ -35,7 +34,6 @@
3534
* @author David Beaumont
3635
* @since 15.0
3736
*/
38-
@Beta
3937
@GwtCompatible
4038
public final class HtmlEscapers {
4139
/**

android/guava/src/com/google/common/io/ByteStreams.java

+14-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
* @author Colin Decker
4949
* @since 1.0
5050
*/
51-
@Beta
5251
@GwtIncompatible
5352
public final class ByteStreams {
5453

@@ -266,6 +265,7 @@ static byte[] toByteArray(InputStream in, long expectedSize) throws IOException
266265
* @since 20.0
267266
*/
268267
@CanIgnoreReturnValue
268+
@Beta
269269
public static long exhaust(InputStream in) throws IOException {
270270
long total = 0;
271271
long read;
@@ -280,6 +280,7 @@ public static long exhaust(InputStream in) throws IOException {
280280
* Returns a new {@link ByteArrayDataInput} instance to read from the {@code bytes} array from the
281281
* beginning.
282282
*/
283+
@Beta
283284
public static ByteArrayDataInput newDataInput(byte[] bytes) {
284285
return newDataInput(new ByteArrayInputStream(bytes));
285286
}
@@ -291,6 +292,7 @@ public static ByteArrayDataInput newDataInput(byte[] bytes) {
291292
* @throws IndexOutOfBoundsException if {@code start} is negative or greater than the length of
292293
* the array
293294
*/
295+
@Beta
294296
public static ByteArrayDataInput newDataInput(byte[] bytes, int start) {
295297
checkPositionIndex(start, bytes.length);
296298
return newDataInput(new ByteArrayInputStream(bytes, start, bytes.length - start));
@@ -303,6 +305,7 @@ public static ByteArrayDataInput newDataInput(byte[] bytes, int start) {
303305
*
304306
* @since 17.0
305307
*/
308+
@Beta
306309
public static ByteArrayDataInput newDataInput(ByteArrayInputStream byteArrayInputStream) {
307310
return new ByteArrayDataInputStream(checkNotNull(byteArrayInputStream));
308311
}
@@ -453,6 +456,7 @@ public String readUTF() {
453456
}
454457

455458
/** Returns a new {@link ByteArrayDataOutput} instance with a default size. */
459+
@Beta
456460
public static ByteArrayDataOutput newDataOutput() {
457461
return newDataOutput(new ByteArrayOutputStream());
458462
}
@@ -463,6 +467,7 @@ public static ByteArrayDataOutput newDataOutput() {
463467
*
464468
* @throws IllegalArgumentException if {@code size} is negative
465469
*/
470+
@Beta
466471
public static ByteArrayDataOutput newDataOutput(int size) {
467472
// When called at high frequency, boxing size generates too much garbage,
468473
// so avoid doing that if we can.
@@ -484,6 +489,7 @@ public static ByteArrayDataOutput newDataOutput(int size) {
484489
*
485490
* @since 17.0
486491
*/
492+
@Beta
487493
public static ByteArrayDataOutput newDataOutput(ByteArrayOutputStream byteArrayOutputSteam) {
488494
return new ByteArrayDataOutputStream(checkNotNull(byteArrayOutputSteam));
489495
}
@@ -659,6 +665,7 @@ public String toString() {
659665
*
660666
* @since 14.0 (since 1.0 as com.google.common.io.NullOutputStream)
661667
*/
668+
@Beta
662669
public static OutputStream nullOutputStream() {
663670
return NULL_OUTPUT_STREAM;
664671
}
@@ -671,6 +678,7 @@ public static OutputStream nullOutputStream() {
671678
* @return a length-limited {@link InputStream}
672679
* @since 14.0 (since 1.0 as com.google.common.io.LimitInputStream)
673680
*/
681+
@Beta
674682
public static InputStream limit(InputStream in, long limit) {
675683
return new LimitedInputStream(in, limit);
676684
}
@@ -757,6 +765,7 @@ public long skip(long n) throws IOException {
757765
* @throws EOFException if this stream reaches the end before reading all the bytes.
758766
* @throws IOException if an I/O error occurs.
759767
*/
768+
@Beta
760769
public static void readFully(InputStream in, byte[] b) throws IOException {
761770
readFully(in, b, 0, b.length);
762771
}
@@ -773,6 +782,7 @@ public static void readFully(InputStream in, byte[] b) throws IOException {
773782
* @throws EOFException if this stream reaches the end before reading all the bytes.
774783
* @throws IOException if an I/O error occurs.
775784
*/
785+
@Beta
776786
public static void readFully(InputStream in, byte[] b, int off, int len) throws IOException {
777787
int read = read(in, b, off, len);
778788
if (read != len) {
@@ -790,6 +800,7 @@ public static void readFully(InputStream in, byte[] b, int off, int len) throws
790800
* @throws EOFException if this stream reaches the end before skipping all the bytes
791801
* @throws IOException if an I/O error occurs, or the stream does not support skipping
792802
*/
803+
@Beta
793804
public static void skipFully(InputStream in, long n) throws IOException {
794805
long skipped = skipUpTo(in, n);
795806
if (skipped < n) {
@@ -848,6 +859,7 @@ private static long skipSafely(InputStream in, long n) throws IOException {
848859
* @throws IOException if an I/O error occurs
849860
* @since 14.0
850861
*/
862+
@Beta
851863
@CanIgnoreReturnValue // some processors won't return a useful result
852864
public static <T> T readBytes(InputStream input, ByteProcessor<T> processor) throws IOException {
853865
checkNotNull(input);
@@ -883,6 +895,7 @@ public static <T> T readBytes(InputStream input, ByteProcessor<T> processor) thr
883895
* @return the number of bytes read
884896
* @throws IOException if an I/O error occurs
885897
*/
898+
@Beta
886899
@CanIgnoreReturnValue
887900
// Sometimes you don't care how many bytes you actually read, I guess.
888901
// (You know that it's either going to read len bytes or stop at EOF.)

android/guava/src/com/google/common/io/CharStreams.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
* @author Colin Decker
4444
* @since 1.0
4545
*/
46-
@Beta
4746
@GwtIncompatible
4847
public final class CharStreams {
4948

@@ -193,6 +192,7 @@ private static StringBuilder toStringBuilder(Readable r) throws IOException {
193192
* @return a mutable {@link List} containing all the lines
194193
* @throws IOException if an I/O error occurs
195194
*/
195+
@Beta
196196
public static List<String> readLines(Readable r) throws IOException {
197197
List<String> result = new ArrayList<>();
198198
LineReader lineReader = new LineReader(r);
@@ -212,6 +212,7 @@ public static List<String> readLines(Readable r) throws IOException {
212212
* @throws IOException if an I/O error occurs
213213
* @since 14.0
214214
*/
215+
@Beta
215216
@CanIgnoreReturnValue // some processors won't return a useful result
216217
public static <T> T readLines(Readable readable, LineProcessor<T> processor) throws IOException {
217218
checkNotNull(readable);
@@ -233,6 +234,7 @@ public static <T> T readLines(Readable readable, LineProcessor<T> processor) thr
233234
*
234235
* @since 20.0
235236
*/
237+
@Beta
236238
@CanIgnoreReturnValue
237239
public static long exhaust(Readable readable) throws IOException {
238240
long total = 0;
@@ -254,6 +256,7 @@ public static long exhaust(Readable readable) throws IOException {
254256
* @throws EOFException if this stream reaches the end before skipping all the characters
255257
* @throws IOException if an I/O error occurs
256258
*/
259+
@Beta
257260
public static void skipFully(Reader reader, long n) throws IOException {
258261
checkNotNull(reader);
259262
while (n > 0) {
@@ -270,6 +273,7 @@ public static void skipFully(Reader reader, long n) throws IOException {
270273
*
271274
* @since 15.0
272275
*/
276+
@Beta
273277
public static Writer nullWriter() {
274278
return NullWriter.INSTANCE;
275279
}
@@ -338,6 +342,7 @@ public String toString() {
338342
* @param target the object to which output will be sent
339343
* @return a new Writer object, unless target is a Writer, in which case the target is returned
340344
*/
345+
@Beta
341346
public static Writer asWriter(Appendable target) {
342347
if (target instanceof Writer) {
343348
return (Writer) target;

0 commit comments

Comments
 (0)