From 8a1db8e7c5bdf60183ace5bb7a86ed15aa005177 Mon Sep 17 00:00:00 2001 From: Andreas Deininger Date: Fri, 22 Dec 2023 23:01:13 +0100 Subject: [PATCH] Fix typos --- .../java/com/google/errorprone/annotations/RestrictedApi.java | 2 +- .../com/google/errorprone/bugpatterns/ClassNewInstance.java | 2 +- docs/bugpattern/BindingToUnqualifiedCommonType.md | 2 +- docs/bugpattern/IsInstanceOfClass.md | 2 +- docs/bugpattern/OverridesGuiceInjectableMethod.md | 2 +- docs/bugpattern/ProtocolBufferOrdinal.md | 2 +- docs/bugpattern/RedundantOverride.md | 2 +- docs/bugpattern/StaticAssignmentOfThrowable.md | 2 +- docs/bugpattern/javadoc/InvalidInlineTag.md | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/annotations/src/main/java/com/google/errorprone/annotations/RestrictedApi.java b/annotations/src/main/java/com/google/errorprone/annotations/RestrictedApi.java index e5fbba8a2aae..0e900ec91822 100644 --- a/annotations/src/main/java/com/google/errorprone/annotations/RestrictedApi.java +++ b/annotations/src/main/java/com/google/errorprone/annotations/RestrictedApi.java @@ -103,7 +103,7 @@ * *

This should only be used if callers should aggressively move away from this API (or change * to a allowlist annotation after review). Too many warnings will lead to ALL warnings being - * ignored, so tread very carefully. + * ignored, so treat very carefully. */ Class[] allowlistWithWarningAnnotations() default {}; } diff --git a/core/src/main/java/com/google/errorprone/bugpatterns/ClassNewInstance.java b/core/src/main/java/com/google/errorprone/bugpatterns/ClassNewInstance.java index dc20ff9181c6..6d541da0d1b5 100644 --- a/core/src/main/java/com/google/errorprone/bugpatterns/ClassNewInstance.java +++ b/core/src/main/java/com/google/errorprone/bugpatterns/ClassNewInstance.java @@ -83,7 +83,7 @@ public Description matchMethodInvocation(MethodInvocationTree tree, VisitorState return describeMatch(tree, fix.build()); } - // if the match occurrs inside the body of a try statement with existing catch clauses + // if the match occurs inside the body of a try statement with existing catch clauses // update or add a catch block to handle the new exceptions private static boolean fixExceptions(VisitorState state, SuggestedFix.Builder fix) { TryTree tryTree = null; diff --git a/docs/bugpattern/BindingToUnqualifiedCommonType.md b/docs/bugpattern/BindingToUnqualifiedCommonType.md index 3c8fdde6fe70..26d97a01310d 100644 --- a/docs/bugpattern/BindingToUnqualifiedCommonType.md +++ b/docs/bugpattern/BindingToUnqualifiedCommonType.md @@ -1,6 +1,6 @@ Guice bindings are keyed by a pair of (optional Annotation, Type). -In most cirumstances, one doesn't need the annotation, as there's really just +In most circumstances, one doesn't need the annotation, as there's really just one active implementation: ```java diff --git a/docs/bugpattern/IsInstanceOfClass.md b/docs/bugpattern/IsInstanceOfClass.md index 2159a61da248..192b5b13d024 100644 --- a/docs/bugpattern/IsInstanceOfClass.md +++ b/docs/bugpattern/IsInstanceOfClass.md @@ -18,7 +18,7 @@ equal to `Class` (i.e. lhs is equal to `Class.class`). ``` To test if the type represented by a class literal is a subtype of the type -reprsented by some other class literal, `isAssignableFrom` should be used +represented by some other class literal, `isAssignableFrom` should be used instead: ```java diff --git a/docs/bugpattern/OverridesGuiceInjectableMethod.md b/docs/bugpattern/OverridesGuiceInjectableMethod.md index 3e56f97e968d..41bd78783242 100644 --- a/docs/bugpattern/OverridesGuiceInjectableMethod.md +++ b/docs/bugpattern/OverridesGuiceInjectableMethod.md @@ -3,5 +3,5 @@ with `@com.google.inject.Inject`, Guice will inject it even if it itself is not annotated. This differs from the behavior of methods that override `@javax.inject.Inject` methods since according to the JSR-330 spec, a method that overrides a method annotated with `@javax.inject.Inject` will not be -injected unless it iself is annotated with `@Inject`. Because of this +injected unless it itself is annotated with `@Inject`. Because of this difference, it is recommended that you annotate this method explicitly. diff --git a/docs/bugpattern/ProtocolBufferOrdinal.md b/docs/bugpattern/ProtocolBufferOrdinal.md index 6e83370d3f23..80880178aec6 100644 --- a/docs/bugpattern/ProtocolBufferOrdinal.md +++ b/docs/bugpattern/ProtocolBufferOrdinal.md @@ -13,5 +13,5 @@ You should very likely use `getNumber()` in preference to `ordinal()` in all circumstances since it's a more stable value. Note: If you're changing code that was already using ordinal(), it's likely that -getNumber() will return a different real value. Tread carefully to avoid +getNumber() will return a different real value. Treat carefully to avoid mismatches if the ordinal was persisted elsewhere. diff --git a/docs/bugpattern/RedundantOverride.md b/docs/bugpattern/RedundantOverride.md index 641ccd635719..de88b37bcbf1 100644 --- a/docs/bugpattern/RedundantOverride.md +++ b/docs/bugpattern/RedundantOverride.md @@ -1,5 +1,5 @@ An override of a method that delegates its implementation to the super method is -redudant, and can be removed. +redundant, and can be removed. For example, the `equals` method in the following class implementation can be deleted. diff --git a/docs/bugpattern/StaticAssignmentOfThrowable.md b/docs/bugpattern/StaticAssignmentOfThrowable.md index f1894d2cdf8b..ad6ea65fd108 100644 --- a/docs/bugpattern/StaticAssignmentOfThrowable.md +++ b/docs/bugpattern/StaticAssignmentOfThrowable.md @@ -1,5 +1,5 @@ The problem we're trying to prevent is unhelpful stack traces that don't contain -information about where the Exception was thrown from. This probem can sometimes +information about where the Exception was thrown from. This problem can sometimes arise when an attempt is being made to cache or reuse a Throwable (often, a particular Exception). In this case, consider whether this is really is necessary: it often isn't. Could a Throwable simply be instantiated when needed? diff --git a/docs/bugpattern/javadoc/InvalidInlineTag.md b/docs/bugpattern/javadoc/InvalidInlineTag.md index 9cba566ed685..135348ec1722 100644 --- a/docs/bugpattern/javadoc/InvalidInlineTag.md +++ b/docs/bugpattern/javadoc/InvalidInlineTag.md @@ -21,7 +21,7 @@ int twoTimes(int n) { } ``` -If the `@` symbol occurrs inside a code excerpt, the fix is to escape the code +If the `@` symbol occurs inside a code excerpt, the fix is to escape the code excerpt using `

{@code ... }
`: ```java