Skip to content

Instantly share code, notes, and snippets.

@mariodavid
Created November 22, 2012 18:38
Show Gist options
  • Save mariodavid/4132505 to your computer and use it in GitHub Desktop.
Save mariodavid/4132505 to your computer and use it in GitHub Desktop.
hasNext() gegen noSuchElementException
public Bindings computeNext() {
Bindings inter;
boolean flag;
do {
flag = false;
if (this.originalIterator.hasNext()) {
inter = this.originalIterator.next();
if (inter == null) {
return null;
}
} else {
return null;
}
for (Variable v : this.bindingsToAdd.getVariableSet()) {
Literal literal = inter.get(v);
if (literal != null) {
flag = literal
.compareToNotNecessarilySPARQLSpecificationConform(this.bindingsToAdd
.get(v)) != 0;
}
inter.add(v, this.bindingsToAdd.get(v));
}
inter.addAllTriples(this.bindingsToAdd.getTriples());
} while (flag);
return inter;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment