eclipse / lyo

Eclipse Lyo, a Java SDK for OSLC-based tool integration

Home Page:https://oslc.github.io/developing-oslc-applications/eclipse_lyo/eclipse-lyo.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OslcCoreInvalidValueTypeException is incorrectly thrown when a resource property is annotated to be represented as "inlined"

jadelkhoury opened this issue · comments

The following annotation ought to be ok. One has a property that references to a java class, whose content ought to be be fully inlined when marshalled as RDF.

@OslcValueType(ValueType.Resource)
@OslcRepresentation(Representation.Inline)
public InlinedShape getInlines() {
}

This is to be compared to how local resources are to be handled. Only difference is that a local resource ought not have a URL defined.
@OslcValueType(ValueType.LocalResource)
public LocalShape getReferencesAsLocal() {
}

But the first annotations result in an OslcCoreInvalidValueTypeException being incorrectly thrown when a resource property is annotated to be represented as "inlined".

Note that although the validateUserSpecifiedRepresentation() (which is meant to check for invalid representations) does not throw an OslcCoreInvalidRepresentationException.

private static void validateUserSpecifiedRepresentation(final Class<?> resourceClass, final Method method, final Representation userSpecifiedRepresentation, final Class<?> componentType) throws OslcCoreInvalidRepresentationException {

It is the validateUserSpecifiedValueType() method that throws an OslcCoreInvalidValueTypeException

protected static void validateUserSpecifiedValueType(final Class<?> resourceClass, final Method method, final ValueType userSpecifiedValueType, final Class<?> componentType) throws OslcCoreInvalidValueTypeException {