NullPointerException in ExtensibleDynamicEvaluationStatistics$ExtensibleDynamicEvaluationStatisticsCardinalityCalculator.getContextCardinality
#5133
Labels
🐞 bug
issue is a bug
Current Behavior
I'm currently implementing a storage sail based on the experimental extensible store. When applied the
RepositorySPARQLComplianceTestSuite
to it (usingnew SailRepository(new FooStore())
), two tests failed because of NPE. The stacktrace shows the method isExtensibleDynamicEvaluationStatistics$ExtensibleDynamicEvaluationStatisticsCardinalityCalculator.getContextCardinality
:The stacktrace:
Expected Behavior
The code should not throw NullPointerException. From this getter code, it looks like providing a default context if the var doesn't have one. So the following code will work:
The
var == null
will eliminate the NPE, but I'm not sure if that's the correct way to handle. Maybe the parametervar
should not be null at the first place?Steps To Reproduce
RepositorySPARQLComplianceTestSuite
(fromrdf4j-sparql-testsuite
) toElasticsearchStore
(fromrdf4j-sail-elasticsearch-store
)org.eclipse.rdf4j.testsuite.sparql.tests.BindTest#testBindError
should fail because of NPEA kotlin code for the test:
Version
5.0.2
Are you interested in contributing a solution yourself?
Perhaps?
Anything else?
https://github.com/eclipse-rdf4j/rdf4j/blob/main/core/sail/extensible-store/src/main/java/org/eclipse/rdf4j/sail/extensiblestore/evaluationstatistics/ExtensibleDynamicEvaluationStatistics.java#L229-L237
The text was updated successfully, but these errors were encountered: