Skip to content

Commit 0c70b05

Browse files
authored
Update 16-Validating-Your-Code.md
1 parent 8f83875 commit 0c70b05

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/book/16-Validating-Your-Code.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -905,13 +905,13 @@ public class NonNullConstruction {
905905
}
906906
```
907907

908-
**checkArgument()** 接受布尔表达式来对参数进行更具体的测试, 失败时抛出 **IllegalArgumentException****checkState()**用于测试对象的状态(例如,不变性检查),而不是检查参数,并在失败时抛出 **IllegalStateException**
908+
**checkArgument()** 接受布尔表达式来对参数进行更具体的测试, 失败时抛出 **IllegalArgumentException****checkState()** 用于测试对象的状态(例如,不变性检查),而不是检查参数,并在失败时抛出 **IllegalStateException**
909909

910-
最后三个方法在失败时抛出 **IndexOutOfBoundsException****checkElementIndex**() 确保其第一个参数是列表、字符串或数组的有效元素索引,其大小由第二个参数指定。**checkPositionIndex()**确保它的第一个参数在 0 到第二个参数(包括第二个参数)的范围内。**checkPositionIndexes()** 检查 **[first_arg, second_arg]** 是一个列表的有效子列表,由第三个参数指定大小的字符串或数组。
910+
最后三个方法在失败时抛出 **IndexOutOfBoundsException****checkElementIndex**() 确保其第一个参数是列表、字符串或数组的有效元素索引,其大小由第二个参数指定。**checkPositionIndex()** 确保它的第一个参数在 0 到第二个参数(包括第二个参数)的范围内。 **checkPositionIndexes()** 检查 **[first_arg, second_arg]** 是一个列表的有效子列表,由第三个参数指定大小的字符串或数组。
911911

912912
所有Guava前置条件对于基本类型和对象都有必要的重载。
913913

914-
<!-- Test-Driven Development -->
914+
<!-- Test-Driven Development -->
915915

916916
## 测试驱动开发
917917

0 commit comments

Comments
 (0)