Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions java/ql/lib/semmle/code/java/deadcode/DeadField.qll
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
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
Comment thread Fixed

/**
* A field that is from a source file.
Expand Down Expand Up @@ -161,10 +162,10 @@
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()
)
Expand Down
3 changes: 2 additions & 1 deletion java/ql/lib/semmle/code/java/deadcode/EntryPoints.qll
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Loading
Loading