Rename readData() to readPrimitiveField() in JavaNano.

pull/204/head
Jisi Liu 10 years ago
parent 7f3693184a
commit cd99c12df2
  1. 2
      javanano/src/main/java/com/google/protobuf/nano/CodedInputByteBufferNano.java
  2. 2
      javanano/src/main/java/com/google/protobuf/nano/Extension.java
  3. 4
      javanano/src/main/java/com/google/protobuf/nano/InternalNano.java

@ -640,7 +640,7 @@ public final class CodedInputByteBufferNano {
} }
// Read a primitive type. // Read a primitive type.
Object readData(int type) throws IOException { Object readPrimitiveField(int type) throws IOException {
switch (type) { switch (type) {
case InternalNano.TYPE_DOUBLE: case InternalNano.TYPE_DOUBLE:
return readDouble(); return readDouble();

@ -338,7 +338,7 @@ public class Extension<M extends ExtendableMessageNano<M>, T> {
@Override @Override
protected Object readData(CodedInputByteBufferNano input) { protected Object readData(CodedInputByteBufferNano input) {
try { try {
return input.readData(type); return input.readPrimitiveField(type);
} catch (IOException e) { } catch (IOException e) {
throw new IllegalArgumentException("Error reading extension field", e); throw new IllegalArgumentException("Error reading extension field", e);
} }

@ -421,12 +421,12 @@ public final class InternalNano {
break; break;
} }
if (tag == keyTag) { if (tag == keyTag) {
key = (K) input.readData(keyType); key = (K) input.readPrimitiveField(keyType);
} else if (tag == valueTag) { } else if (tag == valueTag) {
if (valueType == TYPE_MESSAGE) { if (valueType == TYPE_MESSAGE) {
input.readMessage((MessageNano) value); input.readMessage((MessageNano) value);
} else { } else {
value = (V) input.readData(valueType); value = (V) input.readPrimitiveField(valueType);
} }
} else { } else {
if (!input.skipField(tag)) { if (!input.skipField(tag)) {

Loading…
Cancel
Save