Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(127)

Unified Diff: third_party/protobuf/java/core/src/main/java/com/google/protobuf/Internal.java

Issue 2495533002: third_party/protobuf: Update to HEAD (83d681ee2c) (Closed)
Patch Set: Make chrome settings proto generated file a component Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/protobuf/java/core/src/main/java/com/google/protobuf/Internal.java
diff --git a/third_party/protobuf/java/core/src/main/java/com/google/protobuf/Internal.java b/third_party/protobuf/java/core/src/main/java/com/google/protobuf/Internal.java
index d1de375e146f07061bd4a5a56fe6cc4f43f3d15f..c234559ce3834f7b3ead8cf85839dc8bdbbb1c17 100644
--- a/third_party/protobuf/java/core/src/main/java/com/google/protobuf/Internal.java
+++ b/third_party/protobuf/java/core/src/main/java/com/google/protobuf/Internal.java
@@ -60,6 +60,16 @@ public final class Internal {
static final Charset ISO_8859_1 = Charset.forName("ISO-8859-1");
/**
+ * Throws an appropriate {@link NullPointerException} if the given objects is {@code null}.
+ */
+ static <T> T checkNotNull(T obj, String message) {
+ if (obj == null) {
+ throw new NullPointerException(message);
+ }
+ return obj;
+ }
+
+ /**
* Helper called by generated code to construct default values for string
* fields.
* <p>
@@ -611,12 +621,12 @@ public final class Internal {
int getInt(int index);
/**
- * Like {@link #add(Integer)} but more efficient in that it doesn't box the element.
+ * Like {@link #add(Object)} but more efficient in that it doesn't box the element.
*/
void addInt(int element);
/**
- * Like {@link #set(int, Integer)} but more efficient in that it doesn't box the element.
+ * Like {@link #set(int, Object)} but more efficient in that it doesn't box the element.
*/
int setInt(int index, int element);
@@ -639,12 +649,12 @@ public final class Internal {
boolean getBoolean(int index);
/**
- * Like {@link #add(Boolean)} but more efficient in that it doesn't box the element.
+ * Like {@link #add(Object)} but more efficient in that it doesn't box the element.
*/
void addBoolean(boolean element);
/**
- * Like {@link #set(int, Boolean)} but more efficient in that it doesn't box the element.
+ * Like {@link #set(int, Object)} but more efficient in that it doesn't box the element.
*/
boolean setBoolean(int index, boolean element);
@@ -667,12 +677,12 @@ public final class Internal {
long getLong(int index);
/**
- * Like {@link #add(Long)} but more efficient in that it doesn't box the element.
+ * Like {@link #add(Object)} but more efficient in that it doesn't box the element.
*/
void addLong(long element);
/**
- * Like {@link #set(int, Long)} but more efficient in that it doesn't box the element.
+ * Like {@link #set(int, Object)} but more efficient in that it doesn't box the element.
*/
long setLong(int index, long element);
@@ -695,12 +705,12 @@ public final class Internal {
double getDouble(int index);
/**
- * Like {@link #add(Double)} but more efficient in that it doesn't box the element.
+ * Like {@link #add(Object)} but more efficient in that it doesn't box the element.
*/
void addDouble(double element);
/**
- * Like {@link #set(int, Double)} but more efficient in that it doesn't box the element.
+ * Like {@link #set(int, Object)} but more efficient in that it doesn't box the element.
*/
double setDouble(int index, double element);
@@ -723,12 +733,12 @@ public final class Internal {
float getFloat(int index);
/**
- * Like {@link #add(Float)} but more efficient in that it doesn't box the element.
+ * Like {@link #add(Object)} but more efficient in that it doesn't box the element.
*/
void addFloat(float element);
/**
- * Like {@link #set(int, Float)} but more efficient in that it doesn't box the element.
+ * Like {@link #set(int, Object)} but more efficient in that it doesn't box the element.
*/
float setFloat(int index, float element);

Powered by Google App Engine
This is Rietveld 408576698