, Serializable {
* Empty {@code ByteString}.
*/
public static final ByteString EMPTY = new LiteralByteString(Internal.EMPTY_BYTE_ARRAY);
-
- /**
+
+ /**
* An interface to efficiently copy {@code byte[]}.
- *
- * One of the noticable costs of copying a byte[] into a new array using
- * {@code System.arraycopy} is nullification of a new buffer before the copy. It has been shown
+ *
+ *
One of the noticeable costs of copying a byte[] into a new array using
+ * {@code System.arraycopy} is nullification of a new buffer before the copy. It has been shown
* the Hotspot VM is capable to intrisicfy {@code Arrays.copyOfRange} operation to avoid this
* expensive nullification and provide substantial performance gain. Unfortunately this does not
* hold on Android runtimes and could make the copy slightly slower due to additional code in
* the {@code Arrays.copyOfRange}. Thus we provide two different implementation for array copier
- * for Hotspot and Android runtimes.
+ * for Hotspot and Android runtimes.
*/
private interface ByteArrayCopier {
/**
@@ -105,7 +105,7 @@ public abstract class ByteString implements Iterable, Serializable {
*/
byte[] copyFrom(byte[] bytes, int offset, int size);
}
-
+
/** Implementation of {@code ByteArrayCopier} which uses {@link System#arraycopy}. */
private static final class SystemByteArrayCopier implements ByteArrayCopier {
@Override
@@ -115,7 +115,7 @@ public abstract class ByteString implements Iterable, Serializable {
return copy;
}
}
-
+
/** Implementation of {@code ByteArrayCopier} which uses {@link Arrays#copyOfRange}. */
private static final class ArraysByteArrayCopier implements ByteArrayCopier {
@Override
@@ -123,7 +123,7 @@ public abstract class ByteString implements Iterable, Serializable {
return Arrays.copyOfRange(bytes, offset, offset + size);
}
}
-
+
private static final ByteArrayCopier byteArrayCopier;
static {
boolean isAndroid = true;
@@ -132,7 +132,7 @@ public abstract class ByteString implements Iterable, Serializable {
} catch (ClassNotFoundException e) {
isAndroid = false;
}
-
+
byteArrayCopier = isAndroid ? new SystemByteArrayCopier() : new ArraysByteArrayCopier();
}
@@ -309,7 +309,7 @@ public abstract class ByteString implements Iterable, Serializable {
public static ByteString copyFrom(byte[] bytes) {
return copyFrom(bytes, 0, bytes.length);
}
-
+
/**
* Wraps the given bytes into a {@code ByteString}. Intended for internal only
* usage to force a classload of ByteString before LiteralByteString.
@@ -402,7 +402,7 @@ public abstract class ByteString implements Iterable, Serializable {
* immutable tree of byte arrays ("chunks") of the stream data. The
* first chunk is small, with subsequent chunks each being double
* the size, up to 8K.
- *
+ *
* Each byte read from the input stream will be copied twice to ensure
* that the resulting ByteString is truly immutable.
*
@@ -1226,7 +1226,7 @@ public abstract class ByteString implements Iterable, Serializable {
return String.format("",
Integer.toHexString(System.identityHashCode(this)), size());
}
-
+
/**
* This class implements a {@link com.google.protobuf.ByteString} backed by a
* single array of bytes, contiguous in memory. It supports substring by
@@ -1450,7 +1450,7 @@ public abstract class ByteString implements Iterable, Serializable {
return 0;
}
}
-
+
/**
* This class is used to represent the substring of a {@link ByteString} over a
* single byte array. In terms of the public API of {@link ByteString}, you end
diff --git a/java/core/src/test/java/com/google/protobuf/LiteEqualsAndHashTest.java b/java/core/src/test/java/com/google/protobuf/LiteEqualsAndHashTest.java
index 29e8d875..4764ca1b 100644
--- a/java/core/src/test/java/com/google/protobuf/LiteEqualsAndHashTest.java
+++ b/java/core/src/test/java/com/google/protobuf/LiteEqualsAndHashTest.java
@@ -55,7 +55,7 @@ public class LiteEqualsAndHashTest extends TestCase {
// correctly when linked only against the lite library.
// We do however do some basic testing to make sure that equals is actually
- // overriden to test for value equality rather than simple object equality.
+ // overridden to test for value equality rather than simple object equality.
// Check that two identical objs are equal.
Foo foo1a = Foo.newBuilder()
diff --git a/javanano/src/main/java/com/google/protobuf/nano/MessageNanoPrinter.java b/javanano/src/main/java/com/google/protobuf/nano/MessageNanoPrinter.java
index d9500bb9..5f329f02 100644
--- a/javanano/src/main/java/com/google/protobuf/nano/MessageNanoPrinter.java
+++ b/javanano/src/main/java/com/google/protobuf/nano/MessageNanoPrinter.java
@@ -156,7 +156,7 @@ public final class MessageNanoPrinter {
} catch (NoSuchMethodException e) {
continue;
}
- // If hazzer does't exist or returns false, no need to continue
+ // If hazzer doesn't exist or returns false, no need to continue
if (!(Boolean) hazzer.invoke(object)) {
continue;
}
diff --git a/php/ext/google/protobuf/upb.h b/php/ext/google/protobuf/upb.h
index 078e2a28..073faf41 100644
--- a/php/ext/google/protobuf/upb.h
+++ b/php/ext/google/protobuf/upb.h
@@ -54,7 +54,7 @@
** store pointers or integers of at least 32 bits (upb isn't really useful on
** systems where sizeof(void*) < 4).
**
-** The table must be homogenous (all values of the same type). In debug
+** The table must be homogeneous (all values of the same type). In debug
** mode, we check this on insert and lookup.
*/
diff --git a/python/google/protobuf/descriptor.py b/python/google/protobuf/descriptor.py
index 2eba1232..873af306 100755
--- a/python/google/protobuf/descriptor.py
+++ b/python/google/protobuf/descriptor.py
@@ -349,7 +349,7 @@ class Descriptor(_NestedDescriptorBase):
Args:
proto: An empty descriptor_pb2.DescriptorProto.
"""
- # This function is overriden to give a better doc comment.
+ # This function is overridden to give a better doc comment.
super(Descriptor, self).CopyToProto(proto)
@@ -626,7 +626,7 @@ class EnumDescriptor(_NestedDescriptorBase):
Args:
proto: An empty descriptor_pb2.EnumDescriptorProto.
"""
- # This function is overriden to give a better doc comment.
+ # This function is overridden to give a better doc comment.
super(EnumDescriptor, self).CopyToProto(proto)
@@ -747,7 +747,7 @@ class ServiceDescriptor(_NestedDescriptorBase):
Args:
proto: An empty descriptor_pb2.ServiceDescriptorProto.
"""
- # This function is overriden to give a better doc comment.
+ # This function is overridden to give a better doc comment.
super(ServiceDescriptor, self).CopyToProto(proto)
diff --git a/python/google/protobuf/internal/_parameterized.py b/python/google/protobuf/internal/_parameterized.py
index dea3f199..23a78f03 100755
--- a/python/google/protobuf/internal/_parameterized.py
+++ b/python/google/protobuf/internal/_parameterized.py
@@ -347,7 +347,7 @@ class TestGeneratorMetaclass(type):
iterable conforms to the test pattern, the injected methods will be picked
up as tests by the unittest framework.
- In general, it is supposed to be used in conjuction with the
+ In general, it is supposed to be used in conjunction with the
Parameters decorator.
"""
diff --git a/ruby/ext/google/protobuf_c/upb.h b/ruby/ext/google/protobuf_c/upb.h
index 2faf74e5..e8b683bd 100644
--- a/ruby/ext/google/protobuf_c/upb.h
+++ b/ruby/ext/google/protobuf_c/upb.h
@@ -55,7 +55,7 @@
** store pointers or integers of at least 32 bits (upb isn't really useful on
** systems where sizeof(void*) < 4).
**
-** The table must be homogenous (all values of the same type). In debug
+** The table must be homogeneous (all values of the same type). In debug
** mode, we check this on insert and lookup.
*/
diff --git a/ruby/lib/google/protobuf/repeated_field.rb b/ruby/lib/google/protobuf/repeated_field.rb
index 0ad2060d..831e0320 100644
--- a/ruby/lib/google/protobuf/repeated_field.rb
+++ b/ruby/lib/google/protobuf/repeated_field.rb
@@ -173,7 +173,7 @@ module Google
external_enumerator.each_with_index do |val, i|
result = yield(val)
results << result
- #nil means no change occured from yield; usually occurs when #to_a is called
+ #nil means no change occurred from yield; usually occurs when #to_a is called
if result
repeated_field[i] = result if result != val
end
diff --git a/src/google/protobuf/compiler/command_line_interface.cc b/src/google/protobuf/compiler/command_line_interface.cc
index df6f8afc..435a7b8d 100644
--- a/src/google/protobuf/compiler/command_line_interface.cc
+++ b/src/google/protobuf/compiler/command_line_interface.cc
@@ -614,7 +614,7 @@ CommandLineInterface::MemoryOutputStream::~MemoryOutputStream() {
} else {
// This was an OpenForInsert().
- // If the data doens't end with a clean line break, add one.
+ // If the data doesn't end with a clean line break, add one.
if (!data_.empty() && data_[data_.size() - 1] != '\n') {
data_.push_back('\n');
}
diff --git a/src/google/protobuf/compiler/cpp/cpp_message.h b/src/google/protobuf/compiler/cpp/cpp_message.h
index 31223e13..b1e3fe21 100644
--- a/src/google/protobuf/compiler/cpp/cpp_message.h
+++ b/src/google/protobuf/compiler/cpp/cpp_message.h
@@ -66,7 +66,7 @@ class MessageGenerator {
// Header stuff.
- // Return names for foward declarations of this class and all its nested
+ // Return names for forward declarations of this class and all its nested
// types. A given key in {class,enum}_names will map from a class name to the
// descriptor that was responsible for its inclusion in the map. This can be
// used to associate the descriptor with the code generated for it.
diff --git a/src/google/protobuf/compiler/java/java_helpers.h b/src/google/protobuf/compiler/java/java_helpers.h
index 5316d2f9..829ec3d7 100644
--- a/src/google/protobuf/compiler/java/java_helpers.h
+++ b/src/google/protobuf/compiler/java/java_helpers.h
@@ -243,7 +243,7 @@ inline bool HasGenericServices(const FileDescriptor *file, bool enforce_lite) {
}
inline bool IsLazy(const FieldDescriptor* descriptor, bool enforce_lite) {
- // Currently, the proto-lite version suports lazy field.
+ // Currently, the proto-lite version supports lazy field.
// TODO(niwasaki): Support lazy fields also for other proto runtimes.
if (HasDescriptorMethods(descriptor->file(), enforce_lite)) {
return false;
diff --git a/src/google/protobuf/compiler/java/java_string_field.cc b/src/google/protobuf/compiler/java/java_string_field.cc
index b74c7447..e1e5496a 100644
--- a/src/google/protobuf/compiler/java/java_string_field.cc
+++ b/src/google/protobuf/compiler/java/java_string_field.cc
@@ -715,7 +715,7 @@ GenerateInterfaceMembers(io::Printer* printer) const {
// NOTE: the same method in the implementation class actually returns
// com.google.protobuf.ProtocolStringList (a subclass of List). It's
// changed between protobuf 2.5.0 release and protobuf 2.6.1 release.
- // To retain binary compatibilty with both 2.5.0 and 2.6.1 generated
+ // To retain binary compatibility with both 2.5.0 and 2.6.1 generated
// code, we make this interface method return List so both methods
// with different return types exist in the compiled byte code.
"$deprecation$java.util.List\n"
diff --git a/src/google/protobuf/compiler/js/js_generator.cc b/src/google/protobuf/compiler/js/js_generator.cc
index f5185ab1..8a2633d7 100755
--- a/src/google/protobuf/compiler/js/js_generator.cc
+++ b/src/google/protobuf/compiler/js/js_generator.cc
@@ -151,7 +151,7 @@ string StripProto(const string& filename) {
return StripSuffixString(filename, suffix);
}
-// Given a filename like foo/bar/baz.proto, returns the correspoding JavaScript
+// Given a filename like foo/bar/baz.proto, returns the corresponding JavaScript
// file foo/bar/baz.js.
string GetJSFilename(const string& filename) {
return StripProto(filename) + "_pb.js";
diff --git a/src/google/protobuf/compiler/objectivec/objectivec_field.cc b/src/google/protobuf/compiler/objectivec/objectivec_field.cc
index 66cb4a16..812b4a1c 100644
--- a/src/google/protobuf/compiler/objectivec/objectivec_field.cc
+++ b/src/google/protobuf/compiler/objectivec/objectivec_field.cc
@@ -228,7 +228,7 @@ int FieldGenerator::ExtraRuntimeHasBitsNeeded(void) const {
void FieldGenerator::SetExtraRuntimeHasBitsBase(int index_base) {
// NOTE: src/google/protobuf/compiler/plugin.cc makes use of cerr for some
// error cases, so it seems to be ok to use as a back door for errors.
- cerr << "Error: should have overriden SetExtraRuntimeHasBitsBase()." << endl;
+ cerr << "Error: should have overridden SetExtraRuntimeHasBitsBase()." << endl;
cerr.flush();
abort();
}
diff --git a/src/google/protobuf/compiler/parser.h b/src/google/protobuf/compiler/parser.h
index 2c561c23..0f80e78b 100644
--- a/src/google/protobuf/compiler/parser.h
+++ b/src/google/protobuf/compiler/parser.h
@@ -71,7 +71,7 @@ class LIBPROTOBUF_EXPORT Parser {
// it. Returns true if no errors occurred, false otherwise.
bool Parse(io::Tokenizer* input, FileDescriptorProto* file);
- // Optional fetaures:
+ // Optional features:
// DEPRECATED: New code should use the SourceCodeInfo embedded in the
// FileDescriptorProto.
diff --git a/src/google/protobuf/generated_message_reflection.cc b/src/google/protobuf/generated_message_reflection.cc
index 347bac5a..d1f7b5ca 100644
--- a/src/google/protobuf/generated_message_reflection.cc
+++ b/src/google/protobuf/generated_message_reflection.cc
@@ -2126,7 +2126,7 @@ inline void GeneratedMessageReflection::ClearOneofField(
inline void GeneratedMessageReflection::ClearOneof(
Message* message, const OneofDescriptor* oneof_descriptor) const {
// TODO(jieluo): Consider to cache the unused object instead of deleting
- // it. It will be much faster if an aplication switches a lot from
+ // it. It will be much faster if an application switches a lot from
// a few oneof fields. Time/space tradeoff
uint32 oneof_case = GetOneofCase(*message, oneof_descriptor);
if (oneof_case > 0) {
diff --git a/src/google/protobuf/io/tokenizer.h b/src/google/protobuf/io/tokenizer.h
index 64ee7d84..77a873bc 100644
--- a/src/google/protobuf/io/tokenizer.h
+++ b/src/google/protobuf/io/tokenizer.h
@@ -329,7 +329,7 @@ class LIBPROTOBUF_EXPORT Tokenizer {
// depending on what was read. This needs to know if the first
// character was a zero in order to correctly recognize hex and octal
// numbers.
- // It also needs to know if the first characted was a . to parse floating
+ // It also needs to know if the first character was a . to parse floating
// point correctly.
TokenType ConsumeNumber(bool started_with_zero, bool started_with_dot);
diff --git a/src/google/protobuf/map_entry.h b/src/google/protobuf/map_entry.h
index 801e7522..e87eda64 100644
--- a/src/google/protobuf/map_entry.h
+++ b/src/google/protobuf/map_entry.h
@@ -83,7 +83,7 @@ class LIBPROTOBUF_EXPORT MapEntryBase : public Message {
// reflection, its in-memory type is the same as generated message with the same
// fields. However, in order to decide the in-memory type of key/value, we need
// to know both their cpp type in generated api and proto type. In
-// implmentation, all in-memory types have related wire format functions to
+// implementation, all in-memory types have related wire format functions to
// support except ArenaStringPtr. Therefore, we need to define another type with
// supporting wire format functions. Since this type is only used as return type
// of MapEntry accessors, it's named MapEntry accessor type.
diff --git a/src/google/protobuf/map_field.h b/src/google/protobuf/map_field.h
index 4b46f3aa..d6af8532 100644
--- a/src/google/protobuf/map_field.h
+++ b/src/google/protobuf/map_field.h
@@ -54,7 +54,7 @@ class ContendedMapCleanTest;
class GeneratedMessageReflection;
class MapFieldAccessor;
-// This class provides accesss to map field using reflection, which is the same
+// This class provides access to map field using reflection, which is the same
// as those provided for RepeatedPtrField. It is used for internal
// reflection implentation only. Users should never use this directly.
class LIBPROTOBUF_EXPORT MapFieldBase {
@@ -208,7 +208,7 @@ class TypeDefinedMapFieldBase : public MapFieldBase {
virtual void SetMapIteratorValue(MapIterator* map_iter) const = 0;
};
-// This class provides accesss to map field using generated api. It is used for
+// This class provides access to map field using generated api. It is used for
// internal generated message implentation only. Users should never use this
// directly.
template map_field = 1;
}
diff --git a/src/google/protobuf/map_test.cc b/src/google/protobuf/map_test.cc
index dccb31ca..cdd1ccd5 100644
--- a/src/google/protobuf/map_test.cc
+++ b/src/google/protobuf/map_test.cc
@@ -502,7 +502,7 @@ static void StressTestIterators(int n, bool test_old_style_proto2_maps) {
// Test old iterator vs new iterator, with table modification in between.
TestOldVersusNewIterator