Mercurial > hg > Database > jungle-network
changeset 129:1a3edba05f50
Fixed bug NetworkJungleBulletinBoard
author | Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 11 Jan 2014 09:08:41 +0900 |
parents | 48d342e72dd7 |
children | 652a6dff6288 |
files | src/main/java/app/bbs/NetworkJungleBulletinBoard.java |
diffstat | 1 files changed, 10 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/app/bbs/NetworkJungleBulletinBoard.java Sat Jan 11 08:55:29 2014 +0900 +++ b/src/main/java/app/bbs/NetworkJungleBulletinBoard.java Sat Jan 11 09:08:41 2014 +0900 @@ -73,12 +73,18 @@ throw new IllegalStateException(); } editor = either.b(); + final long timestamp = new Date().getTime(); + ByteBuffer tBuffer = ByteBuffer.allocate(16); + either = editor.putAttribute(root.add(0),"timestamp", tBuffer.putLong(timestamp)); + if(either.isA()){ + throw new IllegalStateException(); + } + + editor = either.b(); Either<Error,JungleTreeEditor> result = editor.success(); if(result.isA()){ throw new IllegalStateException(); } - final long timestamp = new Date().getTime(); - tree = jungle.getTreeByName(_name); editor = tree.getTreeEditor(); @@ -93,8 +99,8 @@ _e = _e.getAttributes().put("author",ByteBuffer.wrap(_author.getBytes())).b(); _e = _e.getAttributes().put("mes",ByteBuffer.wrap(_initMessage.getBytes())).b(); _e = _e.getAttributes().put("key",ByteBuffer.wrap(_editKey.getBytes())).b(); - ByteBuffer tBuffer = ByteBuffer.allocate(16); - _e = _e.getAttributes().put("timestamp",tBuffer.putLong(timestamp)).b(); + ByteBuffer t2Buffer = ByteBuffer.allocate(16); + _e = _e.getAttributes().put("timestamp",t2Buffer.putLong(timestamp)).b(); return DefaultEither.newB(_e); } };