Review: Needs Fixing

1. swig/xqj/XQItem.java:  public URI getNodeUri() throws XQException
3762    + try {
3763    + namespace = item.getNamespace();
3764    + } catch (Exception ex) {
3765    + //throw new XQException("Error getting Node URI: " + 
ex.getLocalizedMessage());
3766    + }

Most of the times it's wrong to catch exceptions and do nothing, please review 
and add comment on why that is the case.

2. Same file: these types are commented out, shouldn't the method return 
something for them? 
3790    + switch (itemType.getBaseType()) {
3791    + /*
3792    + case XQItemType.XQBASETYPE_ANYATOMICTYPE:
3793    + break;
3794    + case XQItemType.XQBASETYPE_ANYSIMPLETYPE:
3795    + break;
3796    + case XQItemType.XQBASETYPE_ANYTYPE:
3797    + break;
3798    + *
3799    + */

3. Also, do add the default clause for switch blocks. Most of the time is more 
useful to throw an exception if the kind of the object is not recognized 
instead of returning null.

4. swig/xqj/XQItemType.java
4167    + case XQITEMKIND_ATTRIBUTE:
4168    + // TODO: fix uriWildcard, localNameWildcard
4169    + result = TypeIdentifier.createAttributeType(...
and
4179    + case XQITEMKIND_ELEMENT:
4180    + // TODO: fix uriWildcard, localNameWildcard
4181    + result = TypeIdentifier.createElementType(...
Please fix or file bugs to track it or remove the comment if nothing to be done 
here.

5. swig/xqj/XQMetaData.java
4949    + public boolean isXQueryXSupported() throws XQException {
4950    + isClosedXQException();
4951    + return false; //depends on compilation directive
4952    + }
Same comment as 4.

-- 
https://code.launchpad.net/~zorba-coders/zorba/bug928987/+merge/99445
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to     : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp

Reply via email to