[redland-dev] Patch for Model class in JAVA bindings

Dave Beckett dave at dajobe.org
Mon Jun 19 05:28:37 BST 2006


Attilio Fiandrotti wrote:
> Hi
> 
> i noticed that when i call Model.getTarget() with an unexisting target,
> a new Node is created even if librdf_model_get_target() returned null,
> and so it's not possible for the user detecting if a target was found or
> not.
> With the attached patch ( that i guess should be applied also to
> getSource(), getArc(), getFeature() ) the user is able to detect a
> search with no results with something like
> 
> Node obj = model.getTarget( <my source> ,<my arc> );
> if ( obj == null ) {
>     //manage missing target
> }

Seems a good idea, I've made a patch based on yours that does this for
those three methods.  [There are probably other places this happens too]

Change applied in SVN r10987:
http://svn.librdf.org/view/bindings/trunk/java/org/librdf/redland/Model.java?rev=10987&view=log

> Attilio
> 
> ps
> 
> any chance to fix the other bug [1] i reported some times ago?
> 
> [1] http://lists.gnomehack.com/pipermail/redland-dev/2006-June/001336.html

Yeah, just now :)



> Index: java/org/librdf/redland/Model.java

Incidently these in-line patches are hard to deal with, something seems
to be doing something with the spaces or line endings.  I think they are
better as an attachment in email (or a file upload with a bug report).

Thanks for the patches.

Dave




More information about the redland-dev mailing list