Skip to content

Commit 2daa37c

Browse files
committed
fix
1 parent 07c5826 commit 2daa37c

39 files changed

Lines changed: 378 additions & 344 deletions

iotdb-core/node-commons/src/main/java/com/google/common/base/Ascii.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
import static com.google.common.base.Preconditions.checkArgument;
1818
import static com.google.common.base.Preconditions.checkNotNull;
1919

20-
2120
/**
2221
* Static methods pertaining to ASCII characters (those in the range of values {@code 0x00} through
2322
* {@code 0x7F}), and to strings containing such characters.

iotdb-core/node-commons/src/main/java/com/google/common/base/CharMatcher.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414

1515
package com.google.common.base;
1616

17+
import java.util.Arrays;
18+
import java.util.BitSet;
19+
1720
import static com.google.common.base.Preconditions.checkArgument;
1821
import static com.google.common.base.Preconditions.checkNotNull;
1922
import static com.google.common.base.Preconditions.checkPositionIndex;
2023

21-
import java.util.Arrays;
22-
import java.util.BitSet;
23-
2424
/**
2525
* Determines a true or false value for any Java {@code char} value, just as {@link Predicate} does
2626
* for any {@link Object}. Also offers basic text processing methods based on this function.

iotdb-core/node-commons/src/main/java/com/google/common/base/Converter.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,13 @@
1414

1515
package com.google.common.base;
1616

17-
import static com.google.common.base.NullnessCasts.uncheckedCastNullableTToT;
18-
import static com.google.common.base.Preconditions.checkNotNull;
17+
import javax.annotation.CheckForNull;
1918

2019
import java.io.Serializable;
2120
import java.util.Iterator;
22-
import javax.annotation.CheckForNull;
21+
22+
import static com.google.common.base.NullnessCasts.uncheckedCastNullableTToT;
23+
import static com.google.common.base.Preconditions.checkNotNull;
2324

2425
/**
2526
* A function from {@code A} to {@code B} with an associated <i>reverse</i> function from {@code B}
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
/*
2+
* Copyright (C) 2007 The Guava Authors
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5+
* in compliance with the License. You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software distributed under the License
10+
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11+
* or implied. See the License for the specific language governing permissions and limitations under
12+
* the License.
13+
*/
14+
15+
package com.google.common.base;
16+
17+
import javax.annotation.CheckForNull;
18+
19+
/**
20+
* Legacy version of {@link java.util.function.Function java.util.function.Function}.
21+
*
22+
* <p>The {@link Functions} class provides common functions and related utilities.
23+
*
24+
* <p>As this interface extends {@code java.util.function.Function}, an instance of this type can be
25+
* used as a {@code java.util.function.Function} directly. To use a {@code
26+
* java.util.function.Function} in a context where a {@code com.google.common.base.Function} is
27+
* needed, use {@code function::apply}.
28+
*
29+
* <p>This interface is now a legacy type. Use {@code java.util.function.Function} (or the
30+
* appropriate primitive specialization such as {@code ToIntFunction}) instead whenever possible.
31+
* Otherwise, at least reduce <i>explicit</i> dependencies on this type by using lambda expressions
32+
* or method references instead of classes, leaving your code easier to migrate in the future.
33+
*
34+
* <p>See the Guava User Guide article on <a
35+
* href="https://github.com/google/guava/wiki/FunctionalExplained">the use of {@code Function}</a>.
36+
*
37+
* @author Kevin Bourrillion
38+
* @since 2.0
39+
*/
40+
@FunctionalInterface
41+
public interface Function<F extends Object, T extends Object>
42+
extends java.util.function.Function<F, T> {
43+
@Override
44+
T apply(F input);
45+
46+
/**
47+
* <i>May</i> return {@code true} if {@code object} is a {@code Function} that behaves identically
48+
* to this function.
49+
*
50+
* <p><b>Warning: do not depend</b> on the behavior of this method.
51+
*
52+
* <p>Historically, {@code Function} instances in this library have implemented this method to
53+
* recognize certain cases where distinct {@code Function} instances would in fact behave
54+
* identically. However, as code migrates to {@code java.util.function}, that behavior will
55+
* disappear. It is best not to depend on it.
56+
*/
57+
@Override
58+
boolean equals(@CheckForNull Object object);
59+
}

iotdb-core/node-commons/src/main/java/com/google/common/base/Joiner.java

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,17 @@
1414

1515
package com.google.common.base;
1616

17-
import static com.google.common.base.Preconditions.checkNotNull;
18-
import static java.util.Objects.requireNonNull;
17+
import javax.annotation.CheckForNull;
1918

2019
import java.io.IOException;
2120
import java.util.AbstractList;
2221
import java.util.Arrays;
2322
import java.util.Iterator;
2423
import java.util.Map;
2524
import java.util.Map.Entry;
26-
import javax.annotation.CheckForNull;
25+
26+
import static com.google.common.base.Preconditions.checkNotNull;
27+
import static java.util.Objects.requireNonNull;
2728

2829
/**
2930
* An object which joins pieces of text (specified as an array, {@link Iterable}, varargs or even a
@@ -119,17 +120,13 @@ public <A extends Appendable> A appendTo(A appendable, Iterator<? extends Object
119120
* Appends the string representation of each of {@code parts}, using the previously configured
120121
* separator between each, to {@code appendable}.
121122
*/
122-
public final <A extends Appendable> A appendTo(A appendable, Object[] parts)
123-
throws IOException {
123+
public final <A extends Appendable> A appendTo(A appendable, Object[] parts) throws IOException {
124124
return appendTo(appendable, Arrays.asList(parts));
125125
}
126126

127127
/** Appends to {@code appendable} the string representation of each of the remaining arguments. */
128128
public final <A extends Appendable> A appendTo(
129-
A appendable,
130-
@CheckForNull Object first,
131-
@CheckForNull Object second,
132-
Object... rest)
129+
A appendable, @CheckForNull Object first, @CheckForNull Object second, Object... rest)
133130
throws IOException {
134131
return appendTo(appendable, iterable(first, second, rest));
135132
}
@@ -139,8 +136,7 @@ public final <A extends Appendable> A appendTo(
139136
* separator between each, to {@code builder}. Identical to {@link #appendTo(Appendable,
140137
* Iterable)}, except that it does not throw {@link IOException}.
141138
*/
142-
public final StringBuilder appendTo(
143-
StringBuilder builder, Iterable<? extends Object> parts) {
139+
public final StringBuilder appendTo(StringBuilder builder, Iterable<? extends Object> parts) {
144140
return appendTo(builder, parts.iterator());
145141
}
146142

@@ -151,8 +147,7 @@ public final StringBuilder appendTo(
151147
*
152148
* @since 11.0
153149
*/
154-
public final StringBuilder appendTo(
155-
StringBuilder builder, Iterator<? extends Object> parts) {
150+
public final StringBuilder appendTo(StringBuilder builder, Iterator<? extends Object> parts) {
156151
try {
157152
appendTo((Appendable) builder, parts);
158153
} catch (IOException impossible) {
@@ -249,8 +244,8 @@ public Joiner skipNulls() {
249244
public Joiner skipNulls() {
250245
return new Joiner(this) {
251246
@Override
252-
public <A extends Appendable> A appendTo(
253-
A appendable, Iterator<? extends Object> parts) throws IOException {
247+
public <A extends Appendable> A appendTo(A appendable, Iterator<? extends Object> parts)
248+
throws IOException {
254249
checkNotNull(appendable, "appendable");
255250
checkNotNull(parts, "parts");
256251
while (parts.hasNext()) {

iotdb-core/node-commons/src/main/java/com/google/common/base/MoreObjects.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
package com.google.common.base;
1616

17-
import static com.google.common.base.Preconditions.checkNotNull;
17+
import javax.annotation.CheckForNull;
1818

1919
import java.lang.reflect.Array;
2020
import java.util.Arrays;
@@ -23,7 +23,8 @@
2323
import java.util.OptionalDouble;
2424
import java.util.OptionalInt;
2525
import java.util.OptionalLong;
26-
import javax.annotation.CheckForNull;
26+
27+
import static com.google.common.base.Preconditions.checkNotNull;
2728

2829
/**
2930
* Helper functions that operate on any {@code Object}, and are not already provided in {@link

iotdb-core/node-commons/src/main/java/com/google/common/base/Objects.java

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,19 @@
11
/*
2-
* Licensed to the Apache Software Foundation (ASF) under one
3-
* or more contributor license agreements. See the NOTICE file
4-
* distributed with this work for additional information
5-
* regarding copyright ownership. The ASF licenses this file
6-
* to you under the Apache License, Version 2.0 (the
7-
* "License"); you may not use this file except in compliance
8-
* with the License. You may obtain a copy of the License at
2+
* Copyright (C) 2007 The Guava Authors
93
*
10-
* http://www.apache.org/licenses/LICENSE-2.0
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5+
* in compliance with the License. You may obtain a copy of the License at
116
*
12-
* Unless required by applicable law or agreed to in writing,
13-
* software distributed under the License is distributed on an
14-
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15-
* KIND, either express or implied. See the License for the
16-
* specific language governing permissions and limitations
17-
* under the License.
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software distributed under the License
10+
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11+
* or implied. See the License for the specific language governing permissions and limitations under
12+
* the License.
1813
*/
1914

2015
package com.google.common.base;
2116

22-
import org.checkerframework.checker.nullness.qual.Nullable;
23-
2417
import javax.annotation.CheckForNull;
2518

2619
import java.util.Arrays;
@@ -35,7 +28,6 @@
3528
* @author Laurence Gonsalves
3629
* @since 2.0
3730
*/
38-
@ElementTypesAreNonnullByDefault
3931
public final class Objects extends ExtraObjectsMethodsForWeb {
4032
private Objects() {}
4133

@@ -80,7 +72,7 @@ public static boolean equal(@CheckForNull Object a, @CheckForNull Object b) {
8072
* <p><b>Note for Java 7 and later:</b> This method should be treated as deprecated; use {@link
8173
* java.util.Objects#hash} instead.
8274
*/
83-
public static int hashCode(@CheckForNull @Nullable Object... objects) {
75+
public static int hashCode(@CheckForNull Object... objects) {
8476
return Arrays.hashCode(objects);
8577
}
8678
}

iotdb-core/node-commons/src/main/java/com/google/common/base/Preconditions.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414

1515
package com.google.common.base;
1616

17-
import static com.google.common.base.Strings.lenientFormat;
18-
1917
import javax.annotation.CheckForNull;
2018

19+
import static com.google.common.base.Strings.lenientFormat;
20+
2121
/**
2222
* Static convenience methods that help a method or constructor check whether it was invoked
2323
* correctly (that is, whether its <i>preconditions</i> were met).
@@ -153,9 +153,7 @@ public static void checkArgument(boolean expression, @CheckForNull Object errorM
153153
* @throws IllegalArgumentException if {@code expression} is false
154154
*/
155155
public static void checkArgument(
156-
boolean expression,
157-
String errorMessageTemplate,
158-
@CheckForNull Object... errorMessageArgs) {
156+
boolean expression, String errorMessageTemplate, @CheckForNull Object... errorMessageArgs) {
159157
if (!expression) {
160158
throw new IllegalArgumentException(lenientFormat(errorMessageTemplate, errorMessageArgs));
161159
}

iotdb-core/node-commons/src/main/java/com/google/common/base/Stopwatch.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414

1515
package com.google.common.base;
1616

17+
import java.time.Duration;
18+
import java.util.concurrent.TimeUnit;
19+
1720
import static com.google.common.base.Preconditions.checkNotNull;
1821
import static com.google.common.base.Preconditions.checkState;
1922
import static java.util.concurrent.TimeUnit.DAYS;
@@ -24,15 +27,12 @@
2427
import static java.util.concurrent.TimeUnit.NANOSECONDS;
2528
import static java.util.concurrent.TimeUnit.SECONDS;
2629

27-
import java.time.Duration;
28-
import java.util.concurrent.TimeUnit;
29-
3030
/**
3131
* An object that accurately measures <i>elapsed time</i>: the measured duration between two
3232
* successive readings of "now" in the same process.
3333
*
34-
* <p>In contrast, <i>wall time</i> is a reading of "now" as given by a method like
35-
* {@link System#currentTimeMillis()}, best represented as an {@link java.time.Instant}. Such values
34+
* <p>In contrast, <i>wall time</i> is a reading of "now" as given by a method like {@link
35+
* System#currentTimeMillis()}, best represented as an {@link java.time.Instant}. Such values
3636
* <i>can</i> be subtracted to obtain a {@code Duration} (such as by {@code Duration.between}), but
3737
* doing so does <i>not</i> give a reliable measurement of elapsed time, because wall time readings
3838
* are inherently approximate, routinely affected by periodic clock corrections. Because this class

iotdb-core/node-commons/src/main/java/com/google/common/base/Strings.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,14 @@
1414

1515
package com.google.common.base;
1616

17+
import javax.annotation.CheckForNull;
18+
19+
import java.util.logging.Logger;
20+
1721
import static com.google.common.base.Preconditions.checkArgument;
1822
import static com.google.common.base.Preconditions.checkNotNull;
1923
import static java.util.logging.Level.WARNING;
2024

21-
import java.util.logging.Logger;
22-
import javax.annotation.CheckForNull;
23-
2425
/**
2526
* Static utility methods pertaining to {@code String} or {@code CharSequence} instances.
2627
*
@@ -255,8 +256,7 @@ static boolean validSurrogatePairAt(CharSequence string, int index) {
255256
* @since 25.1
256257
*/
257258
// TODO(diamondm) consider using Arrays.toString() for array parameters
258-
public static String lenientFormat(
259-
@CheckForNull String template, @CheckForNull Object... args) {
259+
public static String lenientFormat(@CheckForNull String template, @CheckForNull Object... args) {
260260
template = String.valueOf(template); // null -> "null"
261261

262262
if (args == null) {

0 commit comments

Comments
 (0)