Enforce API: Argument(s) to TextGridObject.getInstance(...) methods must contain a valid textgrid: URI [was #7539]
Both TextGridObject factory methods allow for empty or invalid URIs (although the javadocs forbid this). Both navigator and search seem to perform such evil deed. This leads to strange exceptions when this object tries to construct some service call:
{code}
org.apache.axis2.databinding.types.URI$MalformedURIException: Cannot initialize URI with empty parameters.
at org.apache.axis2.databinding.types.URI.initialize(URI.java:412)
at org.apache.axis2.databinding.types.URI.(URI.java:273)
at org.apache.axis2.databinding.types.URI.(URI.java:261)
at info.textgrid.lab.core.model.TextGridObject.doReadMetadata(TextGridObject.java:303)
at info.textgrid.lab.core.model.TextGridObject.reloadMetadata(TextGridObject.java:561)
at info.textgrid.lab.core.model.TextGridObject.getStringValue(TextGridObject.java:785)
at info.textgrid.lab.core.model.TextGridObject.getProject(TextGridObject.java:885)
at info.textgrid.lab.core.model.ModelAdaptorFactory.getFileFor(ModelAdaptorFactory.java:52)
at info.textgrid.lab.core.model.ModelAdaptorFactory.getAdapter(ModelAdaptorFactory.java:129)
at org.eclipse.core.internal.runtime.AdapterFactoryProxy.getAdapter(AdapterFactoryProxy.java:61)
at org.eclipse.core.internal.runtime.AdapterManager.getAdapter(AdapterManager.java:306)
at org.eclipse.core.internal.runtime.AdapterManager.getAdapter(AdapterManager.java:287)
at org.eclipse.core.internal.expressions.AdaptExpression.evaluate(AdaptExpression.java:80) {code}
which will be wrapped in CrudServiceExceptions and thrown at the user.
I have attached a patch against the info.textgrid.lab.core.model plugin which asserts the URIs at least look valid. It should be enough to apply this patch, but commiting it now will cause TG-101 and thus effectively render the navigator unusable.