diff --git a/android-jdk6-redkale/src/com/wentch/redkale/convert/bson/BsonConvert.java b/android-jdk6-redkale/src/com/wentch/redkale/convert/bson/BsonConvert.java index 1fab98294..30f0bab2d 100644 --- a/android-jdk6-redkale/src/com/wentch/redkale/convert/bson/BsonConvert.java +++ b/android-jdk6-redkale/src/com/wentch/redkale/convert/bson/BsonConvert.java @@ -44,7 +44,7 @@ public final class BsonConvert extends Convert { } public BsonWriter pollBsonWriter() { - final BsonWriter out = writerPool.poll(); + final BsonWriter out = writerPool.get(); out.setTiny(tiny); return out; } @@ -54,7 +54,7 @@ public final class BsonConvert extends Convert { } public BsonReader pollBsonReader() { - return readerPool.poll(); + return readerPool.get(); } public void offerBsonReader(BsonReader in) { @@ -68,7 +68,7 @@ public final class BsonConvert extends Convert { public T convertFrom(final Type type, final byte[] bytes, int start, int len) { if (type == null) return null; - final BsonReader in = readerPool.poll(); + final BsonReader in = readerPool.get(); in.setBytes(bytes, start, len); @SuppressWarnings("unchecked") T rs = (T) factory.loadDecoder(type).convertFrom(in); @@ -85,7 +85,7 @@ public final class BsonConvert extends Convert { public byte[] convertTo(final Type type, Object value) { if (type == null) return null; - final BsonWriter out = writerPool.poll(); + final BsonWriter out = writerPool.get(); out.setTiny(tiny); factory.loadEncoder(type).convertTo(out, value); byte[] result = out.toArray(); @@ -108,7 +108,7 @@ public final class BsonConvert extends Convert { public byte[] convertTo(Object value) { if (value == null) { - final BsonWriter out = writerPool.poll(); + final BsonWriter out = writerPool.get(); out.setTiny(tiny); out.writeNull(); byte[] result = out.toArray(); @@ -120,7 +120,7 @@ public final class BsonConvert extends Convert { public ByteBuffer convertToBuffer(final Type type, Object value) { if (type == null) return null; - final BsonWriter out = writerPool.poll(); + final BsonWriter out = writerPool.get(); out.setTiny(tiny); factory.loadEncoder(type).convertTo(out, value); ByteBuffer result = out.toBuffer(); @@ -130,7 +130,7 @@ public final class BsonConvert extends Convert { public ByteBuffer convertToBuffer(Object value) { if (value == null) { - final BsonWriter out = writerPool.poll(); + final BsonWriter out = writerPool.get(); out.setTiny(tiny); out.writeNull(); ByteBuffer result = out.toBuffer(); diff --git a/android-jdk6-redkale/src/com/wentch/redkale/convert/json/JsonConvert.java b/android-jdk6-redkale/src/com/wentch/redkale/convert/json/JsonConvert.java index d965935e3..6f5e79597 100644 --- a/android-jdk6-redkale/src/com/wentch/redkale/convert/json/JsonConvert.java +++ b/android-jdk6-redkale/src/com/wentch/redkale/convert/json/JsonConvert.java @@ -47,7 +47,7 @@ public final class JsonConvert extends Convert { public T convertFrom(final Type type, final char[] text, int start, int len) { if (text == null || type == null) return null; - final JsonReader in = readerPool.poll(); + final JsonReader in = readerPool.get(); in.setText(text, start, len); T rs = (T) factory.loadDecoder(type).convertFrom(in); readerPool.offer(in); @@ -57,7 +57,7 @@ public final class JsonConvert extends Convert { public String convertTo(final Type type, Object value) { if (type == null) return null; if (value == null) return "null"; - final JsonWriter out = writerPool.poll(); + final JsonWriter out = writerPool.get(); out.setTiny(tiny); factory.loadEncoder(type).convertTo(out, value); String result = out.toString(); @@ -78,7 +78,7 @@ public final class JsonConvert extends Convert { public byte[] convertToUTF8Bytes(final Type type, Object value) { if (type == null) return null; if (value == null) return new byte[]{110, 117, 108, 108}; - final JsonWriter out = writerPool.poll(); + final JsonWriter out = writerPool.get(); out.setTiny(tiny); factory.loadEncoder(type).convertTo(out, value); byte[] result = out.toUTF8Bytes(); diff --git a/android-jdk6-redkale/src/com/wentch/redkale/util/ObjectPool.java b/android-jdk6-redkale/src/com/wentch/redkale/util/ObjectPool.java index 44e74496e..477a44b98 100644 --- a/android-jdk6-redkale/src/com/wentch/redkale/util/ObjectPool.java +++ b/android-jdk6-redkale/src/com/wentch/redkale/util/ObjectPool.java @@ -63,7 +63,7 @@ public final class ObjectPool { this.creator = creator; } - public T poll() { + public T get() { T result = queue.poll(); if (result == null) { if (creatCounter != null) creatCounter.incrementAndGet();