Skip to content

Commit c5a8483

Browse files
committed
resolve issue gwhalin#38
1 parent cd7440e commit c5a8483

File tree

6 files changed

+25
-4
lines changed

6 files changed

+25
-4
lines changed

README

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#Author Xingen Wang ([email protected])
22
3+
Release 2.6.6:
4+
Resove issue #38. you can now get Boolean, Long with gets command in AsciiClient.
5+
36
Release 2.6.5:
47
since nio doesn't support soTimeout, solve this issue in com.schooner.MemCached.SockInputStream.readFromChannel().
58

build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ build.dir=classes
3333
test.build.dir=testclasses
3434
build.instr.dir=classesinstr
3535
project=java_memcached-release
36-
ver=2.6.5
36+
ver=2.6.6
3737
junit.jar=lib/junit.jar
3838
slf4japi.jar=lib/slf4j-api-1.6.1.jar
3939
slf4jsimple.jar=lib/slf4j-simple-1.6.1.jar

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<groupId>com.danga</groupId>
66
<artifactId>Memcached-Java-Client</artifactId>
7-
<version>2.6.5</version>
7+
<version>2.6.6</version>
88
<packaging>jar</packaging>
99

1010
<name>Memcached-Java-Client</name>

src/main/java/com/schooner/MemCached/AscIIClient.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -854,7 +854,7 @@ public MemcachedItem gets(String cmd, String key, Integer hashCode, boolean asSt
854854
sock.flush();
855855

856856
int dataSize = 0;
857-
byte flag = 0;
857+
int flag = 0;
858858
MemcachedItem item = new MemcachedItem();
859859

860860
// get result code
@@ -878,7 +878,7 @@ public MemcachedItem gets(String cmd, String key, Integer hashCode, boolean asSt
878878
case 1:
879879
break;
880880
case 2:
881-
flag = Byte.parseByte(sb.toString());
881+
flag = Integer.parseInt(sb.toString());
882882
break;
883883
case 3:
884884
// get the data size

src/test/java/com/schooner/MemCached/MemCachedClientAsciiTest.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,15 @@ public void testGetMutiArrayStringArrayIntegerArray() {
399399
}
400400
}
401401

402+
public void testGets() {
403+
mc.set("foo1", "bar1");
404+
mc.set("foo2", 2000L);
405+
mc.set("foo3", true);
406+
assertEquals("bar1", mc.gets("foo1").value);
407+
assertEquals(2000L, mc.gets("foo2").value);
408+
assertEquals(true, mc.gets("foo3").value);
409+
}
410+
402411
public void testSetByteArray() {
403412
byte[] b = new byte[10];
404413
for (int i = 0; i < 10; i++)

src/test/java/com/schooner/MemCached/MemCachedClientBinaryTest.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,15 @@ public void testGetMutiArrayStringArrayIntegerArrayBool() {
505505
}
506506
}
507507

508+
public void testGets() {
509+
mc.set("foo1", "bar1");
510+
mc.set("foo2", 2000L);
511+
mc.set("foo3", true);
512+
assertEquals("bar1", mc.gets("foo1").value);
513+
assertEquals(2000L, mc.gets("foo2").value);
514+
assertEquals(true, mc.gets("foo3").value);
515+
}
516+
508517
public void testSetByteArray() {
509518
byte[] b = new byte[10];
510519
for (int i = 0; i < 10; i++)

0 commit comments

Comments
 (0)