diff options
Diffstat (limited to 'java/src/main/java/com/google/protobuf/UnknownFieldSet.java')
-rw-r--r-- | java/src/main/java/com/google/protobuf/UnknownFieldSet.java | 48 |
1 files changed, 3 insertions, 45 deletions
diff --git a/java/src/main/java/com/google/protobuf/UnknownFieldSet.java b/java/src/main/java/com/google/protobuf/UnknownFieldSet.java index 99de373..26a15d0 100644 --- a/java/src/main/java/com/google/protobuf/UnknownFieldSet.java +++ b/java/src/main/java/com/google/protobuf/UnknownFieldSet.java @@ -1,6 +1,6 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ +// http://code.google.com/p/protobuf/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -46,7 +46,7 @@ import java.util.TreeMap; * {@code UnknownFieldSet} is used to keep track of fields which were seen when * parsing a protocol message but whose field numbers or types are unrecognized. * This most frequently occurs when new fields are added to a message type - * and then messages containing those fields are read by old software that was + * and then messages containing those feilds are read by old software that was * compiled before the new types were added. * * <p>Every {@link Message} contains an {@code UnknownFieldSet} (and every @@ -91,7 +91,6 @@ public final class UnknownFieldSet implements MessageLite { } private Map<Integer, Field> fields; - @Override public boolean equals(final Object other) { if (this == other) { @@ -368,22 +367,6 @@ public final class UnknownFieldSet implements MessageLite { reinitialize(); return this; } - - /** Clear fields from the set with a given field number. */ - public Builder clearField(final int number) { - if (number == 0) { - throw new IllegalArgumentException("Zero is not a valid field number."); - } - if (lastField != null && lastFieldNumber == number) { - // Discard this. - lastField = null; - lastFieldNumber = 0; - } - if (fields.containsKey(number)) { - fields.remove(number); - } - return this; - } /** * Merge the fields from {@code other} into this set. If a field number @@ -485,7 +468,7 @@ public final class UnknownFieldSet implements MessageLite { /** * Parse a single field from {@code input} and merge it into this set. * @param tag The field's tag number, which was already parsed. - * @return {@code false} if the tag is an end group tag. + * @return {@code false} if the tag is an engroup tag. */ public boolean mergeFieldFrom(final int tag, final CodedInputStream input) throws IOException { @@ -967,29 +950,4 @@ public final class UnknownFieldSet implements MessageLite { } } } - - /** - * Parser to implement MessageLite interface. - */ - public static final class Parser extends AbstractParser<UnknownFieldSet> { - public UnknownFieldSet parsePartialFrom( - CodedInputStream input, ExtensionRegistryLite extensionRegistry) - throws InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input); - } catch (InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (IOException e) { - throw new InvalidProtocolBufferException(e.getMessage()) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - } - - private static final Parser PARSER = new Parser(); - public final Parser getParserForType() { - return PARSER; - } } |