mirror of
https://github.com/github/codeql.git
synced 2026-03-06 23:56:48 +01:00
22 lines
574 B
Plaintext
22 lines
574 B
Plaintext
/**
|
|
* @name String 'enum' used as identifier
|
|
* @description Using 'enum' as an identifier makes the code incompatible with Java 5 and later.
|
|
* @kind problem
|
|
* @problem.severity warning
|
|
* @precision low
|
|
* @id java/enum-identifier
|
|
* @tags portability
|
|
* readability
|
|
* naming
|
|
*/
|
|
|
|
import java
|
|
|
|
Element elementNamedEnum() {
|
|
result.(CompilationUnit).getPackage().getName().regexpMatch("(.*\\.|)enum(\\..*|)") or
|
|
result.getName() = "enum"
|
|
}
|
|
|
|
select elementNamedEnum(),
|
|
"Code using 'enum' as an identifier will not compile with a recent version of Java."
|