Commit 725326f1 authored by Feng Xiao's avatar Feng Xiao

Update verification methods' names.

parent 345d49a5
...@@ -490,7 +490,7 @@ public final class DynamicMessage extends AbstractMessage { ...@@ -490,7 +490,7 @@ public final class DynamicMessage extends AbstractMessage {
// because of some internal features we support. Should figure it out // because of some internal features we support. Should figure it out
// and move this check to a more appropriate place. // and move this check to a more appropriate place.
if (field.getType() == FieldDescriptor.Type.ENUM) { if (field.getType() == FieldDescriptor.Type.ENUM) {
verifyEnumValue(field, value); ensureEnumValueDescriptor(field, value);
} }
OneofDescriptor oneofDescriptor = field.getContainingOneof(); OneofDescriptor oneofDescriptor = field.getContainingOneof();
if (oneofDescriptor != null) { if (oneofDescriptor != null) {
...@@ -578,8 +578,9 @@ public final class DynamicMessage extends AbstractMessage { ...@@ -578,8 +578,9 @@ public final class DynamicMessage extends AbstractMessage {
} }
} }
/** Verifies that the value is EnumValueDescriptor and matchs Enum Type. */ /** Verifies that the value is EnumValueDescriptor and matches Enum Type. */
private void verifySingleEnumValue(FieldDescriptor field, Object value) { private void ensureSingularEnumValueDescriptor(
FieldDescriptor field, Object value) {
if (value == null) { if (value == null) {
throw new NullPointerException(); throw new NullPointerException();
} }
...@@ -594,13 +595,14 @@ public final class DynamicMessage extends AbstractMessage { ...@@ -594,13 +595,14 @@ public final class DynamicMessage extends AbstractMessage {
} }
/** Verifies the value for an enum field. */ /** Verifies the value for an enum field. */
private void verifyEnumValue(FieldDescriptor field, Object value) { private void ensureEnumValueDescriptor(
FieldDescriptor field, Object value) {
if (field.isRepeated()) { if (field.isRepeated()) {
for (Object item : (List) value) { for (Object item : (List) value) {
verifySingleEnumValue(field, item); ensureSingularEnumValueDescriptor(field, item);
} }
} else { } else {
verifySingleEnumValue(field, value); ensureSingularEnumValueDescriptor(field, value);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment