vgritsenko 2003/12/23 20:52:53
Modified: java/src/org/apache/xindice/client/xmldb/xmlrpc CollectionImpl.java Log: Fix xmlrpc tests: check for null resource Revision Changes Path 1.39 +7 -6 xml-xindice/java/src/org/apache/xindice/client/xmldb/xmlrpc/CollectionImpl.java Index: CollectionImpl.java =================================================================== RCS file: /home/cvs/xml-xindice/java/src/org/apache/xindice/client/xmldb/xmlrpc/CollectionImpl.java,v retrieving revision 1.38 retrieving revision 1.39 diff -u -r1.38 -r1.39 --- CollectionImpl.java 24 Dec 2003 02:48:52 -0000 1.38 +++ CollectionImpl.java 24 Dec 2003 04:52:53 -0000 1.39 @@ -245,6 +245,7 @@ } } catch (Exception e) { + // FIXME Differentiate between NOT_FOUND and everything else return null; } } @@ -449,10 +450,10 @@ */ public void removeResource(Resource res) throws XMLDBException { - if (res.getId() == null) { - throw new XMLDBException(ErrorCodes.VENDOR_ERROR, - "This resource is a query result and can " + - "not be removed from the database."); + if (res == null || res.getId() == null || res.getId().length() == 0) { + // Query result resource will have null ID + throw new XMLDBException(ErrorCodes.INVALID_RESOURCE, + "Resource passed is null or its ID is empty."); } checkOpen();