Skip to content

Commit 0234817

Browse files
author
James Leigh
committed
Fix #896: Finish parsing background results on close
Signed-off-by: James Leigh <james.leigh@ontotext.com>
1 parent 9a2471f commit 0234817

2 files changed

Lines changed: 4 additions & 42 deletions

File tree

core/query/src/main/java/org/eclipse/rdf4j/query/impl/BackgroundGraphResult.java

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
*******************************************************************************/
88
package org.eclipse.rdf4j.query.impl;
99

10-
import java.io.IOException;
1110
import java.io.InputStream;
1211
import java.io.InputStreamReader;
1312
import java.lang.reflect.UndeclaredThrowableException;
@@ -131,28 +130,10 @@ protected void handleClose()
131130
throws QueryEvaluationException
132131
{
133132
try {
134-
try {
135-
super.handleClose();
136-
}
137-
finally {
138-
try {
139-
// After checking that we ourselves cannot possibly be generating an NPE ourselves,
140-
// attempt to close the input stream we were given
141-
InputStream toClose = in;
142-
if (toClose != null) {
143-
toClose.close();
144-
}
145-
}
146-
catch (NullPointerException e) {
147-
// Swallow NullPointerException that Apache HTTPClient is hiding behind a NotThreadSafe annotation
148-
}
149-
}
150-
}
151-
catch (IOException e) {
152-
throw new QueryEvaluationException(e);
133+
super.handleClose();
153134
}
154135
finally {
155-
queue.close();
136+
queue.done();
156137
}
157138
}
158139

core/queryresultio/api/src/main/java/org/eclipse/rdf4j/query/resultio/helpers/BackgroundTupleResult.java

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
*******************************************************************************/
88
package org.eclipse.rdf4j.query.resultio.helpers;
99

10-
import java.io.IOException;
1110
import java.io.InputStream;
1211
import java.lang.reflect.UndeclaredThrowableException;
1312
import java.util.ArrayList;
@@ -61,28 +60,10 @@ protected void handleClose()
6160
throws QueryEvaluationException
6261
{
6362
try {
64-
try {
65-
super.handleClose();
66-
}
67-
finally {
68-
try {
69-
// After checking that we ourselves cannot possibly be generating an NPE ourselves,
70-
// attempt to close the input stream we were given
71-
InputStream toClose = in;
72-
if (toClose != null) {
73-
toClose.close();
74-
}
75-
}
76-
catch (NullPointerException e) {
77-
// Swallow NullPointerException that Apache HTTPClient is hiding behind a NotThreadSafe annotation
78-
}
79-
}
80-
}
81-
catch (IOException e) {
82-
throw new QueryEvaluationException(e);
63+
super.handleClose();
8364
}
8465
finally {
85-
queue.close();
66+
queue.done();
8667
}
8768
}
8869

0 commit comments

Comments
 (0)