On 7.12.15 5:01 , Francesco Mari wrote:
  * org.apache.jackrabbit.oak.plugins.value.ValueImpl [0] : this looks like
>something we can fix easily, just fix the Segment Property State impl to
>catch potential SNFEs instead of the generic ValueImpl
>
>
This is OAK-3740. I don't know if this approach works.
PropertyState#getValue() doesn't declare checked exception, and
RepositoryException is a checked exception. What about documenting in
PropertyState#getValue() that implementers can throw an
IllegalStateException to signal inconsistencies in the underlying code? In
this case, ValueImpl could be implemented to always wrap
IllegalStateExceptions in a RepositoryException. Moreover,
SegemntNotFoundException already is a subclass of IllegalStateException.


IMO SNFE should be exported so upstream projects can depend on it. Otherwise there is no value in throwing a specific exception in the first place.

Michael

PS: the revenge of checked exceptions ;-)

Reply via email to