Fix QLDocs

This commit is contained in:
Owen Mansel-Chan
2025-01-20 22:04:32 +00:00
parent 7688f46650
commit 6fa18be0cc
4 changed files with 14 additions and 9 deletions

View File

@@ -148,7 +148,7 @@ private predicate hasPathAnnotation(Annotatable annotatable) {
}
/**
* Holds if the class inherites the JaxRs `@Path` annotation.
* Holds if the class has or inherits the JaxRs `@Path` annotation.
*/
private predicate hasOrInheritsPathAnnotation(Class c) {
hasPathAnnotation(c)
@@ -156,7 +156,8 @@ private predicate hasOrInheritsPathAnnotation(Class c) {
// Note that by the JAX-RS spec, JAX-RS annotations on classes and interfaces
// are not inherited, but some implementations, like Apache CXF, do inherit
// them. I think this only applies if there are no JaxRS annotations on the
// class itself.
// class itself, as that is the rule in the JAX-RS spec for method
// annotations.
hasPathAnnotation(c.getAnAncestor()) and
not exists(c.getAnAnnotation().(JaxRSAnnotation))
}

View File

@@ -24,9 +24,11 @@ import jakarta.ws.rs.core.MultivaluedMap;
import jakarta.ws.rs.core.Response;
import jakarta.ws.rs.ext.MessageBodyReader;
// This is not a resource class because it doesn't have a @Path annotation.
// Note that inheritance of class or interface annotations is not supported in
// JAX-RS.
// By the JAX-RS spec, this is not a resource class because it doesn't
// have a @Path annotation. Inheritance of class or interface annotations
// is not supported in JAX-RS. However, this is a resource class for some
// implementations, like Apache CXF, that allow inheritance of JAX-RS
// annotations on classes and interfaces.
public class JakartaRs4 implements JakartaRsInterface { // $ RootResourceClass
public JakartaRs4() { // $ InjectableConstructor
}

View File

@@ -24,9 +24,11 @@ import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.core.Response;
import javax.ws.rs.ext.MessageBodyReader;
// This is not a resource class because it doesn't have a @Path annotation.
// Note that inheritance of class or interface annotations is not supported in
// JAX-RS.
// By the JAX-RS spec, this is not a resource class because it doesn't
// have a @Path annotation. Inheritance of class or interface annotations
// is not supported in JAX-RS. However, this is a resource class for some
// implementations, like Apache CXF, that allow inheritance of JAX-RS
// annotations on classes and interfaces.
public class JaxRs4 implements JaxRsInterface { // $ RootResourceClass
public JaxRs4() { // $ InjectableConstructor
}

View File

@@ -24,7 +24,7 @@ import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.core.Response;
import javax.ws.rs.ext.MessageBodyReader;
@Path("/resource") // This annotation has no effect, as class/interface annotations are not inherited in jax-rs
@Path("/resource")
public interface JaxRsInterface {
@GET
int Get(); // $ ResourceMethod