mirror of
https://github.com/github/codeql.git
synced 2026-06-14 09:21:07 +02:00
Enable recognising jakarta.persistence in dead-code queries
This commit is contained in:
@@ -3,6 +3,7 @@ import semmle.code.java.deadcode.DeadCode
|
||||
import semmle.code.java.frameworks.javaee.Persistence
|
||||
import semmle.code.java.frameworks.JAXB
|
||||
import semmle.code.java.frameworks.jackson.JacksonSerializability
|
||||
import semmle.code.java.frameworks.javaee.Persistence
|
||||
|
||||
/**
|
||||
* A field that is from a source file.
|
||||
@@ -161,10 +162,10 @@ class JpaReadField extends ReflectivelyReadField {
|
||||
this = entity.getAField() and
|
||||
(
|
||||
entity.getAccessType() = "field" or
|
||||
this.hasAnnotation("javax.persistence", "Access")
|
||||
this.hasAnnotation(getAPersistencePackageName(), "Access")
|
||||
)
|
||||
|
|
||||
not this.hasAnnotation("javax.persistence", "Transient") and
|
||||
not this.hasAnnotation(getAPersistencePackageName(), "Transient") and
|
||||
not this.isStatic() and
|
||||
not this.isFinal()
|
||||
)
|
||||
|
||||
@@ -7,6 +7,7 @@ import semmle.code.java.deadcode.StrutsEntryPoints
|
||||
import semmle.code.java.deadcode.TestEntryPoints
|
||||
import semmle.code.java.deadcode.WebEntryPoints
|
||||
import semmle.code.java.frameworks.javaee.JavaServerFaces
|
||||
import semmle.code.java.frameworks.javaee.Persistence
|
||||
import semmle.code.java.frameworks.JAXB
|
||||
import semmle.code.java.frameworks.JaxWS
|
||||
import semmle.code.java.JMX
|
||||
@@ -395,7 +396,7 @@ class PersistencePropertyMethod extends CallableEntryPoint {
|
||||
this = e.getACallable() and
|
||||
(
|
||||
e.getAccessType() = "property" or
|
||||
this.hasAnnotation("javax.persistence", "Access")
|
||||
this.hasAnnotation(getAPersistencePackageName(), "Access")
|
||||
) and
|
||||
(
|
||||
this.getName().matches("get%") or
|
||||
|
||||
Reference in New Issue
Block a user