-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathEJBMain.ql
More file actions
28 lines (25 loc) · 782 Bytes
/
EJBMain.ql
File metadata and controls
28 lines (25 loc) · 782 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/**
* @name Main Method in Enterprise Java Bean
* @description Java EE applications with a main method.
* @kind problem
* @problem.severity warning
* @precision medium
* @id java/main-method-in-enterprise-bean
* @tags security
* experimental
* external/cwe/cwe-489
*/
import java
import semmle.code.java.J2EE
deprecated import TestLib
/** The `main` method in an Enterprise Java Bean. */
deprecated class EnterpriseBeanMainMethod extends Method {
EnterpriseBeanMainMethod() {
this.getDeclaringType() instanceof EnterpriseBean and
this instanceof MainMethod and
not isTestMethod(this)
}
}
deprecated query predicate problems(EnterpriseBeanMainMethod sm, string message) {
exists(sm) and message = "Java EE application has a main method."
}