# HG changeset patch # User Nobuyasu Oshiro # Date 1389399002 -32400 # Node ID 652a6dff62880b65bc36da43c298bb77bcd92943 # Parent 1a3edba05f503a7bf20eae190abb0f212003ac81 Fixed diff -r 1a3edba05f50 -r 652a6dff6288 src/main/java/app/bbs/NetworkJungleBulletinBoard.java --- a/src/main/java/app/bbs/NetworkJungleBulletinBoard.java Sat Jan 11 09:08:41 2014 +0900 +++ b/src/main/java/app/bbs/NetworkJungleBulletinBoard.java Sat Jan 11 09:10:02 2014 +0900 @@ -79,7 +79,6 @@ if(either.isA()){ throw new IllegalStateException(); } - editor = either.b(); Either result = editor.success(); if(result.isA()){ @@ -99,8 +98,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 t2Buffer = ByteBuffer.allocate(16); - _e = _e.getAttributes().put("timestamp",t2Buffer.putLong(timestamp)).b(); + ByteBuffer tBuffer2 = ByteBuffer.allocate(16); + _e = _e.getAttributes().put("timestamp",tBuffer2.putLong(timestamp)).b(); return DefaultEither.newB(_e); } }; diff -r 1a3edba05f50 -r 652a6dff6288 src/main/java/app/bbs/PersistentJungleBulletinBoard.java --- a/src/main/java/app/bbs/PersistentJungleBulletinBoard.java Sat Jan 11 09:08:41 2014 +0900 +++ b/src/main/java/app/bbs/PersistentJungleBulletinBoard.java Sat Jan 11 09:10:02 2014 +0900 @@ -129,11 +129,17 @@ 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 result = editor.success(); if(result.isA()){ throw new IllegalStateException(); } - final long timestamp = new Date().getTime(); tree = jungle.getTreeByName(_name); @@ -149,8 +155,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 tBuffer2 = ByteBuffer.allocate(16); + _e = _e.getAttributes().put("timestamp",tBuffer2.putLong(timestamp)).b(); return DefaultEither.newB(_e); } };