Fix various typos (#11144)

This commit is contained in:
hakusai22 2024-05-07 11:29:44 +08:00 committed by GitHub
parent 354b028cae
commit 6ec744f2a0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
28 changed files with 37 additions and 37 deletions

View File

@ -84,7 +84,7 @@ with OpenSSL](#tls-with-netty-tcnative-on-openssl) are other valid options.
[Apache Tomcat's tcnative](https://tomcat.apache.org/native-doc/) and is a JNI
wrapper around OpenSSL/BoringSSL/LibreSSL.
We recommend BoringSSL for its simplicitly and low occurrence of security
We recommend BoringSSL for its simplicity and low occurrence of security
vulnerabilities relative to OpenSSL. BoringSSL is used by Conscrypt as well.
### TLS with netty-tcnative on BoringSSL

View File

@ -29,7 +29,7 @@ import javax.annotation.Nullable;
/**
* ALTS version of {@code ManagedChannelBuilder}. This class sets up a secure and authenticated
* commmunication between two cloud VMs using ALTS.
* communication between two cloud VMs using ALTS.
*/
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/4151")
public final class AltsChannelBuilder extends ForwardingChannelBuilder2<AltsChannelBuilder> {

View File

@ -36,7 +36,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
/**
* Provides secure and authenticated commmunication between two cloud VMs using ALTS.
* Provides secure and authenticated communication between two cloud VMs using ALTS.
*/
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/4151")
public final class AltsChannelCredentials {

View File

@ -147,7 +147,7 @@ public class FakeTsiHandshaker implements TsiHandshaker {
return;
}
// Prepare the next message, if neeeded.
// Prepare the next message, if needed.
if (sendBuffer == null) {
if (sendState.next() != receiveState) {
// We're still waiting for bytes from the peer, so bail.

View File

@ -197,7 +197,7 @@ public final class ServerInterceptors {
* to allow for interceptors to handle messages as multiple different ReqT/RespT types within
* the chain if the added cost of serialization is not a concern.
*
* @param serviceDef the sevice definition to add request and response marshallers to.
* @param serviceDef the service definition to add request and response marshallers to.
* @param requestMarshaller request marshaller
* @param responseMarshaller response marshaller
* @param <ReqT> the request payload type

View File

@ -163,7 +163,7 @@ public final class SynchronizationContext implements Executor {
}
/**
* Schedules a task to be added and run via {@link #execute} after an inital delay and then
* Schedules a task to be added and run via {@link #execute} after an initial delay and then
* repeated after the delay until cancelled.
*
* @param task the task being scheduled

View File

@ -67,7 +67,7 @@ public class MethodDescriptorTest {
assertFalse(descriptor.isIdempotent());
// Create a new desriptor by setting idempotent to true
// Create a new descriptor by setting idempotent to true
MethodDescriptor<String, String> newDescriptor =
descriptor.toBuilder().setIdempotent(true).build();
assertTrue(newDescriptor.isIdempotent());
@ -86,7 +86,7 @@ public class MethodDescriptorTest {
.build();
assertFalse(descriptor.isSafe());
// Create a new desriptor by setting safe to true
// Create a new descriptor by setting safe to true
MethodDescriptor<String, String> newDescriptor = descriptor.toBuilder().setSafe(true).build();
assertTrue(newDescriptor.isSafe());
// All other fields should staty the same

View File

@ -136,7 +136,7 @@ public final class BinderTransportTest extends AbstractTransportTest {
// refers to an Android Service class declared in an applications manifest.
//
// However, unlike a regular network server, which is responsible for listening on its port, a
// BinderServier is not responsible for the creation of its host Service. The opposite is
// BinderServer is not responsible for the creation of its host Service. The opposite is
// the case, with the host Android Service (itself created by the Android platform in
// response to a connection) building the gRPC server.
//

View File

@ -321,7 +321,7 @@ public final class SecurityPolicies {
packageInfo = packageManager.getPackageInfo(packageName, PackageManager.GET_SIGNATURES);
if (packageInfo.signatures == null || packageInfo.signatures.length != 1) {
// Reject multiply-signed apks because of b/13678484
// (See PackageManagerGetSignatures supression above).
// (See PackageManagerGetSignatures suppression above).
return false;
}

View File

@ -202,7 +202,7 @@
<property name="accessModifiers" value="public"/>
<property name="allowMissingParamTags" value="true"/>
<property name="allowMissingReturnTag" value="true"/>
<!-- TOOD(ejona): Too restrictive for tests
<!-- TODO(ejona): Too restrictive for tests
<property name="allowedAnnotations" value="Override, Test"/-->
<property name="allowedAnnotations" value="Override, Test, Before, After, BeforeClass, AfterClass, Setup, TearDown"/>
</module>

View File

@ -61,7 +61,7 @@ public interface ClientTransport extends InternalInstrumented<SocketStats> {
* Pings a remote endpoint. When an acknowledgement is received, the given callback will be
* invoked using the given executor.
*
* <p>Pings are not necessarily sent to the same endpont, thus a successful ping only means at
* <p>Pings are not necessarily sent to the same endpoint, thus a successful ping only means at
* least one endpoint responded, but doesn't imply the availability of other endpoints (if there
* is any).
*

View File

@ -90,7 +90,7 @@ final class DelayedClientTransport implements ManagedClientTransport {
/**
* Creates a new delayed transport.
*
* @param defaultAppExecutor pending streams will create real streams and run bufferred operations
* @param defaultAppExecutor pending streams will create real streams and run buffered operations
* in an application executor, which will be this executor, unless there is on provided in
* {@link CallOptions}.
* @param syncContext all listener callbacks of the delayed transport will be run from this

View File

@ -46,7 +46,7 @@ class DelayedStream implements ClientStream {
private volatile boolean passThrough;
/**
* Non-{@code null} iff start has been called. Used to assert methods are called in appropriate
* order, but also used if an error occurrs before {@code realStream} is set.
* order, but also used if an error occurs before {@code realStream} is set.
*/
private ClientStreamListener listener;
/** Must hold {@code this} lock when setting. */

View File

@ -196,7 +196,7 @@ final class ManagedChannelImpl extends ManagedChannel implements
private final CompressorRegistry compressorRegistry;
private final Supplier<Stopwatch> stopwatchSupplier;
/** The timout before entering idle mode. */
/** The timeout before entering idle mode. */
private final long idleTimeoutMillis;
private final ConnectivityStateManager channelStateManager = new ConnectivityStateManager();

View File

@ -113,7 +113,7 @@ public final class SerializingExecutor implements Executor, Runnable {
// ConcurrentLinkedQueue claims that null elements are not allowed, but seems to not
// throw if the item to remove is null. If removable is present in the queue twice,
// the wrong one may be removed. It doesn't seem possible for this case to exist today.
// This is important to run in case of RejectedExectuionException, so that future calls
// This is important to run in case of RejectedExecutionException, so that future calls
// to execute don't succeed and accidentally run a previous runnable.
runQueue.remove(removable);
}

View File

@ -930,7 +930,7 @@ public class DnsNameResolverTest {
}
@Test
public void maybeChooseServiceConfig_clientLanguageMatchesEmtpy() {
public void maybeChooseServiceConfig_clientLanguageMatchesEmpty() {
Map<String, Object> choice = new LinkedHashMap<>();
List<String> langs = new ArrayList<>();
choice.put("clientLanguage", langs);
@ -1099,7 +1099,7 @@ public class DnsNameResolverTest {
}
@Test
public void maybeChooseServiceConfig_hostnameMatchesEmtpy() {
public void maybeChooseServiceConfig_hostnameMatchesEmpty() {
Map<String, Object> choice = new LinkedHashMap<>();
List<String> hosts = new ArrayList<>();
choice.put("clientHostname", hosts);
@ -1191,7 +1191,7 @@ public class DnsNameResolverTest {
}
@Test
public void shouldUseJndi_trueIfLocalhostOverriden() {
public void shouldUseJndi_trueIfLocalhostOverridden() {
boolean enableJndi = true;
boolean enableJndiLocalhost = true;
String host = "localhost";

View File

@ -964,7 +964,7 @@ public class InternalSubchannelTest {
// This should not lead to the creation of a new transport.
reconnectTask.command.run();
// Futher call to obtainActiveTransport() is no-op.
// Further call to obtainActiveTransport() is no-op.
assertNull(internalSubchannel.obtainActiveTransport());
assertEquals(SHUTDOWN, internalSubchannel.getState());
assertNoCallbackInvoke();

View File

@ -932,7 +932,7 @@ public class ServerImplTest {
} catch (Exception ex) {
throw new AssertionError(ex);
}
// If deadlock is possible with this setup, this sychronization completes the loop because
// If deadlock is possible with this setup, this synchronization completes the loop because
// the serverShutdown needs a lock that Server is holding while calling this method.
synchronized (lock) {
}
@ -972,7 +972,7 @@ public class ServerImplTest {
} catch (Exception ex) {
throw new AssertionError(ex);
}
// If deadlock is possible with this setup, this sychronization completes the loop
// If deadlock is possible with this setup, this synchronization completes the loop
// because the transportTerminated needs a lock that Server is holding while calling this
// method.
synchronized (lock) {
@ -1298,7 +1298,7 @@ public class ServerImplTest {
assertEquals(1, executor.runDueTasks());
verify(callHandler).startCall(ArgumentMatchers.<ServerCall<String, Integer>>any(),
ArgumentMatchers.<Metadata>any());
// This call will be handled by the fallbackRegistry because it's not registred in the internal
// This call will be handled by the fallbackRegistry because it's not registered in the internal
// registry.
transportListener.streamCreated(stream, "Service1/Method2", requestHeaders);
assertEquals(1, executor.runDueTasks());

View File

@ -98,7 +98,7 @@ public class SharedResourceHolderTest {
assertEquals(SharedResourceHolder.DESTROY_DELAY_SECONDS,
scheduledDestroyTask.getDelay(TimeUnit.SECONDS));
// Simluate that the destroyer executes the foo destroying task
// Simulate that the destroyer executes the foo destroying task
scheduledDestroyTask.runTask();
assertTrue(sharedFoo.closed);

View File

@ -62,7 +62,7 @@ public class HostnameGreeterTest {
InProcessServerBuilder.forName("hostname")
.directExecutor().addService(new HostnameGreeter(null)).build().start());
// Just verifing the service doesn't crash
// Just verifying the service doesn't crash
HelloReply reply =
blockingStub.sayHello(HelloRequest.newBuilder().setName("anonymous").build());
assertTrue(reply.getMessage(), reply.getMessage().startsWith("Hello anonymous, from "));

View File

@ -55,7 +55,7 @@ final class GrpclbConfig {
}
/**
* If specified, it overrides the name of the sevice name to be sent to the balancer. if not, the
* If specified, it overrides the name of the service name to be sent to the balancer. if not, the
* target to be sent to the balancer will continue to be obtained from the target URI passed
* to the gRPC client channel.
*/

View File

@ -526,7 +526,7 @@ public class TestServiceClient {
/* Parses input string as a semi-colon-separated list of colon-separated key/value pairs.
* Allow any character but semicolons in values.
* If the string is emtpy, return null.
* If the string is empty, return null.
* Otherwise, return a client interceptor which inserts the provided metadata.
*/
@Nullable

View File

@ -72,7 +72,7 @@ dependencies {
import net.ltgt.gradle.errorprone.CheckSeverity
[tasks.named("compileJava"), tasks.named("compileTestJava")]*.configure {
// Netty retuns a lot of futures that we mostly don't care about.
// Netty returns a lot of futures that we mostly don't care about.
options.errorprone.check("FutureReturnValueIgnored", CheckSeverity.OFF)
}

View File

@ -206,7 +206,7 @@ final class CachingRlsLbClient {
}
/**
* Convert the status to UNAVAILBLE and enhance the error message.
* Convert the status to UNAVAILABLE and enhance the error message.
* @param status status as provided by server
* @param serverName Used for error description
* @return Transformed status

View File

@ -888,7 +888,7 @@ public final class BinlogHelperTest {
verify(sink).write(base);
}
// server messsage
// server message
{
sinkWriterImpl.logRpcMessage(
seq,
@ -1433,16 +1433,16 @@ public final class BinlogHelperTest {
// send server header
{
Metadata serverInital = new Metadata();
interceptedCall.get().sendHeaders(serverInital);
Metadata serverInitial = new Metadata();
interceptedCall.get().sendHeaders(serverInitial);
verify(mockSinkWriter).logServerHeader(
/*seq=*/ eq(2L),
same(serverInital),
same(serverInitial),
eq(Logger.LOGGER_SERVER),
eq(CALL_ID),
ArgumentMatchers.<SocketAddress>isNull());
verifyNoMoreInteractions(mockSinkWriter);
assertSame(serverInital, actualServerInitial.get());
assertSame(serverInitial, actualServerInitial.get());
}
// receive client msg

View File

@ -273,7 +273,7 @@ public class HealthCheckingLoadBalancerFactoryTest {
verifyNoMoreInteractions(origLb);
Subchannel[] wrappedSubchannels = new Subchannel[NUM_SUBCHANNELS];
// Simulate that the orignal LB creates Subchannels
// Simulate that the original LB creates Subchannels
for (int i = 0; i < NUM_SUBCHANNELS; i++) {
// Subchannel attributes set by origLb are correctly plumbed in
String subchannelAttrValue = "eag attr " + i;

View File

@ -399,7 +399,7 @@ public class ClientCallsTest {
future.get();
fail("Should fail");
} catch (CancellationException e) {
// Exepcted
// Expected
}
}

View File

@ -329,7 +329,7 @@ final class FilterChainMatchingProtocolNegotiators {
// use prefix_ranges (CIDR) and get the most specific matches
private static Collection<FilterChain> filterOnIpAddress(
Collection<FilterChain> filterChains, InetAddress address, boolean forDestination) {
// curent list of top ones
// current list of top ones
ArrayList<FilterChain> topOnes = new ArrayList<>(filterChains.size());
int topMatchingPrefixLen = -1;
for (FilterChain filterChain : filterChains) {