aboutsummaryrefslogtreecommitdiff
path: root/java/src/main/java/com/google/protobuf/Internal.java
diff options
context:
space:
mode:
authorTamir Duberstein <tamird@gmail.com>2015-03-31 10:29:58 -0700
committerTamir Duberstein <tamird@gmail.com>2015-04-02 14:48:43 -0700
commit7139d1eff739682a088ea2c2dbdfef2f108321f8 (patch)
treeebb7884189b38ca95d26bc911f22ef1222170eb9 /java/src/main/java/com/google/protobuf/Internal.java
parent8d9e51cf4e228c332d0a31dd1845d32b71d54e93 (diff)
downloadprotobuf-7139d1eff739682a088ea2c2dbdfef2f108321f8.tar.gz
protobuf-7139d1eff739682a088ea2c2dbdfef2f108321f8.tar.bz2
protobuf-7139d1eff739682a088ea2c2dbdfef2f108321f8.zip
Whitespace
Diffstat (limited to 'java/src/main/java/com/google/protobuf/Internal.java')
-rw-r--r--java/src/main/java/com/google/protobuf/Internal.java50
1 files changed, 25 insertions, 25 deletions
diff --git a/java/src/main/java/com/google/protobuf/Internal.java b/java/src/main/java/com/google/protobuf/Internal.java
index 5a0de6d1..b9a8a994 100644
--- a/java/src/main/java/com/google/protobuf/Internal.java
+++ b/java/src/main/java/com/google/protobuf/Internal.java
@@ -112,7 +112,7 @@ public class Internal {
* Helper called by generated code to construct default values for bytes
* fields.
* <p>
- * This is like {@link #bytesDefaultValue}, but returns a byte array.
+ * This is like {@link #bytesDefaultValue}, but returns a byte array.
*/
public static byte[] byteArrayDefaultValue(String bytes) {
try {
@@ -129,7 +129,7 @@ public class Internal {
* Helper called by generated code to construct default values for bytes
* fields.
* <p>
- * This is like {@link #bytesDefaultValue}, but returns a ByteBuffer.
+ * This is like {@link #bytesDefaultValue}, but returns a ByteBuffer.
*/
public static ByteBuffer byteBufferDefaultValue(String bytes) {
return ByteBuffer.wrap(byteArrayDefaultValue(bytes));
@@ -185,7 +185,7 @@ public class Internal {
public static boolean isValidUtf8(ByteString byteString) {
return byteString.isValidUtf8();
}
-
+
/**
* Like {@link #isValidUtf8(ByteString)} but for byte arrays.
*/
@@ -203,7 +203,7 @@ public class Internal {
throw new RuntimeException("UTF-8 not supported?", e);
}
}
-
+
/**
* Helper method to convert a byte array to a string using UTF-8 encoding.
*/
@@ -274,7 +274,7 @@ public class Internal {
}
return hash;
}
-
+
/**
* Helper method for implementing {@link Message#equals(Object)} for bytes field.
*/
@@ -298,7 +298,7 @@ public class Internal {
}
return hash;
}
-
+
/**
* Helper method for implementing {@link Message#hashCode()} for bytes field.
*/
@@ -309,7 +309,7 @@ public class Internal {
// based hashCode() method.
return LiteralByteString.hashCode(bytes);
}
-
+
/**
* Helper method for implementing {@link Message#equals(Object)} for bytes
* field.
@@ -322,7 +322,7 @@ public class Internal {
// compare all the content.
return a.duplicate().clear().equals(b.duplicate().clear());
}
-
+
/**
* Helper method for implementing {@link Message#equals(Object)} for bytes
* field.
@@ -351,9 +351,9 @@ public class Internal {
}
return hash;
}
-
+
private static final int DEFAULT_BUFFER_SIZE = 4096;
-
+
/**
* Helper method for implementing {@link Message#hashCode()} for bytes
* field.
@@ -382,18 +382,18 @@ public class Internal {
return h == 0 ? 1 : h;
}
}
-
+
/**
* An empty byte array constant used in generated code.
*/
public static final byte[] EMPTY_BYTE_ARRAY = new byte[0];
-
+
/**
* An empty byte array constant used in generated code.
*/
public static final ByteBuffer EMPTY_BYTE_BUFFER =
ByteBuffer.wrap(EMPTY_BYTE_ARRAY);
-
+
/** An empty coded input stream constant used in generated code. */
public static final CodedInputStream EMPTY_CODED_INPUT_STREAM =
CodedInputStream.newInstance(EMPTY_BYTE_ARRAY);
@@ -458,13 +458,13 @@ public class Internal {
private final Map<K, RealValue> realMap;
private final Converter<RealValue, V> valueConverter;
-
+
public MapAdapter(Map<K, RealValue> realMap,
Converter<RealValue, V> valueConverter) {
this.realMap = realMap;
this.valueConverter = valueConverter;
}
-
+
@SuppressWarnings("unchecked")
@Override
public V get(Object key) {
@@ -474,7 +474,7 @@ public class Internal {
}
return valueConverter.doForward(result);
}
-
+
@Override
public V put(K key, V value) {
RealValue oldValue = realMap.put(key, valueConverter.doBackward(value));
@@ -488,13 +488,13 @@ public class Internal {
public Set<java.util.Map.Entry<K, V>> entrySet() {
return new SetAdapter(realMap.entrySet());
}
-
+
private class SetAdapter extends AbstractSet<Map.Entry<K, V>> {
private final Set<Map.Entry<K, RealValue>> realSet;
public SetAdapter(Set<Map.Entry<K, RealValue>> realSet) {
this.realSet = realSet;
}
-
+
@Override
public Iterator<java.util.Map.Entry<K, V>> iterator() {
return new IteratorAdapter(realSet.iterator());
@@ -503,17 +503,17 @@ public class Internal {
@Override
public int size() {
return realSet.size();
- }
+ }
}
-
+
private class IteratorAdapter implements Iterator<Map.Entry<K, V>> {
private final Iterator<Map.Entry<K, RealValue>> realIterator;
-
+
public IteratorAdapter(
Iterator<Map.Entry<K, RealValue>> realIterator) {
this.realIterator = realIterator;
}
-
+
@Override
public boolean hasNext() {
return realIterator.hasNext();
@@ -529,14 +529,14 @@ public class Internal {
realIterator.remove();
}
}
-
+
private class EntryAdapter implements Map.Entry<K, V> {
private final Map.Entry<K, RealValue> realEntry;
-
+
public EntryAdapter(Map.Entry<K, RealValue> realEntry) {
this.realEntry = realEntry;
}
-
+
@Override
public K getKey() {
return realEntry.getKey();