mirror of
https://github.com/github/codeql.git
synced 2026-05-04 21:25:44 +02:00
Merge pull request #1189 from aschackmull/java/preconditions
Java: Support precondition calls as guards (ODASA-7796).
This commit is contained in:
24
change-notes/1.21/analysis-java.md
Normal file
24
change-notes/1.21/analysis-java.md
Normal file
@@ -0,0 +1,24 @@
|
||||
# Improvements to Java analysis
|
||||
|
||||
## New queries
|
||||
|
||||
| **Query** | **Tags** | **Purpose** |
|
||||
|-----------------------------|-----------|--------------------------------------------------------------------|
|
||||
|
||||
## Changes to existing queries
|
||||
|
||||
| **Query** | **Expected impact** | **Change** |
|
||||
|----------------------------|------------------------|------------------------------------------------------------------|
|
||||
|
||||
## Changes to QL libraries
|
||||
|
||||
* The `Guards` library has been extended to account for method calls that check
|
||||
conditions by conditionally throwing an exception. This includes the
|
||||
`checkArgument` and `checkState` methods in
|
||||
`com.google.common.base.Preconditions`, the `isTrue` and `validState` methods
|
||||
in `org.apache.commons.lang3.Validate`, as well as any similar custom
|
||||
methods. This means that more guards are recognized yielding precision
|
||||
improvements in a number of queries including `java/index-out-of-bounds`,
|
||||
`java/dereferenced-value-may-be-null`, and `java/useless-null-check`.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user