Skip to content

Commit

Permalink
decrement jar size
Browse files Browse the repository at this point in the history
  • Loading branch information
wenshao committed Apr 6, 2016
1 parent 12e84b5 commit 2208b96
Show file tree
Hide file tree
Showing 26 changed files with 299 additions and 1,004 deletions.
9 changes: 4 additions & 5 deletions src/main/java/com/alibaba/fastjson/JSON.java
Expand Up @@ -52,7 +52,6 @@
import com.alibaba.fastjson.serializer.ValueFilter; import com.alibaba.fastjson.serializer.ValueFilter;
import com.alibaba.fastjson.util.FieldInfo; import com.alibaba.fastjson.util.FieldInfo;
import com.alibaba.fastjson.util.IOUtils; import com.alibaba.fastjson.util.IOUtils;
import com.alibaba.fastjson.util.ThreadLocalCache;
import com.alibaba.fastjson.util.TypeUtils; import com.alibaba.fastjson.util.TypeUtils;


/** /**
Expand Down Expand Up @@ -117,7 +116,7 @@ public static Object parse(String text, int features) {
} }


public static Object parse(byte[] input, Feature... features) { public static Object parse(byte[] input, Feature... features) {
return parse(input, 0, input.length, ThreadLocalCache.getUTF8Decoder(), features); return parse(input, 0, input.length, IOUtils.getUTF8Decoder(), features);
} }


public static Object parse(byte[] input, int off, int len, CharsetDecoder charsetDecoder, Feature... features) { public static Object parse(byte[] input, int off, int len, CharsetDecoder charsetDecoder, Feature... features) {
Expand All @@ -137,7 +136,7 @@ public static Object parse(byte[] input, int off, int len, CharsetDecoder charse
charsetDecoder.reset(); charsetDecoder.reset();


int scaleLength = (int) (len * (double) charsetDecoder.maxCharsPerByte()); int scaleLength = (int) (len * (double) charsetDecoder.maxCharsPerByte());
char[] chars = ThreadLocalCache.getChars(scaleLength); char[] chars = IOUtils.getChars(scaleLength);


ByteBuffer byteBuf = ByteBuffer.wrap(input, off, len); ByteBuffer byteBuf = ByteBuffer.wrap(input, off, len);
CharBuffer charBuf = CharBuffer.wrap(chars); CharBuffer charBuf = CharBuffer.wrap(chars);
Expand Down Expand Up @@ -260,7 +259,7 @@ public static <T> T parseObject(String input, Type clazz, ParserConfig config, P


@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public static <T> T parseObject(byte[] input, Type clazz, Feature... features) { public static <T> T parseObject(byte[] input, Type clazz, Feature... features) {
return (T) parseObject(input, 0, input.length, ThreadLocalCache.getUTF8Decoder(), clazz, features); return (T) parseObject(input, 0, input.length, IOUtils.getUTF8Decoder(), clazz, features);
} }


@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
Expand All @@ -269,7 +268,7 @@ public static <T> T parseObject(byte[] input, int off, int len, CharsetDecoder c
charsetDecoder.reset(); charsetDecoder.reset();


int scaleLength = (int) (len * (double) charsetDecoder.maxCharsPerByte()); int scaleLength = (int) (len * (double) charsetDecoder.maxCharsPerByte());
char[] chars = ThreadLocalCache.getChars(scaleLength); char[] chars = IOUtils.getChars(scaleLength);


ByteBuffer byteBuf = ByteBuffer.wrap(input, off, len); ByteBuffer byteBuf = ByteBuffer.wrap(input, off, len);
CharBuffer charByte = CharBuffer.wrap(chars); CharBuffer charByte = CharBuffer.wrap(chars);
Expand Down
12 changes: 0 additions & 12 deletions src/main/java/com/alibaba/fastjson/asm/ASMException.java

This file was deleted.

0 comments on commit 2208b96

Please sign in to comment.