mirror of
https://github.com/github/codeql.git
synced 2026-02-24 02:43:40 +01:00
Java: Clean up some instances of getQualifiedName.
This commit is contained in:
@@ -301,7 +301,7 @@ class EnvReadMethod extends Method {
|
||||
|
||||
/** The type `java.net.InetAddress`. */
|
||||
class TypeInetAddr extends RefType {
|
||||
TypeInetAddr() { this.getQualifiedName() = "java.net.InetAddress" }
|
||||
TypeInetAddr() { this.hasQualifiedName("java.net", "InetAddress") }
|
||||
}
|
||||
|
||||
/** A reverse DNS method. */
|
||||
|
||||
@@ -6,16 +6,12 @@ import java
|
||||
private import semmle.code.java.dataflow.FlowSteps
|
||||
|
||||
class ApacheHttpGetParams extends Method {
|
||||
ApacheHttpGetParams() {
|
||||
this.getDeclaringType().getQualifiedName() = "org.apache.http.HttpMessage" and
|
||||
this.getName() = "getParams"
|
||||
}
|
||||
ApacheHttpGetParams() { this.hasQualifiedName("org.apache.http", "HttpMessage", "getParams") }
|
||||
}
|
||||
|
||||
class ApacheHttpEntityGetContent extends Method {
|
||||
ApacheHttpEntityGetContent() {
|
||||
this.getDeclaringType().getQualifiedName() = "org.apache.http.HttpEntity" and
|
||||
this.getName() = "getContent"
|
||||
this.hasQualifiedName("org.apache.http", "HttpEntity", "getContent")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,14 +4,14 @@ import semmle.code.java.Type
|
||||
|
||||
class JaxbElement extends Class {
|
||||
JaxbElement() {
|
||||
this.getAnAncestor().getQualifiedName() = "javax.xml.bind.JAXBElement" or
|
||||
this.getAnAncestor().hasQualifiedName("javax.xml.bind", "JAXBElement") or
|
||||
this.getAnAnnotation().getType().getName() = "XmlRootElement"
|
||||
}
|
||||
}
|
||||
|
||||
class JaxbMarshalMethod extends Method {
|
||||
JaxbMarshalMethod() {
|
||||
this.getDeclaringType().getQualifiedName() = "javax.xml.bind.Marshaller" and
|
||||
this.getDeclaringType().hasQualifiedName("javax.xml.bind", "Marshaller") and
|
||||
this.getName() = "marshal"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -284,8 +284,7 @@ abstract class JavaxCryptoAlgoSpec extends CryptoAlgoSpec { }
|
||||
class JavaxCryptoCipher extends JavaxCryptoAlgoSpec {
|
||||
JavaxCryptoCipher() {
|
||||
exists(Method m | m.getAReference() = this |
|
||||
m.getDeclaringType().getQualifiedName() = "javax.crypto.Cipher" and
|
||||
m.getName() = "getInstance"
|
||||
m.hasQualifiedName("javax.crypto", "Cipher", "getInstance")
|
||||
)
|
||||
}
|
||||
|
||||
@@ -295,7 +294,7 @@ class JavaxCryptoCipher extends JavaxCryptoAlgoSpec {
|
||||
class JavaxCryptoSecretKey extends JavaxCryptoAlgoSpec {
|
||||
JavaxCryptoSecretKey() {
|
||||
exists(Constructor c | c.getAReference() = this |
|
||||
c.getDeclaringType().getQualifiedName() = "javax.crypto.spec.SecretKeySpec"
|
||||
c.getDeclaringType().hasQualifiedName("javax.crypto.spec", "SecretKeySpec")
|
||||
)
|
||||
}
|
||||
|
||||
@@ -320,8 +319,7 @@ class JavaxCryptoKeyGenerator extends JavaxCryptoAlgoSpec {
|
||||
class JavaxCryptoKeyAgreement extends JavaxCryptoAlgoSpec {
|
||||
JavaxCryptoKeyAgreement() {
|
||||
exists(Method m | m.getAReference() = this |
|
||||
m.getDeclaringType().getQualifiedName() = "javax.crypto.KeyAgreement" and
|
||||
m.getName() = "getInstance"
|
||||
m.hasQualifiedName("javax.crypto", "KeyAgreement", "getInstance")
|
||||
)
|
||||
}
|
||||
|
||||
@@ -331,8 +329,7 @@ class JavaxCryptoKeyAgreement extends JavaxCryptoAlgoSpec {
|
||||
class JavaxCryptoKeyFactory extends JavaxCryptoAlgoSpec {
|
||||
JavaxCryptoKeyFactory() {
|
||||
exists(Method m | m.getAReference() = this |
|
||||
m.getDeclaringType().getQualifiedName() = "javax.crypto.SecretKeyFactory" and
|
||||
m.getName() = "getInstance"
|
||||
m.hasQualifiedName("javax.crypto", "SecretKeyFactory", "getInstance")
|
||||
)
|
||||
}
|
||||
|
||||
@@ -348,8 +345,7 @@ class JavaSecurityMessageDigest extends JavaSecurityAlgoSpec {
|
||||
)
|
||||
or
|
||||
exists(Method m | m.getAReference() = this |
|
||||
m.getDeclaringType().hasQualifiedName("java.security", "MessageDigest") and
|
||||
m.getName() = "getInstance"
|
||||
m.hasQualifiedName("java.security", "MessageDigest", "getInstance")
|
||||
)
|
||||
}
|
||||
|
||||
@@ -359,7 +355,7 @@ class JavaSecurityMessageDigest extends JavaSecurityAlgoSpec {
|
||||
class JavaSecuritySignature extends JavaSecurityAlgoSpec {
|
||||
JavaSecuritySignature() {
|
||||
exists(Constructor c | c.getAReference() = this |
|
||||
c.getDeclaringType().getQualifiedName() = "java.security.Signature"
|
||||
c.getDeclaringType().hasQualifiedName("java.security", "Signature")
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -97,8 +97,7 @@ class XssVulnerableWriterSource extends MethodCall {
|
||||
this.getMethod() instanceof ServletResponseGetOutputStreamMethod
|
||||
or
|
||||
exists(Method m | m = this.getMethod() |
|
||||
m.getDeclaringType().getQualifiedName() = "javax.servlet.jsp.JspContext" and
|
||||
m.getName() = "getOut"
|
||||
m.hasQualifiedName("javax.servlet.jsp", "JspContext", "getOut")
|
||||
)
|
||||
or
|
||||
this.getMethod() instanceof FacesGetResponseWriterMethod
|
||||
|
||||
Reference in New Issue
Block a user