Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Android 2.2 compatibility #124

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package com.fasterxml.jackson.core.io;

import java.util.Arrays;

import com.fasterxml.jackson.core.SerializableString;
import com.fasterxml.jackson.core.util.ArraysCompat;

/**
* Abstract base class that defines interface for customizing character
Expand Down Expand Up @@ -66,6 +65,6 @@ public abstract class CharacterEscapes
public static int[] standardAsciiEscapesForJSON()
{
int[] esc = CharTypes.get7BitOutputEscapes();
return Arrays.copyOf(esc, esc.length);
return ArraysCompat.copyOf(esc, esc.length);
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.fasterxml.jackson.core.json;

import java.io.*;
import java.util.Arrays;

import com.fasterxml.jackson.core.*;
import com.fasterxml.jackson.core.base.ParserBase;
Expand Down Expand Up @@ -3129,7 +3128,7 @@ public static int[] growArrayBy(int[] arr, int more)
if (arr == null) {
return new int[more];
}
return Arrays.copyOf(arr, arr.length + more);
return ArraysCompat.copyOf(arr, arr.length + more);
}

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.util.Arrays;
import java.util.concurrent.atomic.AtomicReference;

import com.fasterxml.jackson.core.util.ArraysCompat;
import com.fasterxml.jackson.core.util.InternCache;

/**
Expand Down Expand Up @@ -997,7 +998,7 @@ private int findBestBucket() {
*/
private void unshareMain() {
final int[] old = _hash;
_hash = Arrays.copyOf(old, old.length);
_hash = ArraysCompat.copyOf(old, old.length);
_hashShared = false;
}

Expand All @@ -1006,20 +1007,20 @@ private void unshareCollision() {
if (old == null) {
_collList = new Bucket[INITIAL_COLLISION_LEN];
} else {
_collList = Arrays.copyOf(old, old.length);
_collList = ArraysCompat.copyOf(old, old.length);
}
_collListShared = false;
}

private void unshareNames() {
final Name[] old = _mainNames;
_mainNames = Arrays.copyOf(old, old.length);
_mainNames = ArraysCompat.copyOf(old, old.length);
_namesShared = false;
}

private void expandCollision() {
final Bucket[] old = _collList;
_collList = Arrays.copyOf(old, old.length * 2);
_collList = ArraysCompat.copyOf(old, old.length * 2);
}

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.util.Arrays;

import com.fasterxml.jackson.core.util.ArraysCompat;
import com.fasterxml.jackson.core.util.InternCache;

/**
Expand Down Expand Up @@ -548,9 +549,9 @@ public int calcHash(String key)
*/
private void copyArrays() {
final String[] oldSyms = _symbols;
_symbols = Arrays.copyOf(oldSyms, oldSyms.length);
_symbols = ArraysCompat.copyOf(oldSyms, oldSyms.length);
final Bucket[] oldBuckets = _buckets;
_buckets = Arrays.copyOf(oldBuckets, oldBuckets.length);
_buckets = ArraysCompat.copyOf(oldBuckets, oldBuckets.length);
}

/**
Expand Down
Loading