File tree Expand file tree Collapse file tree 4 files changed +10
-15
lines changed
src/main/java/org/msgpack Expand file tree Collapse file tree 4 files changed +10
-15
lines changed Original file line number Diff line number Diff line change 1919
2020import java .io .InputStream ;
2121import java .io .OutputStream ;
22- import java .io .IOException ;
2322import java .nio .ByteBuffer ;
24- import org .msgpack .template .Template ;
25- import org .msgpack .template .TemplateRegistry ;
2623import org .msgpack .packer .Packer ;
2724import org .msgpack .packer .BufferPacker ;
2825import org .msgpack .packer .JSONPacker ;
3128import org .msgpack .unpacker .BufferUnpacker ;
3229import org .msgpack .unpacker .JSONUnpacker ;
3330import org .msgpack .unpacker .JSONBufferUnpacker ;
34- import org .msgpack .type .Value ;
3531
3632
3733public class JSON extends MessagePack {
Original file line number Diff line number Diff line change 1717//
1818package org .msgpack ;
1919
20+
21+ @ SuppressWarnings ("serial" )
2022public class MessageTypeException extends RuntimeException {
2123 public MessageTypeException () {
2224 super ();
Original file line number Diff line number Diff line change 1717//
1818package org .msgpack .packer ;
1919
20- import java .math .BigInteger ;
2120import java .io .IOException ;
22- import java .nio .ByteBuffer ;
2321import org .msgpack .type .Value ;
2422import org .msgpack .MessagePack ;
2523import org .msgpack .template .Template ;
@@ -45,7 +43,6 @@ public void writeMapEnd() throws IOException {
4543 writeMapEnd (true );
4644 }
4745
48-
4946 public Packer write (Object o ) throws IOException {
5047 Template tmpl = msgpack .lookup (o .getClass ());
5148 tmpl .write (this , o );
Original file line number Diff line number Diff line change 2626
2727public class TemplateBuilderChain {
2828
29+ private static boolean enableDynamicCodeGeneration (){
30+ try {
31+ return !System .getProperty ("java.vm.name" ).equals ("Dalvik" );
32+ } catch (Exception e ) {
33+ return true ;
34+ }
35+ }
36+
2937 protected List <TemplateBuilder > templateBuilders ;
3038
3139 public TemplateBuilderChain () {
@@ -52,14 +60,6 @@ public void init(TemplateRegistry registry) {
5260 }
5361 }
5462
55- private static boolean enableDynamicCodeGeneration (){
56- try {
57- return !System .getProperty ("java.vm.name" ).equals ("Dalvik" );
58- } catch (Exception e ) {
59- return true ;
60- }
61- }
62-
6363 public TemplateBuilder select (Type targetType , boolean hasAnnotation ) {
6464 for (TemplateBuilder tb : templateBuilders ) {
6565 if (tb .matchType (targetType , hasAnnotation )) {
You can’t perform that action at this time.
0 commit comments