Skip to content

Commit ca9601e

Browse files
committed
renamed package of PortedImmutableEntry class: org.msgpack.util to org.msgpack.util.android
1 parent 88b6823 commit ca9601e

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

src/main/java/org/msgpack/type/SequentialMapValueImpl.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
import java.util.NoSuchElementException;
2828
import java.io.IOException;
2929
import org.msgpack.packer.Packer;
30-
import org.msgpack.util.PortedImmutableEntry;
30+
import org.msgpack.util.android.PortedImmutableEntry;
3131

3232
class SequentialMapValueImpl extends AbstractMapValue {
3333
private static SequentialMapValueImpl emptyInstance = new SequentialMapValueImpl(new Value[0], true);
@@ -117,13 +117,20 @@ public Map.Entry<Value, Value> next() {
117117
if (pos >= array.length) {
118118
throw new NoSuchElementException(); // TODO message
119119
}
120-
120+
121121
Value key = array[pos];
122122
Value value = array[pos + 1];
123+
/**
124+
* @see https://github.com/msgpack/msgpack-java/pull/27
125+
*
126+
* msgpack-java was crashed on Android 2.2 or below because
127+
* the method calls java.util.AbstractMap$SimpleImmutableEntry
128+
* that doesn't exist in Android 2.2 or below.
129+
*/
123130
Map.Entry<Value, Value> pair = hasDefaultImmutableEntry ?
124131
new AbstractMap.SimpleImmutableEntry<Value, Value>(key, value) :
125132
new PortedImmutableEntry<Value, Value>(key, value);
126-
133+
127134
pos += 2;
128135
return pair;
129136
}

src/main/java/org/msgpack/util/PortedImmutableEntry.java renamed to src/main/java/org/msgpack/util/android/PortedImmutableEntry.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* limitations under the License.
1616
*/
1717

18-
package org.msgpack.util;
18+
package org.msgpack.util.android;
1919

2020
import java.io.Serializable;
2121
import java.util.Map;

0 commit comments

Comments
 (0)