DESCRIPTION

SPY-39: Added toString() to operation heirarchy

Change-Id: I82334b91dea5f939affcdfab324b13044f458123


COMMENTS

author: Kenny Maynard
date: 2011-09-05 21:35:03.447000000

Uploaded patch set 2.

-------------------------------------
author: Noah Dean
date: 2011-09-05 21:57:08.626000000

Patch Set 2: I would prefer that you didn't submit this

(2 inline comments)

I think this adds too many lines of code to do something too simple.  It also can throw exceptions from toString(), which would be pretty bad in logging cases since we'd lose original data.

Line:114, src/main/java/net/spy/memcached/protocol/ascii/BaseStoreOperationImpl.java -> This would be way more readable if you just used

   "Cmd: " + type + " Key: " key [...]

here.  I don't think the "new String(data)" is a good idea, though.  byte[] -> String doesn't make sense without specifying a coding, and even then, dumping the entire thing into a String is likely to not be the right thing to do.  This code will definitely break with some input, though.

Line:82, src/main/java/net/spy/memcached/protocol/binary/MultiKeyOperationImpl.java -> I think you shouldn't be inventing join here so many times.  This should really be

    public String toString() {
        return super.toString() + " Keys: " + StringUtil.join(getKeys(), " ");
    }

-------------------------------------
author: Kenny Maynard
date: 2011-09-06 18:44:47.531000000

Patch Set 2: (2 inline comments)



Line:114, src/main/java/net/spy/memcached/protocol/ascii/BaseStoreOperationImpl.java -> Done

Line:82, src/main/java/net/spy/memcached/protocol/binary/MultiKeyOperationImpl.java -> I like the idea, but StringUtils.join(2) is from commons-lang and I don't want to add another dependency.

-------------------------------------
