All work

Select view

Select search mode

 

Invalid classcast in ObjectStoreException

Fixed

Description

The class ObjectStoreException in Alibaba contains this override of the
getCause() method:

@Override
public RepositoryException getCause() {
return (RepositoryException)super.getCause();
}

That triggers ClassCastException's in our unit tests, because the cause of ObjectStoreException is by no means restricted to RepositoryException's, as assumed in the method. There are also code paths in Alibaba that:

  • set the cause to e.g. QueryEvaluationException (see e.g. RDFSContainer.get).

  • set the cause to other Exception types (see e.g. ObjectIterator.close/hasNext/next)


Could this please be fixed? (either by really restricting the cause to
RepositoryException, or by dropping the override). In the former case the constructor should probably be changed to only allow RepositoryException (now it accepts any Exception as cause).

Environment

None

Details

Assignee

Reporter

Fix versions

Affects versions

Priority

Who's Looking?

Open Who's Looking?
Created February 19, 2013 at 9:56 AM
Updated May 16, 2013 at 1:29 PM
Resolved May 16, 2013 at 1:29 PM

Activity

Show:
Who's Looking?