Skip to content

Commit c29ebc0

Browse files
klueverError Prone Team
authored andcommitted
More javadoc cleanup to ErrorProne checks.
PiperOrigin-RevId: 921566157
1 parent e47929c commit c29ebc0

4 files changed

Lines changed: 25 additions & 13 deletions

File tree

core/src/main/java/com/google/errorprone/bugpatterns/Finally.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,13 @@ private enum JumpType {
171171
}
172172

173173
/**
174-
* The target of a jump statement (break or continue) is (1) the enclosing loop if the jump is
175-
* unlabeled (2) the enclosing LabeledStatementTree with matching label if the jump is labeled
176-
* (3) the enclosing switch statement if the jump is a break
174+
* The target of a jump statement (break or continue) is:
175+
*
176+
* <ol>
177+
* <li>the enclosing loop if the jump is unlabeled;
178+
* <li>the enclosing LabeledStatementTree with matching label if the jump is labeled;
179+
* <li>the enclosing switch statement if the jump is a break.
180+
* </ol>
177181
*
178182
* <p>If the target of a break or continue statement is encountered before reaching a finally
179183
* block, return NO_MATCH.

core/src/main/java/com/google/errorprone/bugpatterns/NonOverridingEquals.java

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,13 @@ public class NonOverridingEquals extends BugChecker implements MethodTreeMatcher
6363
private static final String MESSAGE_BASE = "equals method doesn't override Object.equals";
6464

6565
/**
66-
* Matches any method definition that: 1) is named `equals` 2) takes a single argument of a type
67-
* other than Object 3) returns a boolean or Boolean
66+
* Matches any method definition that:
67+
*
68+
* <ol>
69+
* <li>is named {@code equals};
70+
* <li>takes a single argument of a type other than {@code Object};
71+
* <li>returns a {@code boolean} or {@code Boolean}.
72+
* </ol>
6873
*/
6974
private static final Matcher<MethodTree> MATCHER =
7075
allOf(
@@ -88,9 +93,9 @@ public class NonOverridingEquals extends BugChecker implements MethodTreeMatcher
8893
* doesn't work:
8994
*
9095
* <ul>
91-
* <li>the method is static
92-
* <li>the method is not public
93-
* <li>the method returns a boxed Boolean
96+
* <li>the method is static;
97+
* <li>the method is not public;
98+
* <li>the method returns a boxed Boolean.
9499
* </ul>
95100
*/
96101
private static final Matcher<MethodTree> noFixMatcher =

core/src/main/java/com/google/errorprone/bugpatterns/android/WakelockReleasedDangerously.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,7 @@ private boolean tryCatchesException(TryTree tryTree, Type exceptionToCatch, Visi
165165
/**
166166
* Whether the given WakeLock may throw an unexpected RuntimeException when released.
167167
*
168-
* <p>Returns true if: 1) the given WakeLock was acquired with timeout, and 2) the given WakeLock
169-
* is reference counted.
168+
* <p>Returns true if the given WakeLock was acquired with timeout and it is reference counted.
170169
*/
171170
private boolean wakelockMayThrow(Symbol wakelockSymbol, VisitorState state) {
172171
ClassTree enclosingClass = getTopLevelClass(state);

core/src/main/java/com/google/errorprone/bugpatterns/argumentselectiondefects/CreatesDuplicateCallHeuristic.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,13 @@ private static boolean anyArgumentsMatch(
6464
* Find all the other calls to {@code calledMethod} within the method (or class) which enclosed
6565
* the original call.
6666
*
67-
* <p>We are interested in two different cases: 1) where there are other calls to the method we
68-
* are calling; 2) declarations of the method we are calling (this catches the case when there is
69-
* a recursive call with the arguments correctly swapped).
67+
* <p>We are interested in two different cases:
68+
*
69+
* <ol>
70+
* <li>where there are other calls to the method we are calling
71+
* <li>declarations of the method we are calling (this catches the case when there is a
72+
* recursive call with the arguments correctly swapped).
73+
* </ol>
7074
*
7175
* @param calledMethod is the method call we are analysing for swaps
7276
* @param currentNode is the tree node the method call occurred at

0 commit comments

Comments
 (0)