Mercurial > hg > Database > jungle-network
changeset 171:00c3cca1903c
delete nod method bug fix
author | tatsuki |
---|---|
date | Wed, 30 Jul 2014 11:15:02 +0900 |
parents | df063cf6f3b5 |
children | d483caeabffc |
files | src/main/java/app/bbs/NetworkJungleBulletinBoard.java |
diffstat | 1 files changed, 7 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/app/bbs/NetworkJungleBulletinBoard.java Wed Jul 30 10:57:19 2014 +0900 +++ b/src/main/java/app/bbs/NetworkJungleBulletinBoard.java Wed Jul 30 11:15:02 2014 +0900 @@ -463,12 +463,16 @@ _e = _e.getAttributes().delete("mes" + id ).b(); _e = _e.getAttributes().delete("timestamp" + id ).b(); int count = Integer.parseInt(id); - for (; _e.getAttributes().get("mes" + String.valueOf(count + 1)) != null; count++) { + for (; _e.getAttributes().get("mes" + String.valueOf(count + 1)) != null;) { _e = _e.getAttributes().put("mes" + count, _e.getAttributes().get("mes" + String.valueOf(count + 1))).b(); _e = _e.getAttributes().put("timestamp" + count, tBuffer).b(); + count++; } - _e = _e.getAttributes().delete("mes" + count ).b(); - _e = _e.getAttributes().delete("timestamp" + count ).b(); + if(count != Integer.parseInt(id)){ + _e = _e.getAttributes().delete("timestamp" + count ).b(); + _e = _e.getAttributes().delete("mes" + count ).b(); + } + return DefaultEither.newB(_e); } };