Revision: 14752
          http://gate.svn.sourceforge.net/gate/?rev=14752&view=rev
Author:   johann_p
Date:     2011-12-12 19:18:32 +0000 (Mon, 12 Dec 2011)
Log Message:
-----------
NPE guard and informative exception message for the case 
that the result for a binding is null. 
This should never happen as the binding names used are 
returned from the tuple query object and must therefore exist.
But for SELECT queries that include a GROUP_CONCAT aggregate
function the value object is null.

Modified Paths:
--------------
    
gate/trunk/plugins/Ontology/src/gate/creole/ontology/impl/sesame/UtilTupleQueryIterator.java

Modified: 
gate/trunk/plugins/Ontology/src/gate/creole/ontology/impl/sesame/UtilTupleQueryIterator.java
===================================================================
--- 
gate/trunk/plugins/Ontology/src/gate/creole/ontology/impl/sesame/UtilTupleQueryIterator.java
        2011-12-12 18:57:18 UTC (rev 14751)
+++ 
gate/trunk/plugins/Ontology/src/gate/creole/ontology/impl/sesame/UtilTupleQueryIterator.java
        2011-12-12 19:18:32 UTC (rev 14752)
@@ -226,6 +226,12 @@
        BindingSet bindingSet = mResult.next();
        for (String bindingName : mVarnames) {
          Value value = bindingSet.getValue(bindingName);
+         if(value == null) {
+           throw new GateOntologyException("Could not get binding for name "+
+                   bindingName+
+                   " for binding names "+bindingSet.getBindingNames()+
+                   " for qeury "+mQuery);
+         }
          String val = value.stringValue();
          result.add(val);
        }

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Learn Windows Azure Live!  Tuesday, Dec 13, 2011
Microsoft is holding a special Learn Windows Azure training event for 
developers. It will provide a great way to learn Windows Azure and what it 
provides. You can attend the event by watching it streamed LIVE online.  
Learn more at http://p.sf.net/sfu/ms-windowsazure
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs

Reply via email to