From d2d1ae0ca7d03f0b67f5c2086bff18f78331682d Mon Sep 17 00:00:00 2001 From: Matthew Newhook Date: Tue, 26 Aug 2008 15:32:09 -0230 Subject: Minor cleanup, added session timeout. --- java/demo/Database/library/Parser.java | 33 +++++++++++++-------------------- 1 file changed, 13 insertions(+), 20 deletions(-) (limited to 'java/demo/Database/library/Parser.java') diff --git a/java/demo/Database/library/Parser.java b/java/demo/Database/library/Parser.java index 33f15e80162..281e3762489 100644 --- a/java/demo/Database/library/Parser.java +++ b/java/demo/Database/library/Parser.java @@ -170,37 +170,30 @@ class Parser _current = next.get(0); } } + else + { + _current = null; + } printCurrent(); } void printCurrent() { - try + if(_current != null) { - if(_current != null) + System.out.println("current book is:"); + System.out.println("isbn: " + _current.isbn); + System.out.println("title: " + _current.title); + System.out.println("authors: " + _current.authors); + if(_current.rentedBy.length() > 0) { - System.out.println("current book is:"); - System.out.println("isbn: " + _current.isbn); - System.out.println("title: " + _current.title); - System.out.println("authors: " + _current.authors); - if(_current.rentedBy.length() > 0) - { - System.out.println("rented: " + _current.rentedBy); - } + System.out.println("rented: " + _current.rentedBy); } - else - { - System.out.println("no current book"); - } - } - catch(Ice.ObjectNotExistException ex) - { - System.out.println("current book no longer exists"); } - catch(Ice.LocalException ex) + else { - error(ex.toString()); + System.out.println("no current book"); } } -- cgit v1.2.3