i've created a ticket concerning the Sling API that the method 
Resource.getResourceType should be marke das @Nullable, i always thought it was 
a bug and that the resource type is optional [1].

carsten pointed out that the resource type is mandatory. the javadocs are not 
precise on this, i've also found no clear statement in the sling docs (I might 
not have found it).

technically there is always a resource type when the JCR resource provider is 
used (fallback to JCR primary type if sling:resourceType is not set), but 
that's not implicitly the case for other resource providers or synthetic 
resources.

if we think a resource type should be never null, we should return a default 
value for resources that do not have one, and update the documentation.

WDYT?

stefan

[1] https://issues.apache.org/jira/browse/SLING-8975

Reply via email to