diff options
Diffstat (limited to 'java/demo/Database/library/Parser.java')
-rw-r--r-- | java/demo/Database/library/Parser.java | 33 |
1 files changed, 13 insertions, 20 deletions
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"); } } |