summaryrefslogtreecommitdiff
path: root/java/demo/Database/library/LibraryI.java
diff options
context:
space:
mode:
authorDwayne Boone <dwayne@zeroc.com>2014-07-14 14:13:26 -0230
committerDwayne Boone <dwayne@zeroc.com>2014-07-14 14:13:26 -0230
commit2486afcdaca3adc4983a516fd47fb67ccc7284cb (patch)
treef69af8e2f093719c89bf9d114293d1b8c8d2d17c /java/demo/Database/library/LibraryI.java
parentIncrease the IceDiscovery.Timeout (diff)
downloadice-2486afcdaca3adc4983a516fd47fb67ccc7284cb.tar.bz2
ice-2486afcdaca3adc4983a516fd47fb67ccc7284cb.tar.xz
ice-2486afcdaca3adc4983a516fd47fb67ccc7284cb.zip
ICE-5462 library demo doesn't validate input data
Diffstat (limited to 'java/demo/Database/library/LibraryI.java')
-rw-r--r--java/demo/Database/library/LibraryI.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/java/demo/Database/library/LibraryI.java b/java/demo/Database/library/LibraryI.java
index ced08c93842..6ef3acfc363 100644
--- a/java/demo/Database/library/LibraryI.java
+++ b/java/demo/Database/library/LibraryI.java
@@ -198,7 +198,7 @@ class LibraryI extends _LibraryDisp
public BookPrx
createBook(String isbn, String title, java.util.List<String> authors, Ice.Current current)
- throws BookExistsException
+ throws BookExistsException, InvalidISBNException
{
SQLRequestContext context = SQLRequestContext.getCurrentContext();
assert context != null;
@@ -212,6 +212,11 @@ class LibraryI extends _LibraryDisp
throw new BookExistsException();
}
+ if(isbn.length() > 13)
+ {
+ throw new InvalidISBNException();
+ }
+
//
// First convert the authors string to an id set.
//